mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 18:45:40 +08:00
fix sockssend
This commit is contained in:
parent
baed6039c8
commit
e6a4e1d6e7
@ -15,15 +15,14 @@ int socksend(SOCKET sock, char * buf, int bufsize, int to){
|
|||||||
fds.fd = sock;
|
fds.fd = sock;
|
||||||
do {
|
do {
|
||||||
res = so._send(sock, (char *)buf + sent, bufsize - sent, 0);
|
res = so._send(sock, (char *)buf + sent, bufsize - sent, 0);
|
||||||
if(res < 0) {
|
if(res <= 0) {
|
||||||
if(errno == EAGAIN || errno == EINTR) continue;
|
if(errno != EAGAIN && errno != EINTR) break;
|
||||||
break;
|
|
||||||
fds.events = POLLOUT;
|
fds.events = POLLOUT;
|
||||||
|
fds.fd = sock;
|
||||||
if(conf.timetoexit) return sent;
|
if(conf.timetoexit) return sent;
|
||||||
res = so._poll(&fds, 1, to*1000);
|
res = so._poll(&fds, 1, to*1000);
|
||||||
if(res < 0 && (errno == EAGAIN || errno == EINTR)) continue;
|
if(res < 1 && errno != EAGAIN && errno != EINTR) break;
|
||||||
if(res < 1) break;
|
continue;
|
||||||
res = 0;
|
|
||||||
}
|
}
|
||||||
sent += res;
|
sent += res;
|
||||||
} while (sent < bufsize);
|
} while (sent < bufsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user