PC Review


Reply
Thread Tools Rate Thread

chunk length was not valid in HttpWebRequest class

 
 
Eric Larson
Guest
Posts: n/a
 
      3rd Dec 2003
Chunk length was not valid in HttpWebRequest class

I've seen a lot of people getting this problem and I've done a lot of
reading, but I can't seem to find much about my particular instance...

Background: I connect my PocketPC (iPAQ 3835) via SynCE (an open source
equivilant to ActiveSync for Linux --
http://sourceforge.net/projects/synce/). The PocketPC connects to the
Linux machine and tries to browse to a website on an Apache server
(1.2.23) residing on this machine.

Most of the requests made by the PPC are dynamic content so they come
back with chunked-encoding. When a request is a certain size, it fails
(3928 bytes is one example). It also can happen when the request is
larger and individual chunks are some particular range of size (that's
harder to pin down).

This is not a public server so I can't give you any URLs. If need be, I
have a VB6 app that makes similar requests via Winsock and I can send
you the raw data back from it.

This isn't https, just http and the Apache server isn't putting white
spaces in the chunk sizes.

If I connect the PPC to a Windows machine through ActiveSync it works
just fine. So either ActiveSync is helping the PPC out or SynCE is
corrupting the data.

I tried the fix of changing the protocol to HTTP/1.0 and that did work.
However, it makes requests so much slower than before. With HTTP/1.1 we
could make 6-7 requests per second but with HTTP/1.0 it ranges from 1-4
requests every two seconds. We could settle for 1 request ever second,
but 1 request every two seconds is too slow.

NETCF 1.0
- did not work

NETCF 1.0 SP1
- did not work
NETCF 1.0 SP2 beta
- did not work at all -- requests would go out, but no data would
come back. Multiple Webexceptions were raised where
WebException.Message was simply "Webexception" when the following line
of code was executed:
Dim streamResponse As Stream = myHttpWebResponse1.GetResponseStream()

If you have any questions, let me know, I'm looking for any suggestions!

Thanks,
Eric

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Young Cho
Guest
Posts: n/a
 
      3rd Dec 2003
You are not setting the ContentLength field for the HttpWebRequest object
right? I was also told to set the AllowWriteStreamBuffering to true. That
with the SP2 beta worked for me...

Young.

"Eric Larson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Chunk length was not valid in HttpWebRequest class
>
> I've seen a lot of people getting this problem and I've done a lot of
> reading, but I can't seem to find much about my particular instance...
>
> Background: I connect my PocketPC (iPAQ 3835) via SynCE (an open source
> equivilant to ActiveSync for Linux --
> http://sourceforge.net/projects/synce/). The PocketPC connects to the
> Linux machine and tries to browse to a website on an Apache server
> (1.2.23) residing on this machine.
>

<...truncated...


 
Reply With Quote
 
Eric Larson
Guest
Posts: n/a
 
      4th Dec 2003
Thanks for the reply...

[You are not setting the ContentLength field for the HttpWebRequest
object right?]
Correct, unless I do a POST, but when I'm getting this error, it's a GET

[I was also told to set the AllowWriteStreamBuffering to true.]
Adding this line to SP2 prevented the exception, but it still runs just
as slow as HTTP/1.0 did. I was hoping that SP2 would fix this chunk
problem but still let me run quickly.

Any other suggestions?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Young Cho
Guest
Posts: n/a
 
      5th Dec 2003
I am assuming that you did comment out or removed the line that set the
ProtocolVersion property to Version10? You could check on your web server
side to see if you are indeed using HTTP 1.1 with the chunking enabled.

If both of those are true and you're seeing slow performance, then I'm not
sure what it could be. Do you have a performance requirement as well? You
also could post to and ask one of the Microsoft guys to see what the "under
the hood" fix in SP2 was...

Young.



"Eric Larson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for the reply...
>
> [You are not setting the ContentLength field for the HttpWebRequest
> object right?]
> Correct, unless I do a POST, but when I'm getting this error, it's a GET
>
> [I was also told to set the AllowWriteStreamBuffering to true.]
> Adding this line to SP2 prevented the exception, but it still runs just
> as slow as HTTP/1.0 did. I was hoping that SP2 would fix this chunk
> problem but still let me run quickly.
>
> Any other suggestions?
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The chunk length was not valid when reading from stream Thomas Microsoft Dot NET Framework 1 20th Dec 2004 12:07 PM
The chunk length was not valid when reading from stream Thomas Microsoft Dot NET 0 19th Dec 2004 05:54 PM
The chunk length was not valid Markus Posch Microsoft Dot NET Compact Framework 3 4th Dec 2003 04:18 PM
The chunk length was not valid - Not resolved Olivier P. Microsoft Dot NET Compact Framework 2 1st Dec 2003 06:24 PM
HttpWebResponse: Problems reading response stream - The chunk length was not valid exception Young Cho Microsoft Dot NET Compact Framework 8 21st Nov 2003 05:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:53 PM.