Commit Graph
2414 Commits
Author SHA1 Message Date
Evgeny Grin (Karlson2k) fbe1ba9d47 mhd_bithelpers.h: used MSVC built-ins to speed-up VC-compiled code 2019-04-21 15:02:27 +03:00
Evgeny Grin (Karlson2k) d9506b7d29 Headers: better compatibility with MSVC compiler 2019-04-21 14:40:45 +03:00
Evgeny Grin (Karlson2k) d56c41f6f7 md5.c/.h: lowered number of included files. 2019-04-19 23:00:14 +03:00
Evgeny Grin (Karlson2k) f5970c7804 mhd_bithelpers.h: define _MHD_GET_32BIT_LE() and use it in md5.c 2019-04-19 22:35:15 +03:00
Evgeny Grin (Karlson2k) a50b4d566f mhd_bithelpers.h: use bytes swap instead of individual bytes
assignment when endianess is known to significantly speedup MD5 and
SHA256 calculations.
Use built-in bytes swap when available.
2019-04-19 22:07:37 +03:00
Evgeny Grin (Karlson2k) 9998ca7690 sha256.c: convert to Yoda conditions 2019-04-19 12:27:43 +03:00
Evgeny Grin (Karlson2k) 78a903946d sha256_update(): added shortcut for empty data,
avoid wrong/undefined behaviour of memcpy() with null pointer
2019-04-19 10:35:35 +03:00
Evgeny Grin (Karlson2k) 866b60aeb9 SHA256: rename sha256_digest() -> sha256_finish() 2019-04-19 10:33:07 +03:00
Evgeny Grin (Karlson2k) 5cfc039007 sha256.h: added missed include 2019-04-19 10:05:24 +03:00
Evgeny Grin (Karlson2k) 8d1a7ede98 SHA256: reimplemented from scratch,
some ideas are borrowed from LGPLv2.1-licensed Libgcrypt
2019-04-19 09:49:51 +03:00
Evgeny Grin (Karlson2k) c7d3fb718c Tests: added test_sha256 for SHA-256 testing 2019-04-19 09:16:36 +03:00
Evgeny Grin (Karlson2k) 0b8c463dd8 mhd_bithelpers.h: fixed macro for BE mode, added macros to GET/PUT
data in BE mode, added macro for bits rotation
2019-04-19 09:08:53 +03:00
Evgeny Grin (Karlson2k) abb665dd00 test_md5: fixed out of buffer reads/writes 2019-04-18 23:53:25 +03:00
Evgeny Grin (Karlson2k) 3290b1046c Really fix 6c985f4adc 2019-04-17 20:52:16 +03:00
Evgeny Grin (Karlson2k) e67fdd04a8 Moved bit manipulation to separate header file. 2019-04-17 20:42:34 +03:00
Evgeny Grin (Karlson2k) aec7a30459 mhd_byteorder.h: narrow down includes 2019-04-17 20:42:28 +03:00
Evgeny Grin (Karlson2k) d928d17156 Fixed build broken by 6c985f4adc 2019-04-17 20:42:28 +03:00
Evgeny Grin (Karlson2k) 6c985f4adc File read block size: move to proper location 2019-04-17 15:54:40 +03:00
Evgeny Grin (Karlson2k) 7ce09bd981 MD5: optimisation and simplification 2019-04-16 10:59:03 +03:00
Evgeny Grin (Karlson2k) 608b77383e MD5: some optimisations for little-endian 2019-04-16 10:59:02 +03:00
Evgeny Grin (Karlson2k) 7887edc2b4 MD5: count bytes, not bits
MHD do not add bites, no need to count more precise than bytes
2019-04-16 10:59:02 +03:00
Evgeny Grin (Karlson2k) 5194dd1615 MD5: fixed declaration 2019-04-16 10:59:01 +03:00
Evgeny Grin (Karlson2k) 41db082e8a MD5: replaced needless checks with asserts 2019-04-16 10:59:01 +03:00
Evgeny Grin (Karlson2k) 2f47f829da test_md5: added tests for md5 calculations 2019-04-16 10:59:00 +03:00
Christian Grothoff 1917b86699 add flags for TLS option control 2019-04-15 17:38:16 +02:00
Tim Rühsen ef15b53cb1 Fix realloc memleak in compress_buf() 2019-04-15 00:32:45 +02:00
Christian Grothoff 47a862a9be make Tim happy 2019-04-15 00:32:29 +02:00
Tim Rühsen 3ab54c6b3b Narrow scope of variable to succeed scan-build 2019-04-14 19:08:10 +02:00
Tim Rühsen 3b57d62c21 Fix memleak in example 2019-04-14 19:08:07 +02:00
Christian Grothoff 312713c363 merge 2019-04-08 15:12:45 +02:00
Christian Grothoff 83a86be948 fix close() checks 2019-04-08 15:12:20 +02:00
Christian Grothoff 1b610e5b13 allow binary zero in unescaped GET arguments (see mailinglist) 2019-03-20 10:46:21 +01:00
silvioprog e2c268e379 Added example for how to compress chunked HTTP response. 2019-02-10 21:13:57 -03:00
Christian Grothoff 154d0fd6a1 adjusting digest auth to previous regression fix, releasing 0.9.63 2019-02-10 17:13:03 +01:00
Christian Grothoff f6ee589dc9 add test for &-URI parsing and URI logging 2019-02-09 13:51:53 +01:00
Christian Grothoff d640ad8212 preliminary patch for query string issue reported on the ML 2019-02-07 16:16:56 +01:00
Christian Grothoff 302d381133 fix memory leak with TLS if daemon startup fails as reported by Nicolas Mora on the list 2019-01-11 21:17:41 +01:00
silvioprog dad0746a10 Added minimal example for how to compress HTTP response. (#4914) 2019-01-08 03:00:17 -03:00
Christian Grothoff b7052c0415 Check should (indeed) be for GNUTLS_E_AGAIN.
Lasa Martxel wrote:
Hello,

I have found the following code in daemon.c file, lines 1449 to 1467:

      if (0 >= res)
        {
          if (GNUTLS_E_INTERRUPTED != res)
            {
              urh->app.celi &= ~MHD_EPOLL_STATE_WRITE_READY;

              if (GNUTLS_E_INTERRUPTED != res)

(GNUTLS_E_INTERRUPTED != res) is checked twice.

In the read part (a few lines above), GNUTLS_E_INTERRUPTED != res is checked first and then GNUTLS_E_AGAIN != res. It looks like something similar should be done here, but I’m not sure.

Thanks,

Martxel
2018-12-19 00:06:48 +01:00
Christian Grothoff 700f23d5d7 Fixes build issue of testcase for some configurations.
Lasa Martxel <mlasa@ikerlan.es> wrote:

I was getting an error when running make check, when building test_upgrade. I have followed the following steps to build the library (tried both on master an v0.9.62, same result):

git clone https://gnunet.org/git/libmicrohttpd.git
cd libmicrohttpd
./bootstrap
./configure --enable-curl
make
make check

The error message I was getting is the following one:

gcc -DHAVE_CONFIG_H -I. -I../..  -I../../src/include -I../../src/microhttpd   -fvisibility=hidden  -pthread  -g -O2 -fno-strict-aliasing -MT test_upgrade-test_upgrade.o -MD -MP -MF .deps/test_upgrade-test_upgrade.Tpo -c -o test_upgrade-test_upgrade.o `test -f 'test_upgrade.c' || echo './'`test_upgrade.c

mv -f .deps/test_upgrade-test_upgrade.Tpo .deps/test_upgrade-test_upgrade.Po

/bin/bash ../../libtool  --tag=CC   --mode=link gcc -fvisibility=hidden  -pthread  -g -O2 -fno-strict-aliasing   -o test_upgrade test_upgrade-test_upgrade.o ../../src/microhttpd/libmicrohttpd.la

libtool: link: gcc -fvisibility=hidden -pthread -g -O2 -fno-strict-aliasing -o .libs/test_upgrade test_upgrade-test_upgrade.o  ../../src/microhttpd/.libs/libmicrohttpd.so -pthread

/usr/bin/ld: test_upgrade-test_upgrade.o: undefined reference to symbol 'gnutls_handshake@@GNUTLS_3_4'

//usr/lib/x86_64-linux-gnu/libgnutls.so.30: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status

Makefile:1139: recipe for target 'test_upgrade' failed

I had to add $(MHD_TLS_LIB_LDFLAGS) and $(MHD_TLS_LIBDEPS) to test_upgrade_LDADD and test_upgrade_tls_LDADD to the Makefile.am:

diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am

index 22b6100d..1f4ffca3 100644

--- a/src/microhttpd/Makefile.am

+++ b/src/microhttpd/Makefile.am

@@ -224,6 +224,7 @@ test_upgrade_LDFLAGS = \

   $(MHD_TLS_LIB_LDFLAGS)

test_upgrade_LDADD = \

   $(top_builddir)/src/microhttpd/libmicrohttpd.la \

+  $(MHD_TLS_LIB_LDFLAGS) $(MHD_TLS_LIBDEPS) \

   $(PTHREAD_LIBS)

 test_upgrade_tls_SOURCES = \

@@ -236,6 +237,7 @@ test_upgrade_tls_LDFLAGS = \

   $(MHD_TLS_LIB_LDFLAGS)

test_upgrade_tls_LDADD = \

   $(top_builddir)/src/microhttpd/libmicrohttpd.la \

+  $(MHD_TLS_LIB_LDFLAGS) $(MHD_TLS_LIBDEPS) \

   $(PTHREAD_LIBS)

 test_postprocessor_SOURCES = \

With that change, I’m able to correctly build, run and pass al the tests.

Regards,

Martxel

-> patched as suggested
2018-12-14 15:58:14 +01:00
Christian Grothoff 29cd7b735d update ignore file 2018-12-13 22:54:50 +01:00
Christian Grothoff 1619b9f051 reset timeout on response being queued, needed in thread-per-connection mode if the working thread takes very long 2018-12-13 22:51:05 +01:00
Christian Grothoff 8a9b198d4a add conn. close example 2018-12-12 17:50:06 +01:00
Christian Grothoff 5d75a87ef6 brutally simplify VLA macro for stupid compilers 2018-12-12 01:45:57 +01:00
Christian Grothoff 7ea8a3310e avoid c99-style comments in examples, fix missed VLA 2018-12-12 01:21:05 +01:00
Christian Grothoff 273a6df932 remove requirement for VLA in digestauth.c logic 2018-12-11 10:06:42 +01:00
Evgeny Grin (Karlson2k) e13c79ee3b Track socket CORK/NODELAY states to avoid extra syscalls 2018-12-10 22:14:59 +03:00
Evgeny Grin (Karlson2k) 4b5e8e0b45 connection.c: updated connection buffer control function to use
bool as return value. No change in processing logic.
2018-12-09 18:51:50 +03:00
Christian Grothoff 18a607a518 use WSA_FLAG_OVERLAPPED in W32 sockets as per suggestion from Johnathan McDougall on the mailinglist 2018-12-08 23:18:08 +01:00
Christian Grothoff 517c4a81c7 releasing libmicrohttpd 0.9.62 2018-12-08 23:11:13 +01:00