/[pengfork]/pengfork/src/buffer.c
ViewVC logotype

Diff of /pengfork/src/buffer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by chupa, Sun Dec 1 01:19:07 2002 UTC revision 1.9 by chupa, Tue Dec 3 18:38:15 2002 UTC
# Line 140  buffer_recv (buffer, fd) Line 140  buffer_recv (buffer, fd)
140    while (nread > 0 && len > 0);    while (nread > 0 && len > 0);
141    buffer_alloc (buffer, total);    buffer_alloc (buffer, total);
142    if (nread == -1 && errno != EAGAIN)    if (nread == -1 && errno != EAGAIN)
143      return 0;      return -1;
144    
145    if (len == 0 && buffer->used < buffer->size)    if (len == 0 && buffer->used < buffer->size)
146      {      {
# Line 160  buffer_recv (buffer, fd) Line 160  buffer_recv (buffer, fd)
160        while (nread > 0 && len > 0);        while (nread > 0 && len > 0);
161        buffer_alloc (buffer, total2);        buffer_alloc (buffer, total2);
162        if (nread == -1 && errno != EAGAIN)        if (nread == -1 && errno != EAGAIN)
163          return 0;          return -1;
164        total += total2;        total += total2;
165      }      }
166    
167    debug (3, "buffer - %d bytes received\n", total);    debug (3, "buffer - %d bytes received\n", total);
168    return 1;    return total;
169  }  }
170    
171  int  int
# Line 193  buffer_send (buffer, fd) Line 193  buffer_send (buffer, fd)
193    while (nwrote > 0 && len > 0);    while (nwrote > 0 && len > 0);
194    
195    if (nwrote == -1 && errno != EAGAIN)    if (nwrote == -1 && errno != EAGAIN)
196      return 0;      return -1;
197    
198    buffer_free (buffer, total);    buffer_free (buffer, total);
199    
200    debug (3, "buffer - %d bytes sended\n", total);    debug (3, "buffer - %d bytes sended\n", total);
201    return 1;    return total;
202  }  }
203    
204    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26