473,491 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HttpWorkerRequest.ReadEntityBody returns 0

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

Nov 19 '05 #1
2 2557
Is this a bug in the .NET Framework?

Nov 19 '05 #2
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.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8764
by: lkrubner | last post by:
www.php.net says: >>>>>>>>>>>> Only for SELECT,SHOW,EXPLAIN or DESCRIBE statements mysql_query() returns a resource identifier or FALSE if the query was not executed correctly. For other type of...
4
7108
by: ezra epstein | last post by:
Aother head banger for me. Below is a complete example of the code Using Postgres 7.4, the function "test" gets this: psql:temp3.sql:10: ERROR: syntax error at or near "%" at character 135...
0
1375
by: Vladimir Nesterovsky | last post by:
Hello there, I don't know to whom this message is addressed, however I believe there is a bug in the HasEntityBody method of the HttpWorkerRequest class. public bool HasEntityBody() { string...
5
1577
by: Susan Geller | last post by:
Character returns stored in a table do not display in a textbox or on a datagrid on my .net form. The text displays without the returns making the text difficult to read. When I "view source" on...
0
371
by: bstroman | last post by:
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...
6
2957
by: Jason Chu | last post by:
situation: I'm uploading file to my application using a java applet sending the request (the file) through socket to my asp.net page. On my asp.net page, I've override the httpmodule to take in...
1
1485
by: Jason Chu | last post by:
I have a problem with ReadEntityBody returning 0 even if there's more things to be read (bytes counter for the number of bytes read is less than that of the contentlength). Suggestions?
0
1579
by: Andrea | last post by:
I'm trying to do a simple file uploader (well I know that there is a lot around, but it's just to learn) but I don't know how to get the chunk of file. I've started to use the...
1
1616
by: Eric Pearson | last post by:
I implement my own HTTP server and pass ASP.Net requests via HttpWorkerRequest. When I authenticate a client, I pass the correct windows token inside of GetUserToken(), and within my...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.