rse         99/08/13 08:52:03

  Modified:    mpm/src/os/unix iol_socket.c
  Log:
  Hell, what a subtle problem which caused me four hours this afternoon to find.
  It's not exactly specified (even POSIX does it once this time and once this
  time) whether read() returns EWOULDBLOCK or EAGAIN. SysV usually returns
  EAGAIN, BSD usually EWOULDBLOCK. So we have to check for _both_ errno values,
  of course. This occured for me the first time after I've tried ``ab -n 1000
  en1:8080/index.txt'' where index.txt is a very large file (3MB). Then the
  sockets block often even for write operations and then the return value was
  not recognized correctly... :-(
  
  Revision  Changes    Path
  1.3       +1 -1      apache-2.0/mpm/src/os/unix/iol_socket.c
  
  Index: iol_socket.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/mpm/src/os/unix/iol_socket.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- iol_socket.c      1999/06/28 19:00:50     1.2
  +++ iol_socket.c      1999/08/13 15:52:01     1.3
  @@ -176,7 +176,7 @@
        if (rv >= 0) { \
            return rv; \
        } \
  -     if (errno == EWOULDBLOCK && iol->timeout != 0) { \
  +     if ((errno == EWOULDBLOCK || errno == EAGAIN) && iol->timeout != 0) { \
            return unix_##name##_timeout(viol, arg1, arg2); \
        } \
        return -1; \
  
  
  

Reply via email to