Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e86f1b

Browse files
committed
Put SSL_pending() call behind the new internal SSL API.
It seems likely that any SSL implementation will need a similar call, notjust OpenSSL.
1 parent6d6cade commit4e86f1b

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

‎src/interfaces/libpq/fe-misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,9 +1054,9 @@ pqSocketCheck(PGconn *conn, int forRead, int forWrite, time_t end_time)
10541054
return-1;
10551055
}
10561056

1057-
#ifdefUSE_OPENSSL
1057+
#ifdefUSE_SSL
10581058
/* Check for SSL library buffering read bytes */
1059-
if (forRead&&conn->ssl&&SSL_pending(conn->ssl)>0)
1059+
if (forRead&&conn->ssl_in_use&&pgtls_read_pending(conn)>0)
10601060
{
10611061
/* short-circuit the select */
10621062
return1;

‎src/interfaces/libpq/fe-secure-openssl.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ pgtls_open_client(PGconn *conn)
186186
returnopen_client_SSL(conn);
187187
}
188188

189+
/*
190+
* Is there unread data waiting in the SSL read buffer?
191+
*/
192+
bool
193+
pgtls_read_pending(PGconn*conn)
194+
{
195+
returnSSL_pending(conn->ssl);
196+
}
197+
189198
/*
190199
*Read data from a secure connection.
191200
*

‎src/interfaces/libpq/libpq-int.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ extern int pgtls_init(PGconn *conn);
641641
externPostgresPollingStatusTypepgtls_open_client(PGconn*conn);
642642
externvoidpgtls_close(PGconn*conn);
643643
externssize_tpgtls_read(PGconn*conn,void*ptr,size_tlen);
644+
externboolpgtls_read_pending(PGconn*conn);
644645
externssize_tpgtls_write(PGconn*conn,constvoid*ptr,size_tlen);
645646

646647
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp