Showing
3 changed files
with
12 additions
and
6 deletions
| ... | ... | @@ -28,14 +28,16 @@ |
| 28 | 28 | int |
| 29 | 29 | cepBufferedRead(TR_CommEndPoint this) |
| 30 | 30 | { |
| 31 | - TR_RemoteData data = TR_socketRecv(this->transport); | |
| 31 | + TR_RemoteData data = TR_socketRecv(this->transport, this->read_chunk_size); | |
| 32 | 32 | |
| 33 | 33 | if (! data) return FALSE; |
| 34 | 34 | |
| 35 | 35 | while (data) { |
| 36 | - TR_cepAppendReadData(data); | |
| 37 | - data = TR_socketRecv(this->transport); | |
| 36 | + TR_cepAppendReadData(this, data); | |
| 37 | + data = TR_socketRecv(this->transport, this->read_chunk_size); | |
| 38 | 38 | } |
| 39 | + | |
| 40 | + return TRUE; | |
| 39 | 41 | } |
| 40 | 42 | |
| 41 | 43 | // vim: set ts=4 sw=4: | ... | ... |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | #include "tr/comm_end_point.h" |
| 27 | 27 | |
| 28 | 28 | int |
| 29 | -cepBufferedRead(TR_CommEndPoint this) | |
| 29 | +cepWriteBuffered(TR_CommEndPoint this) | |
| 30 | 30 | { |
| 31 | 31 | TR_RemoteData data = TR_cepNextWriteData(this); |
| 32 | 32 | int send = 0; |
| ... | ... | @@ -34,11 +34,14 @@ cepBufferedRead(TR_CommEndPoint this) |
| 34 | 34 | while (data) { |
| 35 | 35 | int current_send = TR_socketSend(this->transport, data); |
| 36 | 36 | |
| 37 | + send += current_send; | |
| 37 | 38 | // TODO if nothing was send put it back into the queue.. |
| 38 | 39 | // and stop loop. (This was a close.) |
| 39 | 40 | |
| 40 | - data = TR_socketRecv(this->transport); | |
| 41 | + data = TR_cepNextWriteData(this); | |
| 41 | 42 | } |
| 43 | + | |
| 44 | + return TRUE; | |
| 42 | 45 | } |
| 43 | 46 | |
| 44 | 47 | // vim: set ts=4 sw=4: | ... | ... |
Please
register
or
login
to post a comment