Discussion:
Get RAW Content?
(too old to reply)
Gohlool
2004-04-30 17:38:08 UTC
Permalink
Hi everybody!

Using wininet: how can I get the RAW Content from a Resonse from a
server/proxy wich didn't add the Content-Length header although there is a
Content??

I used the Debug version fo the Wininet and saw that it get's all the data
in but using the InternetReadFile function won't give any data??

so how can I get that data that came in and is visible in log file from
Wininet?

best regards
Gohlool
Stephen Sulzer
2004-04-30 22:11:47 UTC
Permalink
If the server does not include a Content-Length header in the response and
the connection is persistent (a "keep-alive" connection), then WinInet is in
trouble because it doesn't know how much response data to expect, and if it
tries to read more data than the server actually sends back, WinInet will
hang/timeout. WinInet uses persistent connections by default.

To try to workaround this, disable the keep-alive connection by setting a
"Connection: Close" request header. This will cause the server to close the
TCP connection after it has written the response data, so WinInet can just
keep reading data from the socket until it reaches the end.

If the server or proxy is not setting a Content-Length response header on a
persistent connection, then the server/proxy is in error.

Hope that helps.

Stephen
Post by Gohlool
Hi everybody!
Using wininet: how can I get the RAW Content from a Resonse from a
server/proxy wich didn't add the Content-Length header although there is a
Content??
I used the Debug version fo the Wininet and saw that it get's all the data
in but using the InternetReadFile function won't give any data??
so how can I get that data that came in and is visible in log file from
Wininet?
best regards
Gohlool
Continue reading on narkive:
Loading...