Commit Graph
391 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) 602a14fb5d Reduce last packet response delay observable with keep-alive on BSD and Darwin platforms 2015-11-25 18:45:22 +00:00
Evgeny Grin (Karlson2k) 6e4a434cfc Add and use _MHD_SOCKOPT_BOOL_TYPE for simplify usage of setsockopt() on W32/POSIX sockets. 2015-11-21 19:43:06 +00:00
Christian Grothoff 70ca8aaaea Hi folks,
I guess i found a problem with suspended connections. There is a
scenarion where one can resume a connection and then stop the daemon
without gives the daemon the oportunity to really resume the connection.
In this case, microhttpd will abort telling one that there is suspended
connection (because the connection is still in the daemon's suspended
list).

The following patch solves the problem (i've this problem using external
mainloop).

Regards,
Flavio Ceolin
2015-11-10 14:27:57 +00:00
Christian Grothoff 3ed1e8de9f -fix shrinkage 2015-11-06 21:56:46 +00:00
Christian Grothoff 5f57331ea1 -fix by undoing part of 36568 2015-11-03 22:37:47 +00:00
Evgeny Grin (Karlson2k) e9965917df More support for old clang in deprecation macros 2015-10-27 13:36:33 +00:00
Evgeny Grin (Karlson2k) da7012adc9 Update deprecation macros for new GCC, better support old clang 2015-10-27 12:23:42 +00:00
Evgeny Grin (Karlson2k) c8acb9ceb6 Fix deprecation macros resulting in compilation errors with old GCC versions 2015-10-27 12:23:39 +00:00
Christian Grothoff dc54cd092a realize suggestion from FC on MHD list to improve MHD_get_connection_values() when used with a bitmask 2015-10-25 22:07:42 +00:00
Christian Grothoff 2a6eada873 -fix assertion failure from race on shutdown and buffer shrinkage with pipelining 2015-10-25 14:33:28 +00:00
Christian Grothoff 72f05a8364 deduplicate arg parsing logic between connection.c and digestauth.c (now in internal.c) 2015-10-05 10:06:13 +00:00
Christian Grothoff dd749c2274 releasing 0.9.44 2015-10-01 19:27:08 +00:00
Christian Grothoff f2bce4c656 fix digest auth when used with more complex arguments being passed to GET, i.e. keys without missing values at the beginning and certain other constellations 2015-09-25 07:51:21 +00:00
Christian Grothoff 94c16f349d help systemd by not calling shutdown() on listen socket if MHD_USE_PIPE_FOR_SHUTDOWN is given 2015-09-22 17:21:33 +00:00
Christian Grothoff 316f6c4ef3 -releasing 0.9.43 2015-09-16 09:08:18 +00:00
Christian Grothoff 9e87c9a225 patch from FC to fix use of resume in combination with external select 2015-09-02 14:45:28 +00:00
Christian Grothoff 475b350b71 correct documentation as to when MHD_USE_EPOLL_LINUX_ONLY is allowed (previous formulation was wrong) 2015-08-30 12:55:04 +00:00
Evgeny Grin (Karlson2k) 70f7ad46eb Reimplement monotonic clock with wide range of platforms support 2015-08-27 09:43:09 +00:00
Christian Grothoff de029f6250 export MHD_get_reason_phrase_for 2015-08-14 12:19:43 +00:00
Evgeny Grin (Karlson2k) e15abfd99c daemon.c: recv_param_adapter(): fix VS compiler warning for send()/recv() 2015-08-08 12:30:06 +00:00
Evgeny Grin (Karlson2k) ca715348d3 daemon.c: MHD_handle_connection(): check timeout value for overflow of W32 2015-08-08 12:29:43 +00:00
Christian Grothoff d5048c2285 fix #3924 2015-08-04 11:52:05 +00:00
Christian Grothoff 58b30e7e5e fix #3926: ignore close() errors other than EBADF 2015-08-02 17:11:48 +00:00
Evgeny Grin (Karlson2k) f8b49a0730 platform.h: correction of sleep() and usleep() replacements for W32 2015-07-07 18:32:53 +00:00
Evgeny Grin (Karlson2k) c69306c17d Fix C++-style comments 2015-07-07 18:32:45 +00:00
Evgeny Grin (Karlson2k) 2c842e6b95 Move all internal limits definitions to MHD_limits.h 2015-07-07 18:32:33 +00:00
Christian Grothoff 4d997941e3 fix late counter-decrement issue reported by MD on the mailinglist 2015-06-27 20:19:25 +00:00
Christian Grothoff 7eba79ea86 fix HEAD handling issue in connection with MHD_create_response_from_callback reported by Cristian Klein on the mailinglist 2015-06-26 21:20:27 +00:00
Christian Grothoff 2d02ec7e60 add content-disposition 2015-06-26 09:28:32 +00:00
Evgeny Grin (Karlson2k) c461ee5489 Bump MHD_VERSION, update ChangeLog, substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset() 2015-06-09 19:34:53 +00:00
Evgeny Grin (Karlson2k) 2ece82f12e send_param_adapter(): support hosts with sendfile64(), but with 32-bit off_t (i.e. Android) 2015-06-09 19:34:45 +00:00
Evgeny Grin (Karlson2k) a78b44a832 Add MHD_FEATURE_LARGE_FILE value for MHD_is_feature_supported() 2015-06-09 19:34:36 +00:00
Evgeny Grin (Karlson2k) 09088de0db Add MHD_create_response_from_fd64() and MHD_create_response_from_fd_at_offset64() functions,
check lseek() results when reading file, check whether desired file offset fits off_t
2015-06-09 19:33:57 +00:00
Evgeny Grin (Karlson2k) 31d84d44a3 Bump MHD_VERSION and update ChangeLog 2015-06-03 21:28:22 +00:00
Evgeny Grin (Karlson2k) 1061f6809d microhttpd.h: print deprecation messages if MHD_create_response_from_data() is used 2015-06-03 21:28:14 +00:00
Evgeny Grin (Karlson2k) e52e1575df microhttpd.h: add defines for deprecating functions 2015-06-03 21:28:05 +00:00
Evgeny Grin (Karlson2k) d474f26d15 microhttpd.h: print deprecation messages if MHD_LONG_LONG or MHD_LONG_LONG_PRINTF are defined or
if MHD_HTTP_METHOD_NOT_ACCEPTABLE is used
2015-06-03 21:27:58 +00:00
Evgeny Grin (Karlson2k) 86c904a4be microhttpd.h: add defines for deprecating macros 2015-06-03 21:27:51 +00:00
Evgeny Grin (Karlson2k) 4d75ef3321 Unify and correct usage of WINDOWS/CYGWIN/MHD_WINSOCK_SOCKETS macros 2015-06-02 10:08:05 +00:00
Christian Grothoff 689d2dc98d -comment on data types 2015-06-02 08:07:49 +00:00
Christian Grothoff aecadc41d2 -version bump 2015-05-29 10:21:43 +00:00
Christian Grothoff dd80b6137d bump 2015-05-18 21:18:26 +00:00
Christian Grothoff a67363392b From ML:
Hey,

I'm debugging a problem with a crash in MHD_select_thread.  We had
MHD_start_daemon_va fail while creating worker threads with the following
error: "file descriptor for worker control pipe exceeds maximum value".  We
know what caused this error and are fixing it.  But the problem was that a
MHD_select_thread worker thread was left running in the background after
MHD_start_daemon_va returned failure.  I think the problem is from this
code in the thread_failed case in daemon.c:

  /* Shutdown worker threads we've already created. Pretend
     as though we had fully initialized our daemon, but
     with a smaller number of threads than had been
     requested. */
  daemon->worker_pool_size = i - 1;
  MHD_stop_daemon (daemon);
  return NULL;

From the code, it looks like "i" is actually the number of threads that
were successfully created, so the "i - 1" in this code will leave an extra
thread hanging since MHD_stop_daemon will clean up one less thread than it
should.  I'll probably try to work up a test to verify removing the "- 1"
is correct, but that could take me some time so I wanted to make sure I
wasn't missing something obvious before heading down that path.

~JareD

He is right, this patch fixes it.
2015-05-13 09:35:33 +00:00
Evgeny Grin (Karlson2k) 5758ff1992 microhttpd.h: bump MHD_VERSION 2015-05-07 17:04:52 +00:00
Evgeny Grin (Karlson2k) b44ee80556 Define and use system-independent wrapper macro for poll() 2015-05-07 17:04:22 +00:00
Christian Grothoff b27bee6e17 fix #3784 2015-05-06 16:05:43 +00:00
Christian Grothoff 4d24fb764b -version bumping 2015-04-29 22:09:21 +00:00
Christian Grothoff b86f93acaf HI,
The MHD goes in a busy loop when it is configured with MHD_USE_POLL_INTERNALLY and a connection times out.
When the connection times out, the connection is closed at connection.c:2646, which sets connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP.
When the loop info is set to MHD_EVENT_LOOP_INFO_CLEANUP, the main function of the thread loop, MHD_poll_all, never calls back the connection idle callback, which would have cleaned the connection and exit the loop.
I resolved the issue in my development code by adding pos->idle_handler (pos) at daemon.c:2477 in MHD_poll_all (SVN 35533).

The busy loop could be tested using a small enough connection timeout and netcat:
nc -v -w 100 <IP ADDRESS> <IP PORT>

CPU usage will reach 100% in one of the CPU and will remain at that level even when the netcat has closed its end of the connection.

Thanks,

Louis Benoit
2015-04-14 22:34:15 +00:00
Christian Grothoff 4837ce0471 -bump 2015-04-12 19:52:44 +00:00
Christian Grothoff 9e9af3728c The issue reported below is correct, the fix is not. The "!=" comparing the RF flag should simply have been "==".
Louis wrote:

There is a change of behavior between 0.9.37 and 0.9.38.
When a client adds a "Connection: close" header in 0.9.37, MHD adds a "Connection: close" header to its response and then 
close the connection (as suggested in rfc2616, section 8.1.2.1).
The "Connection: close" header is not added in 0.9.38.
I looked into the 0.9.38 code and the code that prevents the inclusion of the "Connection: close" header is at line 773 of connection.c.
 if ( ( (NULL != client_requested_close) ||
 (MHD_YES == connection->read_closed) ) &&
 (NULL == response_has_close) &&
 (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) )
 must_add_close = MHD_YES;

Shouldn't it read
 if ( ( (NULL != client_requested_close) ||
 (MHD_YES == connection->read_closed) ||
 (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) ) &&
 (NULL == response_has_close) )
 must_add_close = MHD_YES;

Thanks,

Louis Benoit
2015-04-10 20:05:40 +00:00