GNU libmicrohttpd 1.0.1
|
Typedefs | |
typedef void(* | MHD_LogCallback) (void *cls, const char *fm, va_list ap) |
typedef void(* | MHD_PanicCallback) (void *cls, const char *file, unsigned int line, const char *reason) |
Functions | |
_MHD_EXTERN void | MHD_set_panic_func (MHD_PanicCallback cb, void *cls) |
static void | file_logger (void *cls, enum MHD_StatusCode sc, const char *fm, va_list ap) |
MHD API to mange logging and error handling
Type of a callback function used for logging by MHD.
cls | closure |
fm | format string (printf() -style) |
ap | arguments to fm |
Definition at line 1559 of file microhttpd.h.
typedef void(* MHD_PanicCallback) (void *cls, const char *file, unsigned int line, const char *reason) |
Callback for serious error condition. The default action is to print an error message and abort()
.
cls | user specified value |
file | where the error occurred, may be NULL if MHD was built without messages support |
line | where the error occurred |
reason | error detail, may be NULL |
Definition at line 2633 of file microhttpd.h.
Logging implementation that logs to a file given as the cls.
cls | a FILE * to log to |
sc | status code of the event (ignored) |
fm | format string (printf() -style) |
ap | arguments to fm |
Definition at line 40 of file daemon_create.c.
References MHD_HTTP_OK.
Referenced by MHD_daemon_create().
_MHD_EXTERN void MHD_set_panic_func | ( | MHD_PanicCallback | cb, |
void * | cls ) |
Sets the global error handler to a different implementation.
cb will only be called in the case of typically fatal, serious internal consistency issues or serious system failures like failed lock of mutex.
These issues should only arise in the case of serious memory corruption or similar problems with the architecture, there is no safe way to continue even for closing of the application.
The default implementation that is used if no panic function is set simply prints an error message and calls abort()
. Alternative implementations might call exit()
or other similar functions.
cb | new error handler or NULL to use default handler |
cls | passed to cb |
Sets the global error handler to a different implementation. cb will only be called in the case of typically fatal, serious internal consistency issues. These issues should only arise in the case of serious memory corruption or similar problems with the architecture. While cb is allowed to return and MHD will then try to continue, this is never safe.
The default implementation that is used if no panic function is set simply prints an error message and calls abort()
. Alternative implementations might call exit()
or other similar functions.
cb | new error handler |
cls | passed to cb |
Definition at line 56 of file panic.c.
References MHD_HTTP_OK, mhd_panic, and mhd_panic_cls.
Referenced by MHD_init().