-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message


# copied from:
# http://archive.linuxfromscratch.org/mail-archives/links-list/2003/02/att-0021/01-elinks-openbsd_bug.patch
# http://archive.linuxfromscratch.org/mail-archives/links-list/2003/02/0021.html

--- src/protocol/http/http.c.orig	Sun Feb  9 02:14:19 2003
+++ src/protocol/http/http.c	Sun Feb  9 02:21:10 2003
@@ -710,6 +710,8 @@
 	}
 
 	do {
+		int init;
+
 		if (to_read == PIPE_BUF / 2) {
 			/* ... we aren't finishing yet. */
 			int written = write(conn->stream_pipes[1], data,
@@ -743,12 +745,13 @@
 			conn->stream = open_encoded(conn->stream_pipes[0],
 					conn->content_encoding);
 			if (!conn->stream) return NULL;
-		}
+			else init = 1;
+		} else init = 0;
 
 		output = (unsigned char *) mem_realloc(output, *new_len + to_read);
 		if (!output) break;
 
-		did_read = read_encoded(conn->stream, output + *new_len, to_read);
+		did_read = read_encoded(conn->stream, output + *new_len, init ? PIPE_BUF / 4 : to_read);
 		if (did_read > 0) *new_len += did_read;
 	} while (!(!len && did_read != to_read));
 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+Wnf/SypIl9OdoOMRAiKLAJ9UoMBFqKp6Z5WQPCpWyyLnZ5js3ACfbalV
mEIH0ioE4rpuE/Tmcu9nj08=
=5S2+
-----END PGP SIGNATURE-----
