diff options
author | jmg <jmg@FreeBSD.org> | 1997-03-06 20:01:32 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 1997-03-06 20:01:32 +0000 |
commit | 66af2c92cc0142e42be2b2330aa91d7f01383cc6 (patch) | |
tree | 67c9940cc538471f3f38d9e9bbcf105af7e028cb /usr.bin/fetch/http.c | |
parent | 5daf619db7d05ff5b3e4b471d5e9c273ed0b7308 (diff) | |
download | FreeBSD-src-66af2c92cc0142e42be2b2330aa91d7f01383cc6.zip FreeBSD-src-66af2c92cc0142e42be2b2330aa91d7f01383cc6.tar.gz |
fix restarting http transfers and understanding response from server.
Slight modification of patch by wollman.
Closes PR#2870
Reviewed by: wollman
Submitted by: Marc Slemko <marcs@znep.com>
Diffstat (limited to 'usr.bin/fetch/http.c')
-rw-r--r-- | usr.bin/fetch/http.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/fetch/http.c b/usr.bin/fetch/http.c index 9ba2a90..fa445e0 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.4 1997/02/11 20:46:05 wollman Exp $ + * $Id: http.c,v 1.5 1997/03/05 18:57:16 fenner Exp $ */ #include <sys/types.h> @@ -901,9 +901,9 @@ spewerror: * output until EOF. */ if (to_stdout) - local = fopen("/dev/stdout", "w"); + local = fopen("/dev/stdout", restarting ? "a" : "w"); else - local = fopen(fs->fs_outputfile, "w"); + local = fopen(fs->fs_outputfile, restarting ? "a" : "w"); if (local == 0) { warn("%s: fopen", fs->fs_outputfile); fclose(remote); @@ -1307,7 +1307,7 @@ parse_http_content_range(char *orig, off_t *restart_from, off_t *total_length) u_quad_t first, last, total; char *ep; - if (strcasecmp(orig, "bytes") != 0) { + if (strncasecmp(orig, "bytes", 5) != 0) { warnx("unknown Content-Range unit: `%s'", orig); return EX_PROTOCOL; } |