apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/test sendfile.c
Date Fri, 09 Jan 2004 18:14:52 GMT
trawick     2004/01/09 10:14:52

  Modified:    test     Tag: APR_0_9_BRANCH sendfile.c
  Log:
  before calling apr_socket_recv() and expecting to get EOF, make
  sure there is a timeout on the socket in case the peer hasn't
  finished yet
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.25.2.1  +11 -0     apr/test/sendfile.c
  
  Index: sendfile.c
  ===================================================================
  RCS file: /home/cvs/apr/test/sendfile.c,v
  retrieving revision 1.25
  retrieving revision 1.25.2.1
  diff -u -r1.25 -r1.25.2.1
  --- sendfile.c	12 Apr 2003 11:23:54 -0000	1.25
  +++ sendfile.c	9 Jan 2004 18:14:52 -0000	1.25.2.1
  @@ -476,6 +476,17 @@
           exit(1);
       }
   
  +    /* in case this is the non-blocking test, set socket timeout;
  +     * we're just waiting for EOF */
  +
  +    rv = apr_socket_timeout_set(sock, apr_time_from_sec(3));
  +    if (rv != APR_SUCCESS) {
  +        fprintf(stderr, "apr_socket_timeout_set()->%d/%s\n",
  +                rv,
  +		apr_strerror(rv, buf, sizeof buf));
  +        exit(1);
  +    }
  +    
       bytes_read = 1;
       rv = apr_socket_recv(sock, buf, &bytes_read);
       if (rv != APR_EOF) {
  
  
  

Mime
View raw message