Commit Graph
4924 Commits
Author SHA1 Message Date
Christian Grothoff 49b0e0ce8f fix #2734 2013-01-29 20:44:22 +00:00
Christian Grothoff b1a0a07b65 fixing regression from January 6th 2013-01-26 20:42:29 +00:00
Christian Grothoff afb01406a3 return success even without optional \r\n 2013-01-11 22:34:56 +00:00
Christian Grothoff 1a3cf8efd0 -bump 2013-01-07 06:28:53 +00:00
Christian Grothoff 3d0152c7bb allow 0-byte responses with response_from_callback 2013-01-06 20:21:31 +00:00
Christian Grothoff 28cba57e89 0924 2012-12-25 17:44:31 +00:00
Christian Grothoff 166909d2ce I was was having problems receiving data from a client using POST with chunked encoding.
It turns out this client is violating the HTTP spec by setting the "Transfer-Encoding: Chunked"
as well as "Content-Length: 0"

Here are the client headers:
  POST /ee4/live.isml/Streams(Encoder1) HTTP/1.1
  Transfer-Encoding: Chunked
  User-Agent: ExpressionEncoder
  Host: 10.11.1.29
  Content-Length: 0
  Connection: Keep-Alive
  Cache-Control: no-cache

This is what HTTP 1.1 spec says (in section 4.4):
  Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding. If the message does include
  a non- identity transfer-coding, the Content-Length MUST be ignored.

libmicrohttpd does the opposite of what the 4.4 section says if both headers are present.  It only uses the content-length and ignores the
chunked encoding.
I patched libmicrohttpd with the attached patch that does the opposite.  It ignores the content-length if chunked encoding is also specified.
And with that patch libmicrohttpd can be a publishing point for MS Expression Encoder.

What is your take on this?

-eivind
=> answer: follow the spec ;-)
2012-12-18 20:25:37 +00:00
Christian Grothoff d9f458b2e6 force transmission of connection: close header 2012-12-06 09:20:32 +00:00
Christian Grothoff 3c0a2695f8 -bump 2012-12-05 18:28:48 +00:00
Christian Grothoff 2027b939dd Matthew Mundell wrote:
Hi

We've been having some mysterious parameter loss of POST parameters in
OpenVAS's GSA.  This only happens with IE8 and Chrome.  We saw this with
libmicrohttpd 0.9.19 and 0.9.20.

The cause looks to be an error in libmicrohttpd.  Patch to 0.9.20 to
resolve below.

In post_process_multipart in postprocessor.c the PP_Init state calls
find_boundary to find the first boundary.  If there is junk before the
first boundary it just reads over the junk.  However, it is also reading
over the actual boundary when there was too little data to determine
whether the next character is the start of the boundary.

In the error case Chrome seems to sends the POST request in multiple
writes.  The first chunk includes a single "-" from the first boundary at
end of the headers.  Thus libmicrohttpd has a partial boundary to deal
with.

I guess Chrome intends to send just the headers but gets the count wrong
due to sending the initial P of the POST on its own (all the browsers do
that for some reason).  Firefox on the other hand sends the headers and the
body in a single write, so it always works.

Thanks, and thanks for libmicrohttpd!

Matt
2012-12-05 18:28:17 +00:00
Christian Grothoff 5eb408d091 -new API proposal 2012-11-25 13:12:04 +00:00
Christian Grothoff 802d1322f2 Ship its own version of tsearch and friends if not provided by platform.
On GNU based systems the tree related functions (tsearch, tfind, tdestroy)
are provided by the libc (with the interface specification in search.h). On
non-GNU systems this functionality may or may not be available. That's the
case for Android which ships its own, simplified, version of libc called
Bionic. Bionic does not contains neither search.h nor an implementation of
the above mentioned functions.

This patch adds detection for the presence of search.h and if the header file
is not found, it uses an internal version of search.h and functions tsearch,
tfind, and tdestroy. The internal version is based on the source code from
FreeBSD and is compiled if and only if the configure script did not find the
search.h header file.
 -- Jan Janak
2012-11-08 21:35:38 +00:00
Christian Grothoff 25e72ff2bf -search.h begone 2012-11-08 21:30:28 +00:00
Christian Grothoff 60af694fd1 -include tsearch.h only where needed, use local version if OS does not support it 2012-11-08 21:28:35 +00:00
Christian Grothoff 764c1a14ee -do not include search.h in platform.h, will be included in daemon.c 2012-11-08 21:26:41 +00:00
Christian Grothoff d87ad1a20b updating config.guess/config.sub to latest gnulib version 2012-11-08 21:23:23 +00:00
Christian Grothoff dc6f6a872e Trying to fix issue reported by Matthieu:
>>
I face an issue while handling big https posts with libmicrohttpd 0.9.22.
I'm using an "external" select based on MHD_get_fdset and MHD_run.

Let's assume 16K of encrypted data arrive on the socket.
When the data arrives, my select correctly returns and MHD_run is called.

Do_read will first call gnu_tls to decrypt the data.
Apparently gnu_tls reads the full 16K so starting here, from the point of
view of socket/select, there is no more data to read.

Do_read however presents a buffer of only 9K to gnu_tls to retrieve the data
(9K as the result of a try_grow_read_buffer call).
So gnu_tls returns 9K of clear data and keeps the rest 7K in its own buffer
I think.
Do_read handles the 9K and then MHD_run returns;

Since from the socket point of view no data is pending read, select will
then wait until it finally timeout.
Only after this timeout, MHD_run is run again and the remaining 7K are
correctly processed.

I found two dirty workarounds for this issue :
1/ increase the MDH_BUF_INC_SIZE to an arbitrarily large value so it will
always be greater than gnu_tls own buffers
2/ run multiple MHD_run after each select (let's say 10 times)

What do you think of this issue ?
What could be a cleaner way of handling this ?
<<
Approach: detect that we *might* be in this situation because TLS fills
the entire buffer we give to gnuTLS.  If so, set timeout to 0 and read
again.
2012-10-22 11:07:36 +00:00
Christian Grothoff 42c501a9c4 -fix #if WINDOWS problems reported by Luis Garcia on the mailinglist 2012-10-15 23:34:56 +00:00
Christian Grothoff d460042ef6 increase timeouts to escape problems with time_wait 2012-10-08 13:02:40 +00:00
Christian Grothoff 704717f23f -getting rid of cparser warning 2012-09-30 21:29:59 +00:00
Christian Grothoff 28cb2cd769 -fix type to ensure that comparisson will always work 2012-09-28 21:35:58 +00:00
Christian Grothoff d1d5bf7cb9 -introduce MHD_UNSIGNED_LONG_LONG, deprecate MHD_LONG_LONG, check for invalid options on start, document 2012-09-28 11:39:38 +00:00
Christian Grothoff 54f9e798f2 -simplify code 2012-09-28 11:00:43 +00:00
Christian Grothoff aa816b9704 -make monkey happy 2012-09-28 10:07:23 +00:00
Christian Grothoff 34067a4a2c -remark 2012-09-20 13:40:27 +00:00
Christian Grothoff 60e3c37d32 ignore 2012-09-08 19:20:21 +00:00
Christian Grothoff c0a35aad4c update distfiles 2012-09-08 19:18:42 +00:00
Christian Grothoff b59348b94e double-including of version.texi not allowed 2012-09-08 19:16:07 +00:00
Christian Grothoff 5a046307a7 applyin Karl Berry's suggestions for GNU libextractor also to MHD 2012-09-08 19:15:04 +00:00
Christian Grothoff ad74bf4b44 releasing 0.9.22 2012-09-01 18:51:43 +00:00
Christian Grothoff 305acdf03a allowing independent enabling/disabling of digest and basic authentication (Mantis #2525) 2012-09-01 18:47:23 +00:00
Christian Grothoff a22321bf1a fixing #2531 2012-08-30 19:17:17 +00:00
Christian Grothoff bf92eff1f8 close file, clarify license 2012-08-23 12:36:18 +00:00
Christian Grothoff 5133b28b09 fixing #2511 2012-08-22 22:44:35 +00:00
Christian Grothoff 5c009667f0 bump 2012-08-21 12:39:15 +00:00
Christian Grothoff 9d80af66d5 use int instead of enums in va_arg calls 2012-08-21 12:37:36 +00:00
Christian Grothoff aaecd079b6 reduce xbuf_size as suggested by Martin Velek on mailinglist 2012-08-21 12:33:51 +00:00
Christian Grothoff 7c89f644a1 need to use must copy, as page is on the stack 2012-08-14 18:37:27 +00:00
Christian Grothoff e815956b7b specify content type 2012-08-14 17:16:38 +00:00
Christian Grothoff 300f5594b1 making examples compile without warnings 2012-08-14 17:10:50 +00:00
Christian Grothoff 15e3b096a4 -releasing 0.9.21 2012-07-19 19:56:54 +00:00
Christian Grothoff 3f2b73dd80 -additional code cleanup 2012-07-19 15:31:39 +00:00
Christian Grothoff 333b6f62d6 -update 2012-07-17 22:03:14 +00:00
Christian Grothoff be822f1e93 spacing 2012-07-17 21:57:33 +00:00
Christian Grothoff a232740396 code cleanup, minor bug fixes, allow lookup up trailing values with key of NULL 2012-07-17 21:52:26 +00:00
Christian Grothoff ea8a8fe455 -version bump in header 2012-07-17 20:40:39 +00:00
Christian Grothoff ccd65de6a3 adding experimental extension 'HD_USE_NO_LISTEN_SOCKET' 2012-07-17 20:39:44 +00:00
Christian Grothoff a9c93d5a81 -syncing 2012-07-17 20:35:08 +00:00
Christian Grothoff 7337214106 -fixing https tests after changes in gnutls 2012-07-17 20:34:43 +00:00
Christian Grothoff e1111f82e9 -fixing sendfile mess 2012-07-17 20:16:23 +00:00