* win32/win32.c (rb_w32_fclose, rb_w32_close): shutdown socket

before closesocket(). fixed: [ruby-dev:25112]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2004-12-08 02:54:24 +00:00
parent e41a1c0f10
commit bc4088d768
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Wed Dec 8 11:52:51 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_fclose, rb_w32_close): shutdown socket
before closesocket(). fixed: [ruby-dev:25112]
Wed Dec 8 11:46:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (string_content): get rid of segfault at empty evstr.

View File

@ -3405,6 +3405,8 @@ rb_w32_fclose(FILE *fp)
}
_set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);
fclose(fp);
shutdown(sock, 0);
shutdown(sock, 1);
if (closesocket(sock) == SOCKET_ERROR) {
errno = map_errno(WSAGetLastError());
return -1;
@ -3421,6 +3423,8 @@ rb_w32_close(int fd)
UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN);
return _close(fd);
}
shutdown(sock, 0);
shutdown(sock, 1);
if (closesocket(sock) == SOCKET_ERROR) {
errno = map_errno(WSAGetLastError());
return -1;