Browse Source

unify behaviour with tcp/udp read/write

1.0.0
Georg Hopp 12 years ago
parent
commit
44db9239cb
  1. 4
      src/i_socket.c
  2. 6
      src/udp_socket.c

4
src/i_socket.c

@ -95,10 +95,10 @@ TR_socketSend(void * _this, TR_RemoteData data)
case ENOMEM: case ENOMEM:
// these are fatal and should lead to a shutown // these are fatal and should lead to a shutown
// of the whole application... // of the whole application...
return 0;
return -1;
case (EAGAIN|EWOULDBLOCK): case (EAGAIN|EWOULDBLOCK):
return -1;
return FALSE;
case ECONNRESET: case ECONNRESET:
// this is a remote close... // this is a remote close...

6
src/udp_socket.c

@ -67,12 +67,12 @@ udpSocketRecv(TR_Socket this, size_t size)
&remote->addrlen); &remote->addrlen);
if (-1 == received) { if (-1 == received) {
rdata = TR_new(TR_RemoteData, NULL, received, remote);
TR_delete(remote);
rdata = NULL;
} else { } else {
rdata = TR_new(TR_RemoteData, buffer, received, remote); rdata = TR_new(TR_RemoteData, buffer, received, remote);
}
rdata->free_remote = 1; rdata->free_remote = 1;
}
return rdata; return rdata;
} }

Loading…
Cancel
Save