HttpWorkerRequest.ReadEntityBody returns 0

B

bstroman

I have an HttpModule to intercept the BeginReguest event and then read
the Request Stream as it is being sent. The GetPreloadedEntityBody
reads the preloaded information from the request and after the
preloaded data it calls ReadEntityBody to gather the rest of the data.
This works great in one web application on my development box.

I am now trying to integrate this code in another web application on
the same XP workstation. GetPreloadedEntityBody again works fine.
However, if the uploaded file is too big to be completely preloaded,
then ReadEntityBody is called. In this application ReadEntityBody
hangs for a while and then returns 0. Any suggestions?

Thanks,
Bob
 
M

miguel.de.icaza

Hello,
I have an HttpModule to intercept the BeginReguest event and then read
the Request Stream as it is being sent. The GetPreloadedEntityBody
reads the preloaded information from the request and after the
preloaded data it calls ReadEntityBody to gather the rest of the data.
This works great in one web application on my development box.

I am now trying to integrate this code in another web application on
the same XP workstation. GetPreloadedEntityBody again works fine.
However, if the uploaded file is too big to be completely preloaded,
then ReadEntityBody is called. In this application ReadEntityBody
hangs for a while and then returns 0. Any suggestions?

I have noticed that this depends on the client doing the post.

wget --post-file will post the content in a format that will make
ReadEntityBody return 0 but still fill the buffers up to ContentLength.
The same code with a hand-written client will make ReadEntityBody
return the right results.

The only different I could see (you can debug this using netcat: nc -l
-p PORT) is that the Content-Type is sent as www-urlform-encoded by
wget --post-file.

Miguel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top