Bug in the inet driver's http mode

Per Hedeland hedeland@REDACTED
Tue Jan 3 16:14:27 CET 2006


Hi,

This is one of those cases where *I* would say "No, that can't be -
check your own code!" - but it seems I found a bug with the
{packet, http} option. Of course this option isn't documented as
far as I know, but I would have expected any bugs to be beaten out
of it long ago anyway (e.g. yaws uses it, see below). But I guess
HTTP headers with multiple continuation lines aren't all that
common.

Patch against R10B-9 below. I'm afraid I don't have a simple
reproduction case - I could probably create one if absolutely
necessary, but the bug is quite obvious from code inspection.:-)
The symptom in our case was that yaws just hung in gen_tcp:recv/3
until Timeout when a http request had (among others) a header with
about a dozen continuation lines (total header length ~ 700 bytes).

--Per Hedeland

--- otp_src_R10B-9/erts/emulator/drivers/common/inet_drv.c.orig	Mon Dec 12 15:55:13 2005
+++ otp_src_R10B-9/erts/emulator/drivers/common/inet_drv.c	Tue Jan  3 15:13:45 2006
@@ -5542,7 +5542,7 @@
 		  if (plen < n) {
 		      if (SP(ptr2+1)) {
 			  ptr1 = ptr2+1;
-			  len -= plen;
+			  len = n - plen;
 		      }
 		      else
 			  goto done;



More information about the erlang-questions mailing list