Client works on a LAN but don't send all the data
Hello, I have been having problems with my client because isn't able to send all the data (or that's what I think). The scenario is the next:
- 2 pc on the same LAN (both windows XP)
- 1 server (my own server, not a professional server :)) on the pc #1. That server can get a param from the header (like HTTP params) 'ECHO<crlf>' that internally means 'Return the same message you receive': if the recv header have a 'Content-Length: 0<crlf>' then sends a 'Hello from server'; else sends the content message.
- 1 client (also my own client, less professional than the server) on pc #1. That client sends an HTTP header like
Ok, I run the server on pc#1 and the client on pc#1, the client send all the data, the server recv it all and resend 'test'. It works well.
POST / HTTP/1.0<crlf>
After that, from pc #2 I run the internet browser, connect to my server index page, download the client program from pc#1 (so may I think that the server doesn't have any problem, or any important problem, because I can browse through the server's index page, several links, several formats and there's no problem). Right, now I have the client on pc#2, I run it, send all the data but on the server only arrive since the '<crlf><crlf>', the message 'test' remains I-don't-know-where, the server returns nothing, and whil terminating the conexion I get some unexpected last bytes, exactly 4 bytes, and if I printf them are the message content sended by the client.
Why does it happens when working from different pc but not when I'm work on the same? The server should work well because I can recv the data from forms of webpages settedup with method POST.
The header request from browsers MSIE and NSN when they submit a form in method POST, haven't notably differences with the header on my client. That are a sample of the header that a MSIE browser sends to my server to submit a form in POST method:
I can't see notably differences between msie request and mine, but on the server I can get all the data (from both pc), but when I send the same request though my client the content message is left (only when the client sends the request from a different pc than the one where server is running).
POST /DIRSERVER/response.txt HTTP/1.1<crlf>
Accept: image/gif, (more types)<crlf>
Accept-Encoding: gzip, deflate<crlf>
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5...)<crlf>
To send the data from the client I copy the header into a buffer and send it in one time. On the client I have a big buffer to recv the data also in one time (I suppose that form the moment that won't be the problem, if not my server wouldn't be able to get the profesional browsers request).
Have someone had or have seen a problem like that?
Thank's in advance
P.S. Ok, year-end so have a good new year