|
|
|
@ -57,7 +57,8 @@ TR_socketRecv(void * _this, size_t size) |
|
|
|
|
|
|
|
if (! remote_data) { |
|
|
|
switch (errno) { |
|
|
|
case (EAGAIN|EWOULDBLOCK): |
|
|
|
case EAGAIN: |
|
|
|
// case EWOULDBLOCK: // is the same value as EAGAIN |
|
|
|
TR_delete(remote_data); |
|
|
|
return TR_emptyRemoteData; |
|
|
|
|
|
|
|
@ -96,17 +97,25 @@ TR_socketSend(void * _this, TR_RemoteData data) |
|
|
|
// of the whole application... |
|
|
|
return -1; |
|
|
|
|
|
|
|
case (EAGAIN|EWOULDBLOCK): |
|
|
|
case EAGAIN: |
|
|
|
//case EWOULDBLOCK: // is the same value as EAGAIN |
|
|
|
return FALSE; |
|
|
|
|
|
|
|
default: |
|
|
|
case ECONNRESET: |
|
|
|
case EPIPE: |
|
|
|
// this is a remote close... |
|
|
|
return -2; |
|
|
|
|
|
|
|
default: |
|
|
|
return -2; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (size == 0) { |
|
|
|
/* |
|
|
|
* It might happen that a write returns 0. In that case the remote |
|
|
|
* end was not ready to accept the data. This might be handled |
|
|
|
* differently by the managing code so I return a separate value |
|
|
|
* for this. |
|
|
|
*/ |
|
|
|
return -3; |
|
|
|
} |
|
|
|
|
|
|
|
return size; |
|
|
|
} |
|
|
|
|