Commit Graph
1546 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) 82e360f0f1 Add w32 project files to EXTRA_DIST 2014-12-24 20:50:46 +00:00
Evgeny Grin (Karlson2k) cfec37c1c3 fix autoinit_funcs.h reference in makefile EXTRA_DIST 2014-12-24 20:50:40 +00:00
Evgeny Grin (Karlson2k) f1ffd2e889 [w32] Set thread name 2014-12-24 19:00:33 +00:00
Evgeny Grin (Karlson2k) 7c2493d59c One more strcasecmp() replace with macro 2014-12-24 19:00:23 +00:00
Christian Grothoff 0016974ba8 -fix dist issue 2014-12-24 15:03:58 +00:00
Evgeny Grin (Karlson2k) 9303922d47 Add and use header for multiplatform support of Init/Deinit functions 2014-12-22 19:43:04 +00:00
Evgeny Grin (Karlson2k) 684be54c9f [W32] Initial VS2013 project files 2014-12-22 19:42:56 +00:00
Evgeny Grin (Karlson2k) 5a85e40649 [w32] Help code to detect IPPROTO_IPV6 on VC 2014-12-22 19:42:50 +00:00
Evgeny Grin (Karlson2k) 2ee782685c MHD_get_version: support extraction version number from MHD_VERSION if PACKAGE_VERSION is not defined 2014-12-22 19:42:44 +00:00
Evgeny Grin (Karlson2k) 49d17ea85e Rework _MHD_EXTERN definition for VS project 2014-12-22 19:42:38 +00:00
Evgeny Grin (Karlson2k) 001c1fdad5 Replace char variable size arrays with malloc'ed buffers 2014-12-22 19:42:31 +00:00
Evgeny Grin (Karlson2k) 03af50116d response.c: include additional header for W32 2014-12-22 19:42:24 +00:00
Evgeny Grin (Karlson2k) 54edb3cd8f Replace snprintf with platform-independent macro 2014-12-22 19:42:18 +00:00
Evgeny Grin (Karlson2k) 913ced4bdd [w32] Add W32 emulation for snprintf() 2014-12-22 19:42:08 +00:00
Evgeny Grin (Karlson2k) 2a2a389a34 Replace strcasecmp/strncasecmp with platform-independent macros 2014-12-22 19:42:00 +00:00
Evgeny Grin (Karlson2k) ba88f0d733 daemon.c: Fix macro check with HAVE_ACCEPT4 == 0 in MHD_accept_connection() 2014-12-22 19:41:51 +00:00
Evgeny Grin (Karlson2k) 4d264fe823 platform.h: conditionally include unistd.h
Was already supported by configure
2014-12-22 19:41:45 +00:00
Evgeny Grin (Karlson2k) 7d18a1a3ed platform.h: define ssize_t for MSVC compiler 2014-12-22 19:41:39 +00:00
Evgeny Grin (Karlson2k) 76311f9249 tsearch.c/.h: support compiling by MSVC 2014-12-22 19:41:33 +00:00
Evgeny Grin (Karlson2k) 7f534d0df7 daemon.c: update ifdefs to support non-MinGW w32 native build 2014-12-22 19:41:26 +00:00
Christian Grothoff bdc0a8d958 getting ready for 0.9.39 2014-12-22 15:41:45 +00:00
Christian Grothoff 87c2472e30 -fix #3584 2014-12-22 12:04:46 +00:00
Christian Grothoff bbe7aa94e0 -just to be sure, also check if client set Connection: close at the end 2014-12-20 01:31:24 +00:00
Christian Grothoff 0a930d349c -avoid cmp with uninitialized pointer, even if harmless 2014-12-20 01:01:14 +00:00
Christian Grothoff 599ccf8fb5 -check malloc rval 2014-12-20 00:55:21 +00:00
Christian Grothoff eb31c3c9ba -check malloc rval 2014-12-20 00:54:51 +00:00
Christian Grothoff 51e9b51e26 -check fgetc rval even if feof said it wouldn't be EOF 2014-12-20 00:40:16 +00:00
Christian Grothoff ce0e99c545 -handle NULL vlaue 2014-12-20 00:37:06 +00:00
Christian Grothoff 6c80b16d18 -check malloc() return value 2014-12-20 00:36:00 +00:00
Christian Grothoff a29e7f538c -fix (potential) memory leak on certain control flow paths 2014-12-20 00:35:01 +00:00
Christian Grothoff 6bb3128a41 -cleaner code: avoid trivial fall-through case, make it explicit instead 2014-12-20 00:31:51 +00:00
Christian Grothoff 8c24a9bd24 -check RVals 2014-12-20 00:30:53 +00:00
Christian Grothoff a4030d4473 -check RVals 2014-12-20 00:25:22 +00:00
Christian Grothoff b457435a88 use __buildin_unreachable() after MHD_PANIC() -- if supported by gcc 2014-12-20 00:18:06 +00:00
Christian Grothoff 18b1972b40 -fix linker issue 2014-12-19 23:42:32 +00:00
Christian Grothoff b2a041e934 make MHD_http_unescape() part of API (#3585) 2014-12-19 23:38:18 +00:00
Christian Grothoff 00a5e29287 trying to fix #3584 2014-12-19 23:17:14 +00:00
Evgeny Grin (Karlson2k) 16e9746859 fix building with --disable-messages 2014-12-18 21:39:33 +00:00
Christian Grothoff 9407787c06 writing down my current thoughts on the WebSocket API 2014-12-14 14:00:14 +00:00
Christian Grothoff def7c593ea -clarify comment 2014-12-08 13:49:07 +00:00
Christian Grothoff 6ee22efc8b From:
"Junker, Gregory" <gregory.junker@intel.com>
Date:
12/04/2014 12:30 AM
To:
"libmicrohttpd@gnu.org" <libmicrohttpd@gnu.org>

Hi all

I need a tiny addition made to connection.c.

In keepalive_possible(), can we change the line that says

    if (0 == strcasecmp (end, "close"))

to



    if (0 == strcasecmp (end, "close") || 0 == strcasecmp (end, "upgrade"))

?

This would make it possible to use libmicrohttpd in a WebSocket (RFC6455) environment. Currently, the way that the WebSocket protocol works, it sends "Connection: Upgrade" in the headers with the initial handshake, which causes this check to fail and (ultimately) insert "Connection: Keep-Alive" in the response headers (which cause any compliant WebSocket client to fail the handshake, since it needs "Connection: Upgrade" in the response headers, and there is no way to remove this keepalive header from the response from outside of MHD, as it is added automatically to the response buffer).

Note that this is only an HTTP/1.1 issue, AFAIK (I am pretty sure, though not positive, that WebSocket is not compatible with HTTP/1.0).

Thanks!
Greg
2014-12-03 23:47:40 +00:00
Christian Grothoff d5571974e5 fix #3560 as suggested by reporter 2014-12-01 10:55:44 +00:00
Christian Grothoff 774e50c035 Hi Christian,
the recently added MHD_DAEMON_INFO_CURRENT_CONNECTIONS can return quite
outdated values in MHD_USE_THREAD_PER_CONNECTION mode. The reason is
that closed connections are collected in MHD_cleanup_connections, which
is called only from the select thread. In the
MHD_USE_THREAD_PER_CONNECTION mode that happens only after accepting an
connection -- therefore, the last connection is always not collected and
MHD_DAEMON_INFO_CURRENT_CONNECTIONS returns >= 1, even when there are no
connections. That makes it very unusable to detect whether all
connections have been handled.

Would you consider the attached patch, which calls
MHD_cleanup_connections whenever MHD_DAEMON_INFO_CURRENT_CONNECTIONS is
called? It makes MHD_DAEMON_INFO_CURRENT_CONNECTIONS slower, but the
returned value is much more accurate.

Cheers,
Milan Straka
2014-11-18 12:54:01 +00:00
Christian Grothoff b6db4c24d4 -bump 2014-10-29 19:54:14 +00:00
Christian Grothoff fd94723863 Hi Christian,
I attach the first attempt on SO_REUSEPORT. The patch is available
either at https://github.com/foxik/libmicrohttpd/commit/9ce9422742e10458f87275ea202a982e00c2b88c
or attached. (It is against the version with
MHD_DAEMON_OPTION_CURRENT_CONNECTIONS, but I can rebase it to current
SVN HEAD if you want.)

It seems that a reasonably multiplatform way of detecting SO_REUSEPORT is
  #ifdef SO_REPOSEPORT
which is used for example by Perl. For SO_EXCLUSIVEADDRUSE, the same
strategy seems to work too, according to Windows SDK headers and MinGW
WinAPI headers.

The current patch adds an option to allowing/disallowing address:port
reuse. One remark:
- currently both nonexisting SO_xxx and setsockopt failure are fatal and
  MHD_start_daemon fails. That may be too harsh -- maybe the
  MHD_OPTION_LISTENING_ADDRESS_REUSE should be only a hint.

  Nevertheless, as one can freely not use
  MHD_OPTION_LISTENING_ADDRESS_REUSE option, I chose the "fail on error"
  behaviour.

Thanks,
cheers,
Milan Straka

Original patch modified to get rid of some redundant USE_DEBUG
checks, fix indentation, and #ifndef SO_REUSEPORT on Linux,
we try be #defining it to 15 ourselves.
2014-10-29 19:50:58 +00:00
Christian Grothoff cde3691e85 handle bogus return value from send() call 2014-10-29 15:53:17 +00:00
Christian Grothoff 5c51824265 make sure we always set non-zero errno in send_tls_adapter 2014-10-29 15:46:17 +00:00
Christian Grothoff 19d66bd8c1 -no comma at end of enum 2014-10-29 15:32:10 +00:00
Christian Grothoff d50980a765 From: Milan Straka <fox@ucw.cz>
Date: Wed, 29 Oct 2014 09:59:09 +0100
Subject: [PATCH 2/2] Add MHD_DAEMON_INFO_CURRENT_CONNECTIONS to
 MHD_DaemonInfoType.

The MHD_DAEMON_INFO_CURRENT_CONNECTIONS returns number of current
connections handled by the daemon.

Useful after MHD_quiesce_daemon to find out whether all connections
have been served.
2014-10-29 15:29:31 +00:00
Christian Grothoff e38d4e283e minor code clean up via CSE 2014-10-29 15:22:14 +00:00