Hello,
I am using the RL-ARM/TCPNET web server to process form data (sent via the POST method) and also for file upload.
File upload works absolutely fine. I can upload a 20K or 30K text file, which would obviously be broken up across many TCP packets, without issues.
With POSTed form data, however, I find that if the entire POST message from the client is too large to fit within one TCP packet, then cgi_process_data is only called to process the form data that was contained within the first TCP packet. After this point, the data is truncated and remaining form data is lost. The result if this is that when you're submitting a form with lots of controls, data from form controls on the lower part of the page is never registered.
To give an example, in the uVision debugger I see that the HTML POST message header begins at 0x0400A10. After the initial headers, the form content starts at 0x0400A3EF and abruptly ends at 0x0400A6B5. So the total data length there is 1460 bytes which I presume to be the TCP packet MSS (maximum segment size).
Oddly, I can see that at 0x0400A6FA, the form data continues again from where it was broken. Between that memory location and where the first block of form data ended, there's garbage data. It's almost as if the server is 'trying' to reassemble the form data from the two (or more) packets into a contiguous block but something's going wrong.
The result of this is that there's quite a low limit on the total number of form controls you can have on a page; I have to limit them such that when they're all POSTed back, everything will fit within one packet. This is causing me a lot of grief now though, as I have certain pages with "too many" form controls and yet it really isn't practical for me to break them up into several more pages.
An obvious way to pack more form controls into one packet is to minimise the name length for each control. Admittedly the name lengths I'm using tend to be quite long (say up to 25 characters in some cases) but, because of the way I've implemented the software that interfaces the core application to the web server, my form controls' names need to be comprised of a sequence of hex values. It would be very non-trivial for me to try to reduce their length any further.
The RL-ARM version in use is V3.50.
Any suggestions please? Is the HTTP server supposed to be able to cope with POST data that's split across more than one TCP packet?
Cheers,
Trev