Bug 1021: initialize version in http_got_header
commit5c0128d82d4bd9d706ec36cc2e13cd3492ff3181
authorKalle Olavi Niemitalo <kon@iki.fi>
Fri, 4 Jul 2008 13:42:35 +0000 (4 16:42 +0300)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Fri, 4 Jul 2008 13:42:35 +0000 (4 16:42 +0300)
treee264f8226bd303aaa9dd5fcdf577fe264bd6b5aa
parentaa681786d95dbc4a92d10ecaa1a4492743fe6334
Bug 1021: initialize version in http_got_header

gcc-4.3 -O2 was complaining that http_got_header may use uninitialized
version.major and version.minor.  That indeed happened with HTTP/0.9
servers, and the PRE_HTTP_1_1(version) check then had an undefined
result, so http->close could remain 0 even though it should have
become 1; fortunately, it was then set to 1 anyway, because there was
no Content-Length header.  The undefined version was also saved in
http->recv_version, but it appears nothing ever reads that.  So in the
end, the bug did not cause any symptoms at runtime, but the warning
broke the build on gcc-4.3 if ELinks was configured with --enable-debug.
src/protocol/http/http.c