Hi,
Sleep(1) => Wait for 1 ms. On Windows XP, the current thread is suspended until
the time-out elapses (See
http://msdn.microsoft.com/en-us/library/ms686298(VS.85).aspx).
I don't understand your solution: could you send the code?
Bruno.
________________________________
De : Rui Jorge Coelho [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 28 août 2008 19:41
À : LAVIER Bruno; [email protected]
Objet : RE: [shttpd-general] TR: Remark + Question
In my case a C embedded callback gets called in a loop until POST is completed
because my callback can only answer when the POST is completed.
Sleep(1) will delay response for 1 second correct ? Sleep doesn't garanty
reschedule, correct ? I guess you got luck ...
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of LAVIER Bruno
Sent: quinta-feira, 28 de Agosto de 2008 16:52
To: [email protected]
Subject: [shttpd-general] TR: Remark + Question
Hi,
OK, I've found the problem.
1. SHTTPD and IE are running on the same PC (I've use the 127.0.0.1
address).
2. On browser side, I'm using the XMLHttpRequest for FireFox and the
Microsoft.XMLHTTP ActiveX on IE - with javascript.
3. I suppose that :
a. The XMLHttpRequest is doing just one write on the TCP socket to
send the POST Request on Firefox
b. The Activex X is doing one write to send the request POST and
the header and one other write to send the data (thus 2 Ethernet frames are
sent)
c. On server side, the recv in fct read_socket (io_socket.c)
retrieve only the data from the first write and not the data from the second
one (if I put a breakpoint just before the recv => it works !!!)
=> it's a timing problem.
4. I solve the problem by adding a Sleep(1) before the recv in read_socket
=> thus a reschedule occurs and during this time, the data from the second
write are also received by the system => and when the recv occurs, the data
from the second write are also consumed ...
It works without this Sleep when the browser and the server are not on the same
PC.
Are you agree with this analysis ?
Bruno.
________________________________
De : LAVIER Bruno
Envoyé : jeudi 28 août 2008 16:04
À : '[email protected]'
Objet : Remark + Question
Hi,
Thanks you for this works.
I'm using SHTTPD in an MFC application and it works great !!!
One remark:
Freeing of the error handler is missing in shttpd_fini (join a patch).
One question:
I'm doing an application which sent POST request with a small amount of data to
the server.
When using Firefox, it works great.
When using IE, it doesn't work.
I think the reason is that Firefox send the POST request and data in the same
ethernet frame as IE send the two frames: an HTTP frame with the headers and an
HHTP frame with only the data.
These observations were made with Ethereal by capturing the frames exchanges
between Firefox and the server and IE and the server (not an SHTTPD server but
a php server).
So my question is: does SHTTPD handle these two cases? Is there an option to
set?
Thanks,
Bruno.
Bruno LAVIER
Adeneo
Adetel Group
2, chemin du Ruisseau
69134 ECULLY - FRANCE
Tél. : +33 (0)4 72 18 57 73 - Fax : +33 (0)4 72 18 57 73 - Gsm : +33 (0)6 23 39
00 41
<http://www.adetelgroup.com/> www.adetelgroup.com <http://www.adetelgroup.com/>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
shttpd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shttpd-general