[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16594 - in libmicrohttpd: . src/daemon src/testcurl
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16594 - in libmicrohttpd: . src/daemon src/testcurl |
Date: |
Thu, 18 Aug 2011 11:08:53 +0200 |
Author: grothoff
Date: 2011-08-18 11:08:53 +0200 (Thu, 18 Aug 2011)
New Revision: 16594
Modified:
libmicrohttpd/AUTHORS
libmicrohttpd/ChangeLog
libmicrohttpd/src/daemon/connection.c
libmicrohttpd/src/testcurl/
libmicrohttpd/src/testcurl/test_callback.c
Log:
bugfix
Modified: libmicrohttpd/AUTHORS
===================================================================
--- libmicrohttpd/AUTHORS 2011-08-18 08:56:18 UTC (rev 16593)
+++ libmicrohttpd/AUTHORS 2011-08-18 09:08:53 UTC (rev 16594)
@@ -32,6 +32,7 @@
Eivind Sarto <address@hidden>
Thomas Stalder <address@hidden>
Zhimin Huang <address@hidden>
+Jan Seeger <address@hidden>
Documentation contributions also came from:
Marco Maggi <address@hidden>
Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog 2011-08-18 08:56:18 UTC (rev 16593)
+++ libmicrohttpd/ChangeLog 2011-08-18 09:08:53 UTC (rev 16594)
@@ -1,3 +1,8 @@
+Thu Aug 18 11:05:16 CEST 2011
+ Fixed bug with wrong state transition if callback returned
+ MHD_CONTENT_READER_END_OF_STREAM causing spurious extra callbacks
+ to the handler (thanks to Jan Seeger for pointing it out). -CG/JS
+
Thu Aug 11 11:40:03 CEST 2011
Changing sockets to be non-blocking as suggested by Eivind Sarto
on the mailinglist. -CG
Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c 2011-08-18 08:56:18 UTC (rev
16593)
+++ libmicrohttpd/src/daemon/connection.c 2011-08-18 09:08:53 UTC (rev
16594)
@@ -390,7 +390,10 @@
response->data_start = connection->response_write_position;
response->data_size = ret;
if (ret == 0)
- return MHD_NO;
+ {
+ connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY;
+ return MHD_NO;
+ }
return MHD_YES;
}
@@ -1847,7 +1850,6 @@
{
if (response->crc != NULL)
pthread_mutex_unlock (&response->mutex);
- connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY;
break;
}
ret = connection->send_cls (connection,
Property changes on: libmicrohttpd/src/testcurl
___________________________________________________________________
Modified: svn:ignore
- perf_get_concurrent
perf_get
daemontest_timeout.gcno
daemontest_timeout.gcda
daemontest_termination.gcno
daemontest_termination.gcda
daemontest_get_sendfile.gcno
daemontest_get_sendfile.gcda
daemontest_digestauth.gcno
daemontest_digestauth.gcda
daemontest_digestauth
daemontest_timeout
daemontest_get_sendfile11
daemontest_get_sendfile
daemontest_iplimit.gcno
daemontest_iplimit.gcda
daemontest_termination
daemontest_iplimit11
Makefile.in
daemontest_long_header.gcda
daemontest_process_headers.gcda
daemontest_large_put.gcno
.deps
Makefile
daemontest_postform.gcno
daemontest_put_chunked.gcno
daemontest_post_loop.gcno
daemontest_get_chunked.gcno
daemontest_post.gcno
daemontest_parse_cookies.gcno
daemontest_large_put.gcda
daemontest_process_arguments.gcno
daemon_options_test
daemontest_put.gcno
daemontest_get.gcno
daemontest_postform.gcda
daemontest_put_chunked.gcda
curl_version_check.gcno
daemontest_process_headers
daemontest_long_header11
daemontest_post_loop.gcda
daemontest_get_chunked.gcda
daemontest_post.gcda
daemontest_parse_cookies.gcda
daemontest_long_header.gcno
daemontest_process_headers.gcno
daemontest_process_arguments.gcda
daemontest_process_arguments
daemontest_put.gcda
daemontest_get.gcda
daemon_options_test.gcno
curl_version_check.gcda
daemontest_process_arguments.c
daemontest_parse_cookies
daemontest_put11
daemontest_put_chunked
daemontest_put
daemontest_large_put11
daemontest_postform11
daemontest_postform
daemontest_post
daemontest_large_put
daemontest_get
daemontest_post_loop11
daemontest_post11
daemontest_get_chunked
daemontest_long_header
daemontest_post_loop
daemontest_get11
+ test_callback
perf_get_concurrent
perf_get
daemontest_timeout.gcno
daemontest_timeout.gcda
daemontest_termination.gcno
daemontest_termination.gcda
daemontest_get_sendfile.gcno
daemontest_get_sendfile.gcda
daemontest_digestauth.gcno
daemontest_digestauth.gcda
daemontest_digestauth
daemontest_timeout
daemontest_get_sendfile11
daemontest_get_sendfile
daemontest_iplimit.gcno
daemontest_iplimit.gcda
daemontest_termination
daemontest_iplimit11
Makefile.in
daemontest_long_header.gcda
daemontest_process_headers.gcda
daemontest_large_put.gcno
.deps
Makefile
daemontest_postform.gcno
daemontest_put_chunked.gcno
daemontest_post_loop.gcno
daemontest_get_chunked.gcno
daemontest_post.gcno
daemontest_parse_cookies.gcno
daemontest_large_put.gcda
daemontest_process_arguments.gcno
daemon_options_test
daemontest_put.gcno
daemontest_get.gcno
daemontest_postform.gcda
daemontest_put_chunked.gcda
curl_version_check.gcno
daemontest_process_headers
daemontest_long_header11
daemontest_post_loop.gcda
daemontest_get_chunked.gcda
daemontest_post.gcda
daemontest_parse_cookies.gcda
daemontest_long_header.gcno
daemontest_process_headers.gcno
daemontest_process_arguments.gcda
daemontest_process_arguments
daemontest_put.gcda
daemontest_get.gcda
daemon_options_test.gcno
curl_version_check.gcda
daemontest_process_arguments.c
daemontest_parse_cookies
daemontest_put11
daemontest_put_chunked
daemontest_put
daemontest_large_put11
daemontest_postform11
daemontest_postform
daemontest_post
daemontest_large_put
daemontest_get
daemontest_post_loop11
daemontest_post11
daemontest_get_chunked
daemontest_long_header
daemontest_post_loop
daemontest_get11
Modified: libmicrohttpd/src/testcurl/test_callback.c
===================================================================
--- libmicrohttpd/src/testcurl/test_callback.c 2011-08-18 08:56:18 UTC (rev
16593)
+++ libmicrohttpd/src/testcurl/test_callback.c 2011-08-18 09:08:53 UTC (rev
16594)
@@ -97,7 +97,7 @@
struct timeval tv;
int extra;
- d = MHD_start_daemon(MHD_USE_DEBUG,
+ d = MHD_start_daemon(0,
8000,
NULL,
NULL,
@@ -135,15 +135,18 @@
FD_ZERO(&rs);
FD_ZERO(&es);
curl_multi_perform (multi, &running);
- mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
- if (mret != CURLM_OK)
- {
- curl_multi_remove_handle (multi, c);
- curl_multi_cleanup (multi);
- curl_easy_cleanup (c);
- MHD_stop_daemon (d);
- return 3;
- }
+ if (NULL != multi)
+ {
+ mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
+ if (mret != CURLM_OK)
+ {
+ curl_multi_remove_handle (multi, c);
+ curl_multi_cleanup (multi);
+ curl_easy_cleanup (c);
+ MHD_stop_daemon (d);
+ return 3;
+ }
+ }
if (MHD_YES !=
MHD_get_fdset(d, &rs, &ws, &es, &max))
{
@@ -156,26 +159,29 @@
tv.tv_sec = 0;
tv.tv_usec = 1000;
select(max + 1, &rs, &ws, &es, &tv);
- curl_multi_perform (multi, &running);
- if (running == 0)
- {
- msg = curl_multi_info_read (multi, &running);
- if (msg == NULL)
- break;
- if (msg->msg == CURLMSG_DONE)
- {
- if (msg->data.result != CURLE_OK)
- printf ("%s failed at %s:%d: `%s'\n",
- "curl_multi_perform",
- __FILE__,
- __LINE__, curl_easy_strerror (msg->data.result));
- curl_multi_remove_handle (multi, c);
- curl_multi_cleanup (multi);
- curl_easy_cleanup (c);
- c = NULL;
- multi = NULL;
- }
- }
+ if (NULL != multi)
+ {
+ curl_multi_perform (multi, &running);
+ if (running == 0)
+ {
+ msg = curl_multi_info_read (multi, &running);
+ if (msg == NULL)
+ break;
+ if (msg->msg == CURLMSG_DONE)
+ {
+ if (msg->data.result != CURLE_OK)
+ printf ("%s failed at %s:%d: `%s'\n",
+ "curl_multi_perform",
+ __FILE__,
+ __LINE__, curl_easy_strerror (msg->data.result));
+ curl_multi_remove_handle (multi, c);
+ curl_multi_cleanup (multi);
+ curl_easy_cleanup (c);
+ c = NULL;
+ multi = NULL;
+ }
+ }
+ }
MHD_run(d);
}
MHD_stop_daemon(d);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16594 - in libmicrohttpd: . src/daemon src/testcurl,
gnunet <=