aboutsummaryrefslogtreecommitdiff
path: root/src/lib/daemon_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/daemon_create.c')
-rw-r--r--src/lib/daemon_create.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/lib/daemon_create.c b/src/lib/daemon_create.c
index a2173d88..cd3d0ec4 100644
--- a/src/lib/daemon_create.c
+++ b/src/lib/daemon_create.c
@@ -38,16 +38,16 @@
38 */ 38 */
39static void 39static void
40file_logger (void *cls, 40file_logger (void *cls,
41 enum MHD_StatusCode sc, 41 enum MHD_StatusCode sc,
42 const char *fm, 42 const char *fm,
43 va_list ap) 43 va_list ap)
44{ 44{
45 FILE *f = cls; 45 FILE *f = cls;
46 46
47 (void) sc; 47 (void) sc;
48 (void) vfprintf (f, 48 (void) vfprintf (f,
49 fm, 49 fm,
50 ap); 50 ap);
51} 51}
52 52
53 53
@@ -84,16 +84,16 @@ unescape_wrapper (void *cls,
84 */ 84 */
85struct MHD_Daemon * 85struct MHD_Daemon *
86MHD_daemon_create (MHD_RequestCallback cb, 86MHD_daemon_create (MHD_RequestCallback cb,
87 void *cb_cls) 87 void *cb_cls)
88{ 88{
89 struct MHD_Daemon *daemon; 89 struct MHD_Daemon *daemon;
90 90
91 MHD_check_global_init_(); 91 MHD_check_global_init_ ();
92 if (NULL == (daemon = malloc (sizeof (struct MHD_Daemon)))) 92 if (NULL == (daemon = malloc (sizeof (struct MHD_Daemon))))
93 return NULL; 93 return NULL;
94 memset (daemon, 94 memset (daemon,
95 0, 95 0,
96 sizeof (struct MHD_Daemon)); 96 sizeof (struct MHD_Daemon));
97#ifdef EPOLL_SUPPORT 97#ifdef EPOLL_SUPPORT
98 daemon->epoll_itc_marker = "itc_marker"; 98 daemon->epoll_itc_marker = "itc_marker";
99#endif 99#endif
@@ -107,29 +107,29 @@ MHD_daemon_create (MHD_RequestCallback cb,
107#if ENABLE_DAUTH 107#if ENABLE_DAUTH
108 daemon->digest_nc_length = DIGEST_NC_LENGTH_DEFAULT; 108 daemon->digest_nc_length = DIGEST_NC_LENGTH_DEFAULT;
109#endif 109#endif
110 daemon->listen_backlog = LISTEN_BACKLOG_DEFAULT; 110 daemon->listen_backlog = LISTEN_BACKLOG_DEFAULT;
111 daemon->fo_queue_length = FO_QUEUE_LENGTH_DEFAULT; 111 daemon->fo_queue_length = FO_QUEUE_LENGTH_DEFAULT;
112 daemon->listen_socket = MHD_INVALID_SOCKET; 112 daemon->listen_socket = MHD_INVALID_SOCKET;
113 113
114 if (! MHD_mutex_init_ (&daemon->cleanup_connection_mutex)) 114 if (! MHD_mutex_init_ (&daemon->cleanup_connection_mutex))
115 { 115 {
116 free (daemon); 116 free (daemon);
117 return NULL; 117 return NULL;
118 } 118 }
119 if (! MHD_mutex_init_ (&daemon->per_ip_connection_mutex)) 119 if (! MHD_mutex_init_ (&daemon->per_ip_connection_mutex))
120 { 120 {
121 (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex); 121 (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
122 free (daemon); 122 free (daemon);
123 return NULL; 123 return NULL;
124 } 124 }
125#ifdef DAUTH_SUPPORT 125#ifdef DAUTH_SUPPORT
126 if (! MHD_mutex_init_ (&daemon->nnc_lock)) 126 if (! MHD_mutex_init_ (&daemon->nnc_lock))
127 { 127 {
128 (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex); 128 (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
129 (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex); 129 (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
130 free (daemon); 130 free (daemon);
131 return NULL; 131 return NULL;
132 } 132 }
133#endif 133#endif
134 return daemon; 134 return daemon;
135} 135}