Commit Graph
1636 Commits
Author SHA1 Message Date
Christian Grothoff 55ecaec5a7 modify demo to handle HEAD requests 2015-06-25 19:08:49 +00:00
Christian Grothoff 4cdf058b25 -clarify when it is safe to call MHD_suspend_connection 2015-06-25 12:59:09 +00:00
Christian Grothoff 4f9c53c222 -fix compiler warnings 2015-06-12 07:45:50 +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) 588d2c38a2 response.c: MHD_create_response_from_fd_at_offset64(): don't create response if requested offset or size is not supported 2015-06-09 19:34:27 +00:00
Evgeny Grin (Karlson2k) cbdf2fe105 response.c: file_reader(): reduce read size if buffer is too large 2015-06-09 19:34:21 +00:00
Evgeny Grin (Karlson2k) 329c470596 response.c: file_reader(): add support for Linux hosts with 64-bit seek, but with 32-bit off_t (Android) 2015-06-09 19:34:14 +00:00
Evgeny Grin (Karlson2k) 67859a6401 response.c: file_reader(): add support for W32 64-bit seek 2015-06-09 19:34:07 +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) b218fd29ff fix: send_param_adapter(): do not send chunks larger than requested when using sendfile() 2015-06-08 22:18:30 +00:00
Evgeny Grin (Karlson2k) d4168c4478 fix used constant in send_param_adapter(), actually cosmetics only 2015-06-08 22:06:01 +00:00
Evgeny Grin (Karlson2k) b73339586b send_param_adapter(): fix setting errno on W32 2015-06-08 21:57:59 +00:00
Evgeny Grin (Karlson2k) bbb0c2504f recv_param_adapter() and send_param_adapter(): reduce receive/send size if it's too large 2015-06-08 21:57:52 +00:00
Christian Grothoff e5e5034111 I was checking a test app in valgrind and much to my surprise it was complaining about a memleak in libmicrohttpd.
In check_argument_match() a buffer is allocated using strdup() but freed nowhere.

I wouldn't have noticed this leak if it wasn't for valgrind because if a URI is requested without any arguments (my usual case)
the buffer that gets allocated has 'only' a length of 1 byte, thus memory usage will build up very slowly over time.

The patch attached fixes it.
Btw. the indentation of that file is a mess, tabs and spaces are mixed :-|

Regards,
Andreas
2015-06-04 11:37:05 +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 b7ab035907 -fix warning 2015-05-30 19:32:27 +00:00
Christian Grothoff aecadc41d2 -version bump 2015-05-29 10:21:43 +00:00
Christian Grothoff f2f5b55550 fix digest authentication with escaped urls, as reported on mailinglist 2015-05-29 10:20:53 +00:00
Christian Grothoff dd80b6137d bump 2015-05-18 21:18:26 +00:00
Christian Grothoff c549988da8 fix typo (#3789) 2015-05-16 19:08:50 +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) 9452c700f2 fix: gnutls_certificate_set_x509_key_mem2 was actually added in GnuTLS 3.1.11 2015-05-07 18:20:38 +00:00
Evgeny Grin (Karlson2k) 5e7f4c65f4 update ChangeLog 2015-05-07 17:09:29 +00:00
Evgeny Grin (Karlson2k) 5758ff1992 microhttpd.h: bump MHD_VERSION 2015-05-07 17:04:52 +00:00
Evgeny Grin (Karlson2k) 16fc241e3c w32 VS project: add support for build for XP, internally optimize project files 2015-05-07 17:04:45 +00:00
Evgeny Grin (Karlson2k) 6092a01a48 tests: replace '#ifdefs' with 'MHD_is_feature_supported()' 2015-05-07 17:04:37 +00:00
Evgeny Grin (Karlson2k) 611597070c configure: add support for "--enable-poll"
Conflicts:
	configure.ac
2015-05-07 17:04:27 +00:00
Evgeny Grin (Karlson2k) b44ee80556 Define and use system-independent wrapper macro for poll() 2015-05-07 17:04:22 +00:00
Evgeny Grin (Karlson2k) cb83913d0e Check for poll() function, use HAVE_POLL macro 2015-05-07 17:04:10 +00:00
Evgeny Grin (Karlson2k) 3593a519b7 Replace variable-sized array with malloc()/free() 2015-05-07 17:04:02 +00:00
Evgeny Grin (Karlson2k) 633e5a1108 daemon.c: fix typos 2015-05-07 17:03:55 +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 cff0854d51 if we actually resumed a connection, the following call to select()/poll()/epoll() must always be non-blocking 2015-04-29 22:05:15 +00:00
Christian Grothoff 63eb8917e7 -doxygen, indentation, bracketing, no semantic changes 2015-04-28 22:45:47 +00:00
LRN 663d2dea11 Make libplatform_interface.la a dependency where appropriate
Trying to fix this buildslave error:
make[3]: *** No rule to make target '../../src/platform/libplatform_interface.la', needed by 'libmicrohttpd.la'.  Stop.
2015-04-21 18:13:46 +00:00
Christian Grothoff c9ad7cda51 -instant timeout on connection hitting cleanup 2015-04-17 15:56:47 +00:00
Christian Grothoff 1a11c2c680 fix #3753 2015-04-15 01:19:44 +00:00
Christian Grothoff 639bfd972d fix #3752: linker issues on solaris 2015-04-14 22:49:27 +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 10a27715a5 Adding "testcase" (demo_https) and a fix. -CG
Hi,

I am doing test with HTTPS at low bit rate for large files using:
wget -v --no-check-certificate --limit-rate=1000 https://....

When the MHD daemon is configured with MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY, I noticed that the thread takes 100% CPU, whereas
the MHD_USE_POLL_INTERNALLY configuration show a normal CPU usage.

Adding logs I see that the busy loops takes place at daemon.c, line 2605 (0.9.38):
daemon->eready_tail never gets NULL most probably due to connection.c, line 2671 to 2721

Thanks,

Louis
2015-04-12 19:52:29 +00:00