Socket error on mg_http_reply #1811
-
I'm implementing a http reqest "GET" method response by creating a very large buffer containing a bunch of XML. and using the mg_http_reply function;
I allocate a buffer of size fileSize+1 and then add the null to make sure it's null terminated before calling mg_http_reply. The config data buffer itself is about 200 Kbytes When using curl to test, I get the entire XML buffer but then the server returns a socket error near the end. The socket error is coming from this section of code; for (c = mgr->conns; c != NULL; c = c->next) { in the mg_iotest() function in sock.c. I get the entire buffer in the response and the web server doesn't crash. So I'm not even sure I should be worried about it but it concerns me that I don't know what's going on. I have a similar query endpoint that returns a much smaller buffer and I don't get the error. It takes about 30 seconds for the response to happen so maybe there is a timeout of some sort? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please provide more information, you might be running out of heap/stack; works OK for me with latest on Linux. Environment
|
Beta Was this translation helpful? Give feedback.
Please provide more information, you might be running out of heap/stack; works OK for me with latest on Linux.
Do you have other actions going on ? Did you sniff your network ?
Environment