Compare commits

...

5 Commits

Author SHA1 Message Date
Adrien Gallouët
caeed75918 Update mud 2016-09-21 16:17:20 +00:00
Adrien Gallouët
9a6795125d Update mud 2016-09-16 15:13:18 +00:00
Adrien Gallouët
db26fc5676 Update mud 2016-09-06 08:46:23 +00:00
Adrien Gallouët
05cc7b1087 Be more verbose when mud fails 2016-09-06 08:45:53 +00:00
Adrien Gallouët
6df1f9e243 Update mud 2016-09-05 09:31:34 +00:00
2 changed files with 23 additions and 12 deletions

2
mud

Submodule mud updated: a22476f18a...d5297b8a70

View File

@@ -453,25 +453,36 @@ int main (int argc, char **argv)
}
}
if (send_limit && mud_send(mud, send.buf, send_limit, send_tc)==send_limit) {
if (send_size>send_limit)
memmove(&send.buf[0], &send.buf[send_limit], send_size-send_limit);
send_size -= send_limit;
send_limit = send_size;
send_tc = send_next_tc;
send_next_tc = 0;
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)
memmove(&send.buf[0], &send.buf[send_limit], send_size-send_limit);
send_size -= send_limit;
send_limit = send_size;
send_tc = send_next_tc;
send_next_tc = 0;
}
}
mud_push(mud);
if (mud_push(mud)==-1 && errno!=EAGAIN)
perror("mud_push");
if (FD_ISSET(mud_fd, &rfds))
mud_pull(mud);
if (FD_ISSET(mud_fd, &rfds)) {
if (mud_pull(mud)==-1 && errno!=EAGAIN)
perror("mud_pull");
}
while (!gt.quit) {
const int size = mud_recv(mud, recv.buf, mtu);
if (size<=0)
if (size<=0) {
if (size==-1 && errno!=EAGAIN)
perror("mud_recv");
break;
}
int p = 0;