httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: svn commit: r365376 - /httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c
Date Tue, 03 Jan 2006 16:08:25 GMT
Garrett Rooney wrote:
> The problem isn't just the number of bytes we read off the wire, it's
> also that if the compiler has introduced padding between elements of
> the struct when you recv directly into the struct the data is not
> aligned with the proper members, so when you later access it you get
> the wrong values.

IIRC, since we are using chars, and no bit fields, any padding that
would be done would only be to tile the struct into an array.
Since we already tile into a 8byte/char array, no padding is
done. If we have padding *between* elements then we are royally
screwed, but the FCGI header struct was created (again, iirc)
specifically so that we're byte stream oriented.

In any case, I think it's "safer" to avoid the use of sizeof
in those places where we are sending protocol information.

   Jim Jagielski   [|]   [|]
	    "If you can dodge a wrench, you can dodge a ball."

View raw message