From owner-freebsd-current Sun Jun 23 23:38:14 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA28247 for current-outgoing; Sun, 23 Jun 1996 23:38:14 -0700 (PDT) Received: from sovcom.kiae.su (sovcom.kiae.su [193.125.152.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id XAA28228; Sun, 23 Jun 1996 23:38:03 -0700 (PDT) Received: by sovcom.kiae.su id AA21813 (5.65.kiae-1 ); Mon, 24 Jun 1996 09:28:45 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Mon, 24 Jun 96 09:28:45 +0300 Received: (from ache@localhost) by nagual.ru (8.7.5/8.7.3) id KAA00346; Mon, 24 Jun 1996 10:26:37 +0400 (MSD) Message-Id: <199606240626.KAA00346@nagual.ru> Subject: 'fetch' fixes to conform HTTP standard To: jkh@freebsd.org (Jordan Hubbard), asami@cs.berkeley.edu (Satoshi Asami), current@freebsd.org (FreeBSD-current) 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) X-Class: Fast X-Mailer: ELM [version 2.4ME+ PL22 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 http://www.nagual.ru/~ache/