apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: apr/network_io/beos sendrecv.c
Date Wed, 04 Apr 2001 22:52:45 GMT
dreid       01/04/04 15:52:45

  Modified:    network_io/beos sendrecv.c
  Log:
  This change fixes the biggest outstanding bug on BeOS R5.  This may need to
  be applied to the other send/recv functions but more testing will be required
  to see if they also suffer from the problem.
  
  Suggested by Jeff Trawick.
  
  Revision  Changes    Path
  1.22      +6 -17     apr/network_io/beos/sendrecv.c
  
  Index: sendrecv.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/beos/sendrecv.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- sendrecv.c	2001/04/04 21:43:04	1.21
  +++ sendrecv.c	2001/04/04 22:52:45	1.22
  @@ -57,6 +57,7 @@
   #include "../unix/sendrecv.c"
   #else
   #include "networkio.h"
  +#include "apr_time.h"
   
   static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read)
   {
  @@ -93,7 +94,6 @@
   }
   
   #define SEND_WAIT APR_USEC_PER_SEC / 10
  -#define MAX_SEND_WAIT 2 * APR_USEC_PER_SEC
   
   apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
   {
  @@ -104,31 +104,20 @@
       } while (rv == -1 && errno == EINTR);
   
       if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) {
  -        apr_int32_t snooze = SEND_WAIT;
  +        apr_int32_t snooze_val = SEND_WAIT;
           apr_int32_t zzz = 0;  
  -        int loop = 1;
  -/*        
  -        apr_status_t arv = wait_for_io_or_timeout(sock, 0);
  -        if (arv != APR_SUCCESS) {
  -            *len = 0;
  -            return arv;
  -        }
  -        else {
  -*/
  +        
           do {
               rv = send(sock->socketdes, buf, (*len), 0);
               if (rv == -1 && errno == EWOULDBLOCK){
  -                snooze (snooze_val);
  +                apr_sleep (snooze_val);
                   zzz += snooze_val;
  -                snooze_val += (SEND_WAIT * loop++);
  +                snooze_val += SEND_WAIT;
                   /* have we passed our timeout value */
  -                if (zzz > (sock->timeout * APR_USECS_PER_SEC))
  +                if (zzz > (sock->timeout * APR_USEC_PER_SEC))
                       break;
               }
           } while (rv == -1 && (errno == EINTR || errno == EWOULDBLOCK));
  -/*
  -        }
  -*/
       }
       if (rv == -1) {
           *len = 0;
  
  
  

Mime
View raw message