From 09c8cd859c3b5e4f1eaab92d81ef7af43c7f3bf8 Mon Sep 17 00:00:00 2001 From: jmg Date: Tue, 18 May 1999 19:37:37 +0000 Subject: make md5 checksums actually work instead of simply calculating the length of an empty buffer... the output file wasn't readable... also warn that we can't checksum on stdout and print out the base64 encoded version of the md5 checksum... Site to actually return md5 digest: web.golux.com Verified that fetch was broken: Ken Coar --- usr.bin/fetch/http.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.bin/fetch') diff --git a/usr.bin/fetch/http.c b/usr.bin/fetch/http.c index 815cc7d..7851b38 100644 --- a/usr.bin/fetch/http.c +++ b/usr.bin/fetch/http.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: http.c,v 1.25 1999/02/03 20:24:53 fenner Exp $ + * $Id: http.c,v 1.26 1999/02/23 18:51:13 wollman Exp $ */ #include @@ -1006,7 +1006,7 @@ spewerror: if (to_stdout) local = fopen("/dev/stdout", restarting ? "a" : "w"); else - local = fopen(fs->fs_outputfile, restarting ? "a" : "w"); + local = fopen(fs->fs_outputfile, restarting ? "a+" : "w+"); if (local == 0) { warn("%s: fopen", fs->fs_outputfile); fclose(remote); @@ -1048,7 +1048,11 @@ spewerror: */ fseek(local, restart_from, SEEK_SET); fs->fs_status = "computing MD5 message digest"; - status = check_md5(local, base64ofmd5); + if (!to_stdout) + status = check_md5(local, base64ofmd5); + else + warnx("can't check md5 digest on stdout: %s", + base64ofmd5); free(base64ofmd5); } -- cgit v1.1