Commit 9d28e7a7 authored by David Johnson's avatar David Johnson

Fixed the bug.

parent e07d3b4e
......@@ -306,6 +306,8 @@ int main(int argc,char **argv) {
* we read what we can when we can...
*/
//printf("going for another read\n");
retval = read(send_client_fd,
&buf[current_send_rc],
block_size - current_send_rc);
......@@ -327,6 +329,23 @@ int main(int argc,char **argv) {
}
else if (errno == EAGAIN) {
// ignore, doh
//ewarn("while reading");
}
else {
//ewarn("unexpected while reading");
}
}
else if (retval == 0) {
/* dead sender */
close(send_client_fd);
FD_CLR(send_client_fd,&static_rfds);
send_client_fd = -1;
current_send_rc = 0;
if (debug > 1) {
fprintf(stderr,
"DEBUG: (send client!) disconnect!\n");
}
}
else {
......
......@@ -137,6 +137,10 @@ int main(int argc,char **argv) {
ewarn("weird");
}
}
else if (retval == 0) {
/* middleman dumped out */
efatal("middleman appears to have disappeared");
}
else {
bytesRead += retval;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment