Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winsock server - CRLF problem for POST

Status
Not open for further replies.

mibosoft

Programmer
Jul 23, 2002
106
SE
Hi,
I have integrated a winsock server in my app and it works fine except for one thing; When my "dataarrival" procedure, receives data from a POST action (form), it is stuffed into a receive buffer. When the complete message has been captured, the data is computed and the app returns a HTML message to be shown in the browser with a "senddata" function. This works 10 times of 10 with Firefox but about 7 of 10 only with IE. Here is the difference:

1) A received message from a POST action with Firefox always ends with a single CRLF.

2) A received message from the same POST action from IE works fine if it ends with a double CRLF.

3) A received message from IE fails if it ends with a single CRLF. Otherwise, the message is identical to 2).

Observation:
- Case 3) seems to happen (not always) when a message is split in two packets and stuffed in the buffer before computed.

- Case 3) actually succeds with everything and the HTML-message sent to the browser is shown until the "dataarrival" closes the current winsock object, which it shall when all data is sent. My first thought was that the received message wasn't complete but it is, no more packets are sent.


This is really irritating. Any hints are welcome.

Thanks'
Micael

(My server is based on:
 
This example is defining EOT sign as chr(4) and reacts to this as end of transmission. IE or Firefox do not send such EOT signs, so the example won't work as long as you have another mechanism to find the end of transmissions.

Take a look at the eeva server, which may work out for you much better, as you want to act as an HTTP server:
Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top