Commit Graph
345 Commits
Author SHA1 Message Date
Christian Grothoff c5c822fdbe add json_echo example 2025-05-13 08:42:23 +02:00
Мяделец Андрей Алексеевич 44db29ca76 src/examples/demo{,_https}: fix response buffer overwriting
Adding address offset when copying string.

The code was broken by 5821a7f3 ("src/examples/demo{,_https}: added some error
checking, fixed compiler warnings").
2024-04-22 13:11:19 +02:00
Evgeny Grin (Karlson2k) 65e62d0426 Compiler warning fixes 2024-01-31 15:37:54 +01:00
Evgeny Grin (Karlson2k) 086fcdacbb Fixes for 32-bit platforms 2024-01-31 10:33:03 +01:00
Evgeny Grin (Karlson2k) 4f494d00b7 Fixed compiler warnings 2024-01-30 20:49:09 +01:00
Evgeny Grin (Karlson2k) d63cb66783 Muted extra compiler warnings 2024-01-30 17:22:36 +01:00
Evgeny Grin (Karlson2k) ce9681ec24 Updated .gitignore 2024-01-29 22:26:45 +01:00
Evgeny Grin (Karlson2k) 3bd6b07fc4 Minor corrections for bc827fcc09 2024-01-29 12:01:19 +01:00
Evgeny Grin (Karlson2k) bc827fcc09 digest_auth_example_adv: added new example
The new example demonstrates advanced usage of the digest auth API
2024-01-28 23:14:44 +01:00
Evgeny Grin (Karlson2k) f7969b8749 digest_auth_example: updated and fixed
The example was updated to use the new digest auth API.
Fixed run on W32.
2024-01-28 23:04:31 +01:00
Evgeny Grin (Karlson2k) 89c1076aac Added MHD_OPTION_APP_FD_SETSIZE and MHD_FEATURE_FLEXIBLE_FD_SETSIZE
This should provide better compatibility with platforms with ability
to override FD_SETSIZE.
The new option is used examples and tests.
2023-11-07 20:49:10 +03:00
Evgeniy Gavrilenko 90fcf2fc22 websocket_threaded_example: fix websocket url string
Remove extra space character from websocket url string.

The code was broken by beb7fa82 ("fix transmission stall issue with upgraded
TLS connections reported by Nguyen Xuan Viet on the mailinglist").
2023-10-19 08:27:07 +03:00
Evgeny Grin (Karlson2k) ce38b0fa79 Renamed one new basic auth function, improved doxy 2023-10-06 14:12:31 +03:00
Evgeny Grin (Karlson2k) 93bc2751bf Improved compatibility with old compilers 2023-09-27 20:02:00 +03:00
Christian Grothoff 0ae494028b check rvalues from MHD_post_process in examples 2023-09-25 21:38:23 +02:00
Christian Grothoff 138ee33a41 check rvalues from MHD_add_response_header in examples 2023-09-25 21:31:59 +02:00
Christian Grothoff 9327a8cc46 check rvalues from MHD_add_response_header in examples 2023-09-25 21:30:03 +02:00
Christian Grothoff 2212a37256 check rvalues from pthread_mutex_ operations in examples 2023-09-25 21:26:31 +02:00
Evgeny Grin (Karlson2k) c209ce76f7 Fixed missing <errno.h> includes
While 'errno' can be defined in various headers, by standard it must
be defined in <errno.h> header.
2023-09-17 11:07:40 +03:00
Evgeny Grin (Karlson2k) dd4f6ff9ea websocket_threaded_example: fixed wrong commented-out code 2023-06-01 11:29:44 +03:00
Evgeny Grin (Karlson2k) 5c3a61d68c Added new daemon option MHD_OPTION_CLIENT_DISCIPLINE_LV
Reject URIs with spaces as per RFC.
Fixed check for space before colon in headers (previously it was checked
only when MHD was NOT strict).
Reject HTTP/1.1 requests without host by default (as per RFC).
2022-12-22 18:25:49 +03:00
Evgeny Grin (Karlson2k) 1ffe7932df Tests and examples: added rule to (re-)build libmicrohttpd.la 2022-11-06 15:01:19 +03:00
Evgeny Grin (Karlson2k) 9440f9aefe configure: do not pass AM_TESTS_ENVIRONMENT directly 2022-10-30 13:20:19 +03:00
Christian Grothoff b85d48cd95 -support mime-types by file extension in demo.c 2022-10-28 15:20:38 +02:00
Evgeny Grin (Karlson2k) 4adc14c948 Some readability improvements 2022-09-28 11:46:59 +03:00
Evgeny Grin (Karlson2k) 6933158a95 muted some compiler warnings for clang 2022-09-28 10:39:32 +03:00
Evgeny Grin (Karlson2k) c03c57c9d2 Added MHD_queue_auth_required_response3(); Refactored public Digest Auth API v3
Added brand new function with more complete support for RFC 7616
features. New function implemented from scratch. Old functions became
wrappers for the new function, so fixes are inherited.

Fixes:
* All user values are properly quoted
Features:
* Added support for optional 'domain' Digest auth parameter
* Realm now optional
* Added userhash support
* Added charset support

For other Digest Auth v3 functions:
* Added more parameters for complete control of Auth process from
  application side.
2022-07-28 07:21:35 +03:00
Alexander Irion 3526ff8302 Remove double adding of MHD_HTTP_HEADER_CONNECTION response header
MHD_create_response_for_upgrade() already adds the MHD_HTTP_HEADER_CONNECTION response header, so
the additional MHD_add_response_header is wrong.

In our application it caused, that on a Apple iPad, the websocket was immediately closed by the
browser(Safari, Chrome, Opera) after the protocol upgrade. Browsers on Linux, Android did not had this issue.

Signed-off-by: Alexander Irion <alexander_irion@mentor.com>
2022-06-15 15:28:07 +03:00
Evgeny Grin (Karlson2k) 4e5bddd004 websocket_threaded_example: minor fixes 2022-06-14 20:13:46 +03:00
Evgeny Grin (Karlson2k) c2414ffc9a Updated examples to use new API for Basic Authorization 2022-06-13 12:15:50 +03:00
Evgeny Grin (Karlson2k) e583a3430f websocket_threaded_example: fixed sprintf() usage, compiler warnings 2022-06-02 17:03:31 +03:00
Evgeny Grin (Karlson2k) 8da7be3b7b examples: marked non-global variables as 'static' 2022-06-02 09:07:48 +03:00
Evgeny Grin (Karlson2k) badf75607b http_chunked_compression: fixed errors 2022-06-01 22:12:38 +03:00
Evgeny Grin (Karlson2k) 5821a7f303 src/examples/demo{,_https}: added some error checking, fixed compiler warnings 2022-06-01 22:12:38 +03:00
Evgeny Grin (Karlson2k) 0e829bf21b src/examples/benchmark{,_https}: simplified time calculation 2022-06-01 22:12:38 +03:00
Evgeny Grin (Karlson2k) aefa12e99a src/examples/*fileserver*.c: added error checking 2022-06-01 22:12:38 +03:00
Evgeny Grin (Karlson2k) 93dcf8ea91 src/examples: muted compiler warnings 2022-06-01 22:12:37 +03:00
Evgeny Grin (Karlson2k) 2ec6b3c7c9 Use '#ifdef PARAM' instead of '#if PARAM' for configuration options 2022-05-16 19:46:30 +03:00
Evgeny Grin (Karlson2k) 85ae657849 Replaced MHD_RESPMEM_PERSISTENT usage in examples and code
New functions do not produce compiler warnings.
2022-05-14 15:07:47 +03:00
Evgeny Grin (Karlson2k) a13647d1d0 Replaced MHD_RESPMEM_MUST_FREE with more portable solution in examples 2022-05-14 14:37:02 +03:00
Evgeny Grin (Karlson2k) 001b6b87fd Updated example to use new digest auth function 2022-05-13 17:22:28 +03:00
Evgeny Grin (Karlson2k) ba77b04c65 Replaced calls of MHD_get_timeout() in tests and examples
The calls were replaced with the calls of the new functions.
Completely removed the usage of MHD_UNSIGNED_LONG_LONG.
2022-04-28 19:06:46 +03:00
Evgeny Grin (Karlson2k) d1c74589fb src/examples: fixed printf format specifiers 2022-04-23 15:25:50 +03:00
Evgeny Grin (Karlson2k) 0fa1c67543 websocket_threaded_example: mark function as static 2022-04-23 15:21:19 +03:00
Evgeny Grin (Karlson2k) 351d8a65d6 Fixed old-style functions definitions 2022-04-23 15:21:19 +03:00
Evgeny Grin (Karlson2k) dde8624f97 Updated test TLS certificate in test and examples
The new certificate should be a bit more similar to production certs.
2022-04-21 13:40:09 +03:00
Evgeny Grin (Karlson2k) 85775e29a9 src/examples: Fixed drop of 'const' qualifiers and minor fixes.
* some minor fixes and improvements.
2022-04-19 20:27:37 +03:00
Evgeny Grin (Karlson2k) 1a7e4a5a5b Updated docs, test, and example to use correct digest auth API 2022-01-27 19:13:37 +03:00
Evgeny Grin (Karlson2k) 6ed5b52d3e Fixed early response with digest auth in tests, examples, and documentation 2022-01-18 15:56:09 +03:00
Evgeny Grin (Karlson2k) bd41946e8f Renamed 'con_cls' -> 'req_cls' for access handler callback
The argument is actually request-specific, not connection specific. The
name was confusing.
Fixed related documentation and clarified usage.

Also fixed code where argument named 'unused' was actually used.
2022-01-18 15:18:40 +03:00