Compare commits
3 Commits
v0.0.62-mu
...
v0.0.64-mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a6795125d | ||
|
|
db26fc5676 | ||
|
|
05cc7b1087 |
2
mud
2
mud
Submodule mud updated: 1659caa7ca...f6acc993a0
21
src/main.c
21
src/main.c
@@ -453,7 +453,11 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send_limit && mud_send(mud, send.buf, send_limit, send_tc)==send_limit) {
|
if (send_limit) {
|
||||||
|
int r = mud_send(mud, send.buf, send_limit, send_tc);
|
||||||
|
if (r==-1 && errno!=EAGAIN) {
|
||||||
|
perror("mud_send");
|
||||||
|
} else if (r==send_limit) {
|
||||||
if (send_size>send_limit)
|
if (send_size>send_limit)
|
||||||
memmove(&send.buf[0], &send.buf[send_limit], send_size-send_limit);
|
memmove(&send.buf[0], &send.buf[send_limit], send_size-send_limit);
|
||||||
send_size -= send_limit;
|
send_size -= send_limit;
|
||||||
@@ -461,17 +465,24 @@ int main (int argc, char **argv)
|
|||||||
send_tc = send_next_tc;
|
send_tc = send_next_tc;
|
||||||
send_next_tc = 0;
|
send_next_tc = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mud_push(mud);
|
if (mud_push(mud)==-1 && errno!=EAGAIN)
|
||||||
|
perror("mud_push");
|
||||||
|
|
||||||
if (FD_ISSET(mud_fd, &rfds))
|
if (FD_ISSET(mud_fd, &rfds)) {
|
||||||
mud_pull(mud);
|
if (mud_pull(mud)==-1 && errno!=EAGAIN)
|
||||||
|
perror("mud_pull");
|
||||||
|
}
|
||||||
|
|
||||||
while (!gt.quit) {
|
while (!gt.quit) {
|
||||||
const int size = mud_recv(mud, recv.buf, mtu);
|
const int size = mud_recv(mud, recv.buf, mtu);
|
||||||
|
|
||||||
if (size<=0)
|
if (size<=0) {
|
||||||
|
if (size==-1 && errno!=EAGAIN)
|
||||||
|
perror("mud_recv");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
int p = 0;
|
int p = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user