aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c69
1 files changed, 1 insertions, 68 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 1ddbd83e..e58a1caa 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -117,47 +117,6 @@ MHD_epoll (struct MHD_Daemon *daemon,
117#endif /* EPOLL_SUPPORT */ 117#endif /* EPOLL_SUPPORT */
118 118
119/** 119/**
120 * Default implementation of the panic function,
121 * prints an error message and aborts.
122 *
123 * @param cls unused
124 * @param file name of the file with the problem
125 * @param line line number with the problem
126 * @param reason error message with details
127 */
128_MHD_NORETURN static void
129mhd_panic_std (void *cls,
130 const char *file,
131 unsigned int line,
132 const char *reason)
133{
134 (void) cls; /* Mute compiler warning. */
135#ifdef HAVE_MESSAGES
136 fprintf (stderr,
137 _ ("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
138 file,
139 line,
140 reason);
141#else /* ! HAVE_MESSAGES */
142 (void) file; /* Mute compiler warning. */
143 (void) line; /* Mute compiler warning. */
144 (void) reason; /* Mute compiler warning. */
145#endif
146 abort ();
147}
148
149
150/**
151 * Handler for fatal errors.
152 */
153MHD_PanicCallback mhd_panic = (MHD_PanicCallback) NULL;
154
155/**
156 * Closure argument for #mhd_panic.
157 */
158void *mhd_panic_cls = NULL;
159
160/**
161 * Globally initialise library. 120 * Globally initialise library.
162 */ 121 */
163void 122void
@@ -7889,31 +7848,6 @@ MHD_get_daemon_info (struct MHD_Daemon *daemon,
7889 7848
7890 7849
7891/** 7850/**
7892 * Sets the global error handler to a different implementation. @a cb
7893 * will only be called in the case of typically fatal, serious
7894 * internal consistency issues. These issues should only arise in the
7895 * case of serious memory corruption or similar problems with the
7896 * architecture. While @a cb is allowed to return and MHD will then
7897 * try to continue, this is never safe.
7898 *
7899 * The default implementation that is used if no panic function is set
7900 * simply prints an error message and calls `abort()`. Alternative
7901 * implementations might call `exit()` or other similar functions.
7902 *
7903 * @param cb new error handler
7904 * @param cls passed to @a cb
7905 * @ingroup logging
7906 */
7907void
7908MHD_set_panic_func (MHD_PanicCallback cb,
7909 void *cls)
7910{
7911 mhd_panic = cb;
7912 mhd_panic_cls = cls;
7913}
7914
7915
7916/**
7917 * Obtain the version of this library 7851 * Obtain the version of this library
7918 * 7852 *
7919 * @return static version string, e.g. "0.9.9" 7853 * @return static version string, e.g. "0.9.9"
@@ -8175,8 +8109,7 @@ MHD_init (void)
8175 WSADATA wsd; 8109 WSADATA wsd;
8176#endif /* MHD_WINSOCK_SOCKETS */ 8110#endif /* MHD_WINSOCK_SOCKETS */
8177 8111
8178 if (NULL == mhd_panic) 8112 MHD_set_panic_func (NULL, NULL);
8179 mhd_panic = &mhd_panic_std;
8180 8113
8181#if defined(MHD_WINSOCK_SOCKETS) 8114#if defined(MHD_WINSOCK_SOCKETS)
8182 if (0 != WSAStartup (MAKEWORD (2, 2), &wsd)) 8115 if (0 != WSAStartup (MAKEWORD (2, 2), &wsd))