apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1531094 - in /apr/apr/branches/1.5.x: ./ CHANGES network_io/win32/sockopt.c
Date Thu, 10 Oct 2013 20:10:17 GMT
Author: trawick
Date: Thu Oct 10 20:10:16 2013
New Revision: 1531094

URL: http://svn.apache.org/r1531094
Log:
Merge r1523384 and r1523615 from trunk:

On Windows, a socket timeout isn't implemented with
non-blocking socket + poll.  When a socket is non-
blocking and a timeout is set, the non-blocking
state must be disabled.

(plus the subsequent fix to adjust the socket state)

Modified:
    apr/apr/branches/1.5.x/   (props changed)
    apr/apr/branches/1.5.x/CHANGES
    apr/apr/branches/1.5.x/network_io/win32/sockopt.c

Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1523384,1523615

Modified: apr/apr/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?rev=1531094&r1=1531093&r2=1531094&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.5.x/CHANGES [utf-8] Thu Oct 10 20:10:16 2013
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.5.0
 
+  *) apr_socket_timeout_set() on Windows: If the socket was in a non-
+     blocking state before, disable that setting so that timeouts work.
+     [Jeff Trawick]
+
   *) File info APIs: Fix calculation of atime and mtime on AIX. PR 51146.
      [Ruediger Pluem]
 

Modified: apr/apr/branches/1.5.x/network_io/win32/sockopt.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/network_io/win32/sockopt.c?rev=1531094&r1=1531093&r2=1531094&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/network_io/win32/sockopt.c (original)
+++ apr/apr/branches/1.5.x/network_io/win32/sockopt.c Thu Oct 10 20:10:16 2013
@@ -63,9 +63,10 @@ APR_DECLARE(apr_status_t) apr_socket_tim
     }
     else if (t > 0) {
         /* Set the socket to blocking if it was previously non-blocking */
-        if (sock->timeout == 0) {
+        if (sock->timeout == 0 || apr_is_option_set(sock, APR_SO_NONBLOCK)) {
             if ((stat = soblock(sock->socketdes)) != APR_SUCCESS)
                 return stat;
+            apr_set_option(sock, APR_SO_NONBLOCK, 0);
         }
         /* Reset socket timeouts if the new timeout differs from the old timeout */
         if (sock->timeout != t) 



Mime
View raw message