Posting a Body longer than 32767 characters (General questions)

by wleader @, (6504 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.

locked

Re: Posting a Body longer than 32767 characters

by woddrazen @, (6504 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

locked

Re: Posting a Body longer than 32767 characters

by wleader @, (6503 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.

locked

Re: Posting a Body longer than 32767 characters

by Jasmine, (6503 days ago) @ wleader

William,

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

Kreso

locked

Re: Posting a Body longer than 32767 characters

by wleader @, (6503 days ago) @ Jasmine

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:]

locked