daemon: diagnose socket write failure

* daemon/proto.c (send_chunk): Don't ignore socket-write error.
* daemon/proto.c (send_file_end): Return "int", not void,
so we can propagate send_chunk failure to caller.
* daemon/daemon.h (send_file_end): Update prototype.
* daemon/tar.c (do_tar_out, do_tgz_out): Update uses of send_file_end.
* daemon/upload.c (do_download): Likewise.
This commit is contained in:
Jim Meyering
2009-08-20 12:29:46 +02:00
parent 0c92c583d5
commit d1c35f8710
4 changed files with 19 additions and 9 deletions

View File

@@ -129,6 +129,8 @@ do_download (const char *filename)
return -1;
}
send_file_end (0); /* Normal end of file. */
if (send_file_end (0)) /* Normal end of file. */
return -1;
return 0;
}