Discussion:
chttpfile->read problem
(too old to reply)
Dima
2004-06-25 04:30:58 UTC
Permalink
Hi all,
I have an application that I'm trying to debug where the following
problem occurrs:

a CHttpFile is waiting for a response from the server. Ethereal (a
packet capture program) sees the expected traffic come into the
computer. It is an http response packet with a 12 byte payload and it is
the first chunked response of many (so it arrives with the headers).
However the ->Read(buff,size) command never sees that data come in. It
keeps returning with 0, in which case I tell it to try again - and so on
forever.

The application works in 99% of environments, but this has been
happenning with 2 machines recently. I am pretty much stuck at this
point and am not sure where to look next. Is there anything I should
watch for? How could data possibly come into the machine, but never be
seen by the application. This program does by the way work when talking
to other servers - but that should not be an issue since the data does
come in over the wire (as confirmed by ethereal).

Any help is much appreciated,

Dmitriy
Dmitriy
2004-07-02 19:27:22 UTC
Permalink
Problem solved, but brings up another issue. The problem was that the
server was writing 12 bytes, which I guess due to buffering was not
enough for CHttpFile to return yet (although why would it hang on them
indefinitely?). The solution/hack was to decrease the size of the
buffer that is sent to the Read call down to 12 bytes, and grow it later.

This leads to a different question: is there a way to set socket options
on the socket used by CHttpFile?

Dmitriy
Post by Dima
Hi all,
I have an application that I'm trying to debug where the following
a CHttpFile is waiting for a response from the server. Ethereal (a
packet capture program) sees the expected traffic come into the
computer. It is an http response packet with a 12 byte payload and it is
the first chunked response of many (so it arrives with the headers).
However the ->Read(buff,size) command never sees that data come in. It
keeps returning with 0, in which case I tell it to try again - and so on
forever.
The application works in 99% of environments, but this has been
happenning with 2 machines recently. I am pretty much stuck at this
point and am not sure where to look next. Is there anything I should
watch for? How could data possibly come into the machine, but never be
seen by the application. This program does by the way work when talking
to other servers - but that should not be an issue since the data does
come in over the wire (as confirmed by ethereal).
Any help is much appreciated,
Dmitriy
Loading...