You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2013/09/15 03:35:25 UTC

svn commit: r1523384 - in /apr/apr/trunk: CHANGES network_io/win32/sockopt.c

Author: trawick
Date: Sun Sep 15 01:35:24 2013
New Revision: 1523384

URL: http://svn.apache.org/r1523384
Log:
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.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/network_io/win32/sockopt.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1523384&r1=1523383&r2=1523384&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Sun Sep 15 01:35:24 2013
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.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]
+
   *) Add support for Berkeley DB 6.0. [Rainer Jung]
 
   *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from

Modified: apr/apr/trunk/network_io/win32/sockopt.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/win32/sockopt.c?rev=1523384&r1=1523383&r2=1523384&view=diff
==============================================================================
--- apr/apr/trunk/network_io/win32/sockopt.c (original)
+++ apr/apr/trunk/network_io/win32/sockopt.c Sun Sep 15 01:35:24 2013
@@ -63,7 +63,7 @@ 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;
         }