libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] No response to client.


From: Martin Bonner
Subject: [libmicrohttpd] No response to client.
Date: Thu, 7 Apr 2016 13:53:52 +0000

I have an embedded webserver written with libmicrohttpd.  A client is posting 
messages to it with custom crafted TCP send/recv calls (so not libcurl or 
anything trusted like that).  In real life, these messages are sent every half 
a second.  Every so often (about one in 3000 calls), the client doesn't receive 
a response.

I have simplified the code, reduced the delays, and increased the logging.  I 
now get a message every millisecond or so.  The bad news is that the failure 
seems to happen with a similar real time frequency.  The message I am sending 
is quite short (TTMCOMMAND: {"command":"ping"}), and usually the AccessHandler 
callback gets all the data in one byte.  Occasionally however it gets split up 
into two chunks.  (That is not a problem, I handle
it correctly, but it might be clue as to what is going on.)

The one time I have seen a failure on the debug code, the first AccessHandler 
occurred as usual, but the second call (which actually gets passed the
upload data) didn't happen until the client timed out, and created a new 
connection, and sent a new command to the webserver.  Looking at the logs,
I *don't* see that happen in the real case (the AccessHandler just never seems 
to occur).

Let me be clear: It is unlikely that the problem is in libmicrohttpd - it is 
much more likely to be in the client (which might not be sending quite
valid HTTP commands), or in my code (which is making invalid assumptions).

I am using version 0.9.42 (I've checked the changelog - this doesn't seem to be 
a fixed problem).

Any clue what I am doing wrong ? Alternatively, what additional logging would 
be helpful? 

-- 
Martin Bonner

address@hidden 
www.cst-gmbh.eu 

CST GmbH 
Daimlerstraße 15
D-79761 Waldshut - Tiengen
Handelsregister Freiburg HRB 712206
Tel:      +49 7741 96 58 08 - 4
Fax:      +49 7741 - 808 176 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]