diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-01-01 20:43:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-01-01 20:43:44 +0000 |
commit | e4e05d001ce05928d72aa07f34a3a7581107d842 (patch) | |
tree | 1364a8b1c645fe662ef25f2c00f53f35c4c1898c /src/examples/demo.c | |
parent | cb11cac74d2a5dca1039dd2ab70d42e8fe1d501b (diff) | |
download | libmicrohttpd-e4e05d001ce05928d72aa07f34a3a7581107d842.tar.gz libmicrohttpd-e4e05d001ce05928d72aa07f34a3a7581107d842.zip |
enable use of keep-alive with http 1.0 if explicitly requested by the client
Diffstat (limited to 'src/examples/demo.c')
-rw-r--r-- | src/examples/demo.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/examples/demo.c b/src/examples/demo.c index d22f005b..4a16b656 100644 --- a/src/examples/demo.c +++ b/src/examples/demo.c | |||
@@ -43,7 +43,7 @@ | |||
43 | * Number of threads to run in the thread pool. Should (roughly) match | 43 | * Number of threads to run in the thread pool. Should (roughly) match |
44 | * the number of cores on your system. | 44 | * the number of cores on your system. |
45 | */ | 45 | */ |
46 | #define NUMBER_OF_THREADS 4 | 46 | #define NUMBER_OF_THREADS 8 |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * How many bytes of a file do we give to libmagic to determine the mime type? | 49 | * How many bytes of a file do we give to libmagic to determine the mime type? |
@@ -362,9 +362,11 @@ update_directory () | |||
362 | rdc.buf, | 362 | rdc.buf, |
363 | MHD_RESPMEM_MUST_FREE); | 363 | MHD_RESPMEM_MUST_FREE); |
364 | mark_as_html (response); | 364 | mark_as_html (response); |
365 | #if FORCE_CLOSE | ||
365 | (void) MHD_add_response_header (response, | 366 | (void) MHD_add_response_header (response, |
366 | MHD_HTTP_HEADER_CONNECTION, | 367 | MHD_HTTP_HEADER_CONNECTION, |
367 | "close"); | 368 | "close"); |
369 | #endif | ||
368 | update_cached_response (response); | 370 | update_cached_response (response); |
369 | } | 371 | } |
370 | 372 | ||
@@ -775,7 +777,9 @@ generate_page (void *cls, | |||
775 | } | 777 | } |
776 | } | 778 | } |
777 | if (0 == strcmp (method, MHD_HTTP_METHOD_GET)) | 779 | if (0 == strcmp (method, MHD_HTTP_METHOD_GET)) |
780 | { | ||
778 | return return_directory_response (connection); | 781 | return return_directory_response (connection); |
782 | } | ||
779 | 783 | ||
780 | /* unexpected request, refuse */ | 784 | /* unexpected request, refuse */ |
781 | return MHD_queue_response (connection, | 785 | return MHD_queue_response (connection, |