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 |
{ |
{ |
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 |
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 |
|
|