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 2004/01/09 19:13:52 UTC

cvs commit: apr/test sendfile.c

trawick     2004/01/09 10:13:52

  Modified:    test     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
  1.29      +11 -0     apr/test/sendfile.c
  
  Index: sendfile.c
  ===================================================================
  RCS file: /home/cvs/apr/test/sendfile.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- sendfile.c	24 Nov 2003 13:22:46 -0000	1.28
  +++ sendfile.c	9 Jan 2004 18:13:52 -0000	1.29
  @@ -484,6 +484,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) {