ws2_32: WSACleanup cleans up open sockets (OSX only)

Matt Durgavich mattdurgavich at gmail.com
Fri Aug 28 17:28:37 CDT 2015


And the renaming patch


 dlls/ws2_32/socket.c | 2 +-
 server/protocol.def  | 2 +-
 server/sock.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index a4c442f..b5d5ff5 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1473,7 +1473,7 @@ INT WINAPI WSACleanup(void)
         num_startup--;
         if (num_startup == 0) 
         {
-          SERVER_START_REQ(close_process_sockets) 
+          SERVER_START_REQ(socket_cleanup) 
           {
             wine_server_call( req );
           }
diff --git a/server/protocol.def b/server/protocol.def
index fb63da1..2dccb9a 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -943,7 +943,7 @@ struct rawinput_device
 @END
 
 /* Close all sockets for the current process */
- at REQ(close_process_sockets)
+ at REQ(socket_cleanup)
 @END
 
 /* Set a handle information */
diff --git a/server/sock.c b/server/sock.c
index c077755..c5c5083 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1384,7 +1384,7 @@ DECL_HANDLER(get_socket_info)
     release_object( &sock->obj );
 }
 
-DECL_HANDLER(close_process_sockets)
+DECL_HANDLER(socket_cleanup)
 {
     obj_handle_t sock;
     unsigned int index = 0;
-- 
2.3.2 (Apple Git-55)

> On Aug 28, 2015, at 10:37 AM, Bruno Jesus <00cpxxx at gmail.com> wrote:
> 
> On Fri, Aug 28, 2015 at 8:30 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
>> On 28 August 2015 at 05:46, Matt Durgavich <mattdurgavich at gmail.com> wrote:
>>> +DECL_HANDLER(close_all_sockets)
>> You'll want to just move this to sock.c and avoid making sock_ops
>> available outside sock.c. You may want to change the request name to
>> something along the lines of "close_process_sockets", since it only
>> closes sockets for the current process, not all sockets the server
>> knows about.
> 
> I think a better name would be winsock_cleanup or socket_cleanup
> because closing the sockets may not be the only action required to
> proper implement WSACleanup.
> 
>> +        }
>> +        else
>> +        {
>> +            TRACE("pending cleanups: %d\n", num_startup);
>> +        }
> 
> Please just drop the else and let the message be printed so the amount
> of cleanups and starts is always displayed in the log.




More information about the wine-devel mailing list