Browse Source

unify behaviour with tcp/udp read/write

1.0.0
Georg Hopp 11 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:
// these are fatal and should lead to a shutown
// of the whole application...
return 0;
return -1;
case (EAGAIN|EWOULDBLOCK):
return -1;
return FALSE;
case ECONNRESET:
// this is a remote close...

6
src/udp_socket.c

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

Loading…
Cancel
Save