[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] MHD_create_post_processor failed for a GET request w
From: |
Helin Wang |
Subject: |
Re: [libmicrohttpd] MHD_create_post_processor failed for a GET request with body |
Date: |
Sat, 17 Nov 2012 16:21:18 -0800 |
Hi Christian,
Thanks for your response.
I did more tests, seems post processor can be created but won't be called if I did not specify encoding. post processor can't be created if I use GET. Event more, with GET (curl -d 'data' -G), *upload_data_size will always be 0.
Anyway, as you said, parse myself should be the best solution. I am using it, with POST (*upload_data_size will always be 0 with GET). So I found my way, thanks:)
Hi Christian, and everyone,
There is another issue blocking me now.
I am using threading model MHD_USE_SELECT_INTERNALLY, if I sleep 3s in the answer function.
And I give 5 concurrent requests, they will get their own response at same time (after 15s), rather than a response sequence of 3s, 3s, 3s, 3s, 3s.
My question is can I "flush" and how to "flush"?
code sample:
daemon = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY, PORT, NULL, NULL,
&answer_to_connection, NULL, MHD_OPTION_END);
answer_to_connection (void *cls, struct MHD_Connection *connection, ...)
{
const char *page = "<html><body>Hello, browser!</body></html>";
struct MHD_Response *response;
sleep(3);
response =
MHD_create_response_from_buffer (strlen (page), (void *) page,
MHD_RESPMEM_PERSISTENT);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
return ret;
}