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

Commita8a983e

Browse files
committed
On Windows, also call shutdown() while closing the client socket.
Further experimentation shows that commit6051857 is not sufficientwhen using (some versions of?) OpenSSL. The reason is obscure, butcalling shutdown(socket, SD_SEND) improves matters.Per testing by Andrew Dunstan and Alexander Lakhin.Back-patch as before.Discussion:https://postgr.es/m/af5e0bf3-6a61-bb97-6cba-061ddf22ff6b@dunslane.net
1 parente2ebc90 commita8a983e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,16 @@ socket_close(int code, Datum arg)
294294
* not yet sent to the client. (This is a flat-out violation of the
295295
* TCP RFCs, but count on Microsoft not to care about that.) To get
296296
* the spec-compliant "graceful shutdown" behavior, we must invoke
297-
* closesocket() explicitly.
297+
* closesocket() explicitly. When using OpenSSL, it seems that clean
298+
* shutdown also requires an explicit shutdown() call.
298299
*
299300
* This code runs late enough during process shutdown that we should
300301
* have finished all externally-visible shutdown activities, so that
301302
* in principle it's good enough to act as a synchronous close on
302303
* Windows too. But it's a lot more fragile than the other way.
303304
*/
304305
#ifdefWIN32
306+
shutdown(MyProcPort->sock,SD_SEND);
305307
closesocket(MyProcPort->sock);
306308
#endif
307309

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp