diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/daemon/connection.c | 15 | ||||
-rw-r--r-- | src/examples/minimal_example_comet.c | 6 |
5 files changed, 29 insertions, 4 deletions
@@ -14,6 +14,7 @@ Greg Schohn <greg.schohn@gmail.com> | |||
14 | Thomas Martin <Thomas.Martin@rohde-schwarz.com> | 14 | Thomas Martin <Thomas.Martin@rohde-schwarz.com> |
15 | Peter Ross <pross@xvid.org> | 15 | Peter Ross <pross@xvid.org> |
16 | RuXu W <wrxzzj@gmail.com> | 16 | RuXu W <wrxzzj@gmail.com> |
17 | Matthew Moore | ||
17 | 18 | ||
18 | Documentation contributions also came from: | 19 | Documentation contributions also came from: |
19 | Marco Maggi <marco.maggi-ipsu@poste.it> | 20 | Marco Maggi <marco.maggi-ipsu@poste.it> |
@@ -1,9 +1,14 @@ | |||
1 | Sat Nov 8 02:18:42 MST 2008 | ||
2 | Unset TCP_CORK at the end of transmitting a response | ||
3 | to improve performance (on systems where this is | ||
4 | supported). -MM | ||
5 | |||
1 | Tue Sep 30 16:48:08 MDT 2008 | 6 | Tue Sep 30 16:48:08 MDT 2008 |
2 | Make MHD useful to Cygwin users; detect IPv6 headers | 7 | Make MHD useful to Cygwin users; detect IPv6 headers |
3 | in configure. | 8 | in configure. |
4 | 9 | ||
5 | Sun Sep 28 14:57:46 MDT 2008 | 10 | Sun Sep 28 14:57:46 MDT 2008 |
6 | Unescape URIs (convert "%ef%e4%45" to "中国"). | 11 | Unescape URIs (convert "%ef%e4%45" to "中国"). -CG |
7 | 12 | ||
8 | Wed Sep 10 22:43:59 MDT 2008 | 13 | Wed Sep 10 22:43:59 MDT 2008 |
9 | Releasing GNU libmicrohttpd 0.4.0pre0. -CG | 14 | Releasing GNU libmicrohttpd 0.4.0pre0. -CG |
diff --git a/configure.ac b/configure.ac index f9d28b21..27772b33 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -136,7 +136,7 @@ AC_SUBST(PTHREAD_CPPFLAGS) | |||
136 | AC_CHECK_HEADERS([fcntl.h math.h errno.h limits.h stdio.h locale.h sys/stat.h sys/types.h pthread.h],,AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX headers files])) | 136 | AC_CHECK_HEADERS([fcntl.h math.h errno.h limits.h stdio.h locale.h sys/stat.h sys/types.h pthread.h],,AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX headers files])) |
137 | 137 | ||
138 | # Check for optional headers | 138 | # Check for optional headers |
139 | AC_CHECK_HEADERS([sys/select.h sys/types.h sys/time.h sys/msg.h netdb.h netinet/in.h time.h sys/socket.h sys/mman.h arpa/inet.h]) | 139 | AC_CHECK_HEADERS([sys/select.h sys/types.h sys/time.h sys/msg.h netdb.h netinet/in.h netinet/tcp.h time.h sys/socket.h sys/mman.h arpa/inet.h]) |
140 | 140 | ||
141 | # IPv6 | 141 | # IPv6 |
142 | AC_MSG_CHECKING(for IPv6) | 142 | AC_MSG_CHECKING(for IPv6) |
@@ -161,6 +161,8 @@ have_inet6=no | |||
161 | ) | 161 | ) |
162 | AC_MSG_RESULT($have_inet6) | 162 | AC_MSG_RESULT($have_inet6) |
163 | 163 | ||
164 | # TCP_CORK | ||
165 | AC_CHECK_DECL([TCP_CORK], [], [], [[#include <netinet/tcp.h>]]) | ||
164 | 166 | ||
165 | # libcurl (required for testing) | 167 | # libcurl (required for testing) |
166 | SAVE_LIBS=$LIBS | 168 | SAVE_LIBS=$LIBS |
diff --git a/src/daemon/connection.c b/src/daemon/connection.c index c0e3f4b5..9a346bc7 100644 --- a/src/daemon/connection.c +++ b/src/daemon/connection.c | |||
@@ -1921,6 +1921,14 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1921 | continue; | 1921 | continue; |
1922 | } | 1922 | } |
1923 | connection->state = MHD_CONNECTION_HEADERS_SENDING; | 1923 | connection->state = MHD_CONNECTION_HEADERS_SENDING; |
1924 | |||
1925 | #if HAVE_TCP_CORK | ||
1926 | /* starting header send, set TCP cork */ | ||
1927 | { | ||
1928 | const int val = 1; | ||
1929 | setsockopt(connection->socket_fd, IPPROTO_TCP, TCP_CORK, &val, sizeof(val)); | ||
1930 | } | ||
1931 | #endif | ||
1924 | break; | 1932 | break; |
1925 | case MHD_CONNECTION_HEADERS_SENDING: | 1933 | case MHD_CONNECTION_HEADERS_SENDING: |
1926 | /* no default action */ | 1934 | /* no default action */ |
@@ -1976,6 +1984,13 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1976 | /* no default action */ | 1984 | /* no default action */ |
1977 | break; | 1985 | break; |
1978 | case MHD_CONNECTION_FOOTERS_SENT: | 1986 | case MHD_CONNECTION_FOOTERS_SENT: |
1987 | #if HAVE_TCP_CORK | ||
1988 | /* done sending, uncork */ | ||
1989 | { | ||
1990 | const int val = 0; | ||
1991 | setsockopt(connection->socket_fd, IPPROTO_TCP, TCP_CORK, &val, sizeof(val)); | ||
1992 | } | ||
1993 | #endif | ||
1979 | MHD_destroy_response (connection->response); | 1994 | MHD_destroy_response (connection->response); |
1980 | if (connection->daemon->notify_completed != NULL) | 1995 | if (connection->daemon->notify_completed != NULL) |
1981 | connection->daemon->notify_completed (connection-> | 1996 | connection->daemon->notify_completed (connection-> |
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c index 3117df1e..b6a352a3 100644 --- a/src/examples/minimal_example_comet.c +++ b/src/examples/minimal_example_comet.c | |||
@@ -31,9 +31,11 @@ data_generator(void * cls, | |||
31 | char * buf, | 31 | char * buf, |
32 | int max) | 32 | int max) |
33 | { | 33 | { |
34 | if (max < 80) | ||
35 | return 0; | ||
34 | memset(buf, 'A', max-1); | 36 | memset(buf, 'A', max-1); |
35 | buf[max-1] = '\n'; | 37 | buf[79] = '\n'; |
36 | return max; | 38 | return 80; |
37 | } | 39 | } |
38 | 40 | ||
39 | static int | 41 | static int |