Posting a Body longer than 32767 characters - WeOnlyDo Discussion board

Posting a Body longer than 32767 characters (General questions)

by wleader, Tuesday, July 17, 2007, 18:42 (6342 days ago)


When I use the wodHttpDlx component via COM and I create a request with a body longer than 32767 characters, the Post method never returns. If the request body is shorter than this, there are no problems. When logging is turned on, the log stops at the 32767th character of the body. Normally any post would be for a short piece of data like submitting a form, but when uploading a file larger that 32KB, the request body can get long enough to trigger this problem.

Since 32767 is the upper limit on a signed 16 bit integer, I suspect that there is a loop in the code that copies the body data from a buffer to the socket, and that the iterator of the loop is a 16 bit integer. When it gets to the 32767th character, the iterator overflows.

I can provide a sample that reproduces this behavior if needed.

Re: Posting a Body longer than 32767 characters

by woddrazen, Wednesday, July 18, 2007, 01:25 (6342 days ago) @ wleader

Hi William,


Yes please zip and send us sample that will duplicate your issue to techsupport@weonlydo.com

Sample will help us to duplicate your issue on our side so we can find solution to your problem.


Regards,
Drazen

Re: Posting a Body longer than 32767 characters

by wleader, Wednesday, July 18, 2007, 15:10 (6341 days ago) @ woddrazen

Well I was making a sample application, but I found that when I didn't set any headers it worked even with a large body. When I added the same headers as my other code, it failed, again. I've found that if I add the header 'Transfer-Encoding: chunked' causes the failure. I'm going to see if I can't work around this.

Re: Posting a Body longer than 32767 characters

by wodSupport, Wednesday, July 18, 2007, 15:14 (6341 days ago) @ wleader

William,

but why do you set 'chunked' header by yourself?

Kreso

Re: Posting a Body longer than 32767 characters

by wleader, Wednesday, July 18, 2007, 19:03 (6341 days ago) @ wodSupport

I was setting it because I am trying to replicate a SOAP With Attachements over HTTP and I probably saw it in a sample message somewhere. I took it out since I don't need it. Things are working fine now. [:happy:]