Commit 44db9239cbaa0d077d0381686bfaedceb291889b

Authored by Georg Hopp
1 parent a0975ff3

unify behaviour with tcp/udp read/write

@@ -95,10 +95,10 @@ TR_socketSend(void * _this, TR_RemoteData data) @@ -95,10 +95,10 @@ TR_socketSend(void * _this, TR_RemoteData data)
95 case ENOMEM: 95 case ENOMEM:
96 // these are fatal and should lead to a shutown 96 // these are fatal and should lead to a shutown
97 // of the whole application... 97 // of the whole application...
98 - return 0; 98 + return -1;
99 99
100 case (EAGAIN|EWOULDBLOCK): 100 case (EAGAIN|EWOULDBLOCK):
101 - return -1; 101 + return FALSE;
102 102
103 case ECONNRESET: 103 case ECONNRESET:
104 // this is a remote close... 104 // this is a remote close...
@@ -67,13 +67,13 @@ udpSocketRecv(TR_Socket this, size_t size) @@ -67,13 +67,13 @@ udpSocketRecv(TR_Socket this, size_t size)
67 &remote->addrlen); 67 &remote->addrlen);
68 68
69 if (-1 == received) { 69 if (-1 == received) {
70 - rdata = TR_new(TR_RemoteData, NULL, received, remote); 70 + TR_delete(remote);
  71 + rdata = NULL;
71 } else { 72 } else {
72 rdata = TR_new(TR_RemoteData, buffer, received, remote); 73 rdata = TR_new(TR_RemoteData, buffer, received, remote);
  74 + rdata->free_remote = 1;
73 } 75 }
74 76
75 - rdata->free_remote = 1;  
76 -  
77 return rdata; 77 return rdata;
78 } 78 }
79 79
Please register or login to post a comment