Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PsiControl: PicoTCP webserver not parsing the body of a HTTP POST request #3

Open
BrechtN opened this issue Jan 7, 2015 · 7 comments
Labels

Comments

@BrechtN
Copy link

BrechtN commented Jan 7, 2015

firefox http post tcp stream
ie http post request response tcp stream

ie http post request is split in different packets

Hello,

We currently have an issue with the PicoTCP webserver code when performing a HTTP POST request.
When we send a POST request using internet explorer, this request is sent in 2 different packets:

packet 1 contains the header of this request:
POST /eepromwrite HTTP/1.1
Accept: /
Referer: http://192.168.100.150/eeprom.html
Accept-Language: nl-be
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: 192.168.100.150
Content-Length: 16
Connection: Keep-Alive
Cache-Control: no-cache

packet 2 contains the body of the request:
index=40&value=1

From what I can see, the PicoTCP HTTP server code reads the TCP stream and, once a HTTP header is received correctly, it calls up the user code to notify there is a new request. During this check for HTTP headers, the "readRemainingHeader" function of the picotcp server also scans if there isn't some body data and, if so, makes it available to the user code. If there was no body, it doesn't do anything and still calls the user code with "I have a new request".
The user code then checks the request and asks picotcp if there is a body.

Now here's the trick:
In firefox this request is sent in 1 packet, so when the picotcp code examines the request, the TCP stream has already received the body. It makes it available to our user code and we perform the action needed.
In Internet Explorer however, this request is split in 2 packets, right after the header of the request. The picotcp server code inspects the header and sees there is no body data (yet), but still happily calls our user code.

In both cases, the header of the request indicates there is body data: "Content-Length: 16". So why does the picotcp code ignore this?

Please find some captures and screenshots attached.

Kind regards,
Brecht

@danielinux danielinux added the bug label Jan 8, 2015
@danielinux
Copy link
Contributor

Hi @BrechtN - Thanks for reporting. It looks like a bug indeed. As you know, we haven't tested these library extensively against IE.

I am putting this on the PicoTCP backlog, and it will be fixed as soon as we have some resource to assign to it. If you think this is a showstopper or it gets urgent for you, please contact us and we will try to speed things up.

@BrechtN
Copy link
Author

BrechtN commented Jan 26, 2015

Hi @danielinux,

Do you have an idea when this issue will be fixed? There is a release of our software planned at the end of February.

Kind regards,
Brecht

@danielinux
Copy link
Contributor

Hello @BrechtN -
One resource is currently assigned to fix this. We have a test failing with wget as well, so this should be quicker to debug.

Thanks for the report, we'll keep you posted.

@danielinux
Copy link
Contributor

@dpmik we are changing owner for this (bert). Can you update this issue with your latest findings?
Thanks

@danielinux
Copy link
Contributor

@eco747
Copy link

eco747 commented Jan 23, 2016

+1 for me

@robbinvandamme
Copy link
Contributor

@bertdewaele, are you (bert) who looked into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants