diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2019-05-25 16:29:54 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2019-05-25 16:29:54 +0300 |
commit | 29e20dfb656e146c8b2797a8d4b12cf6fa87fc92 (patch) | |
tree | c943ff0615fd6bff5be3fe7c594cf33901e1cc4c | |
parent | 6d210e7986375d208a75d3a7c82f799e34358645 (diff) | |
download | libmicrohttpd-29e20dfb656e146c8b2797a8d4b12cf6fa87fc92.tar.gz libmicrohttpd-29e20dfb656e146c8b2797a8d4b12cf6fa87fc92.zip |
Fixed cast of incompatible function pointer,
Default logger must return 'void', not 'int'
-rw-r--r-- | src/microhttpd/daemon.c | 15 | ||||
-rw-r--r-- | src/microhttpd/internal.h | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 5c35373d..249e4f6f 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -218,6 +218,19 @@ MHD_check_global_init_ (void) | |||
218 | } | 218 | } |
219 | #endif /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */ | 219 | #endif /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */ |
220 | 220 | ||
221 | |||
222 | /** | ||
223 | * Default logger function | ||
224 | */ | ||
225 | static void | ||
226 | MHD_default_logger_ (void *cls, | ||
227 | const char *fm, | ||
228 | va_list ap) | ||
229 | { | ||
230 | vfprintf ((FILE*)cls, fm, ap); | ||
231 | } | ||
232 | |||
233 | |||
221 | /** | 234 | /** |
222 | * Trace up to and return master daemon. If the supplied daemon | 235 | * Trace up to and return master daemon. If the supplied daemon |
223 | * is a master, then return the daemon itself. | 236 | * is a master, then return the daemon itself. |
@@ -5664,7 +5677,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
5664 | daemon->listen_backlog_size = 511; /* should be safe value */ | 5677 | daemon->listen_backlog_size = 511; /* should be safe value */ |
5665 | #endif /* !SOMAXCONN */ | 5678 | #endif /* !SOMAXCONN */ |
5666 | #ifdef HAVE_MESSAGES | 5679 | #ifdef HAVE_MESSAGES |
5667 | daemon->custom_error_log = (MHD_LogCallback) &vfprintf; | 5680 | daemon->custom_error_log = &MHD_default_logger_; |
5668 | daemon->custom_error_log_cls = stderr; | 5681 | daemon->custom_error_log_cls = stderr; |
5669 | #endif | 5682 | #endif |
5670 | if ( (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION)) && | 5683 | if ( (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION)) && |
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 062cff13..97ac050f 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -1422,7 +1422,7 @@ struct MHD_Daemon | |||
1422 | * Function for logging error messages (if we | 1422 | * Function for logging error messages (if we |
1423 | * support error reporting). | 1423 | * support error reporting). |
1424 | */ | 1424 | */ |
1425 | void (*custom_error_log) (void *cls, const char *fmt, va_list va); | 1425 | MHD_LogCallback custom_error_log; |
1426 | 1426 | ||
1427 | /** | 1427 | /** |
1428 | * Closure argument to @e custom_error_log. | 1428 | * Closure argument to @e custom_error_log. |