Opera, POST, and the W5100 Indirect Driver
Mike G
Posts: 2,702
I found , at least with my code, that the W5100 Indirect Driver does not return POST data to the Propeller when the request comes form Opera. I suppose the @data pointer returned from the driver could be zero terminated before the message body? Can anyone confirm this?
Opera also causes unexpected results as compared to the other browsers, IE, Firefox and Chrome. Sometimes a resource request is served up no problem. Other times I see 0 data, try again and the data is there, and often I see a timeout before the data is severed up. I was hoping that I didn't have to mess with the driver and I could focus on the web server and my project but I guess it's time to dive in.
Opera also causes unexpected results as compared to the other browsers, IE, Firefox and Chrome. Sometimes a resource request is served up no problem. Other times I see 0 data, try again and the data is there, and often I see a timeout before the data is severed up. I was hoping that I didn't have to mess with the driver and I could focus on the web server and my project but I guess it's time to dive in.
Comments
I've not looked at your code, and my apologizes if this is a too basic question, but you are aware that rxtcp() may return random amount of data at all times, e.g. the first call may return "GE" and the next return "T /index.html", so you have to collect the stream yourself..? This is inherent tcp, but is very much affected by the peer client implementation, and may differ from browser to browser.
If the request is a POST, I check the length of the body by finding the two lines (\n\n or \r\n\r\n). Then I calculate the length of the body. Next, I comparing the body length to the "Content-Length:". Finally, I try to handle any missing POST data. Something happens between the initial POST request and the next GET request. The GET is grabbing an image on the page.
Kuisma, are you able to retrieve body content on a POST using Opera? Am I the only person having this problem or the first to report the problem?
IE, Firefox, and Chrome all work as expected.
Supply me with an example (code, data), and I'll test it.
Ok, this is a very elementary question and it's not as much about the spinneret as the web server loogic, and I am making the assumption that you are reading in the data before you try to parse it, and I'm sure I am not as familiar with tcp and HTTP protocols as I should be any more. End of disclaimers...
But, How do you know when you don't have any more data to read?? Right now, I'm using a version of Tim's driver and when I call HTTPReady, I get back a buffer with data in it. Sometimes especially in a POST transaction, it comes back with just the header data and the form data is not there. It just ends at the blank line. But, by the time I realize that ( while I'm parsing out the record ), it's been quite a while... When I don't get the form data, everything looks ok except there isn't any form data Will I always have form data with a post transaction?? The header/body of the message ends with the same CRLFCRLF as the record does after the form data...
http://www.w3.org/Protocols/