Date: Mon, 24 Jun 1996 10:26:37 +0400 (MSD) From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) <ache@nagual.ru> To: jkh@freebsd.org (Jordan Hubbard), asami@cs.berkeley.edu (Satoshi Asami), current@freebsd.org (FreeBSD-current) Subject: 'fetch' fixes to conform HTTP standard Message-ID: <199606240626.KAA00346@nagual.ru>
next in thread | raw e-mail | index | archive | help
This patch fix various errors including 'content-length' never counted, please apply it (don't forget two newlines in GET request if you decide to edit file manually). *** main.c.orig Sun Jun 23 06:51:40 1996 --- main.c Mon Jun 24 10:20:02 1996 *************** *** 471,477 **** restart = 0; s = http_open (); ! sprintf (str, "GET /%s\n", file_to_get); i = strlen (str); if (i != write (s, str, i)) err (1, 0); --- 471,477 ---- restart = 0; s = http_open (); ! sprintf (str, "GET /%s HTTP/1.0\n\n", file_to_get); i = strlen (str); if (i != write (s, str, i)) err (1, 0); *************** *** 539,545 **** s[header_len] = 0; if (len && (header_len < S)) return; ! if (match (".*200.*success", s) == 0) { /* maybe not found, or document w/o header */ if (match (".*404.*not found", s)) { fprintf (stderr, "%s not found\n%s\n", file_to_get, s); --- 539,545 ---- s[header_len] = 0; if (len && (header_len < S)) return; ! if (match (".*200 +OK", s) == 0) { /* maybe not found, or document w/o header */ if (match (".*404.*not found", s)) { fprintf (stderr, "%s not found\n%s\n", file_to_get, s); -- Andrey A. Chernov <ache@nagual.ru> http://www.nagual.ru/~ache/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606240626.KAA00346>