aboutsummaryrefslogtreecommitdiff
path: root/src/examples/https_fileserver_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/https_fileserver_example.c')
-rw-r--r--src/examples/https_fileserver_example.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c
index a8897a8d..9c7ec65a 100644
--- a/src/examples/https_fileserver_example.c
+++ b/src/examples/https_fileserver_example.c
@@ -157,33 +157,33 @@ main (int argc, char *const *argv)
157{ 157{
158 struct MHD_Daemon *TLS_daemon; 158 struct MHD_Daemon *TLS_daemon;
159 159
160 if (argc == 3){ 160 if (argc == 3)
161 /* TODO check if this is truly necessary - disallow usage of the blocking /dev/random */ 161 {
162 /* gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); */ 162 /* TODO check if this is truly necessary - disallow usage of the blocking /dev/random */
163 TLS_daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG 163 /* gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); */
164 | MHD_USE_SSL, atoi (argv[1]), 164 TLS_daemon =
165 NULL, 165 MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG |
166 NULL, &http_ahc, 166 MHD_USE_SSL, atoi (argv[1]), NULL, NULL, &http_ahc,
167 NULL, MHD_OPTION_CONNECTION_TIMEOUT, 256, 167 NULL, MHD_OPTION_CONNECTION_TIMEOUT, 256,
168 MHD_OPTION_HTTPS_MEM_KEY, key_pem, 168 MHD_OPTION_HTTPS_MEM_KEY, key_pem,
169 MHD_OPTION_HTTPS_MEM_CERT, cert_pem, 169 MHD_OPTION_HTTPS_MEM_CERT, cert_pem,
170 170 MHD_OPTION_END);
171 MHD_OPTION_END); 171 }
172 } 172 else
173 else { 173 {
174 printf 174 printf ("Usage: %s HTTP-PORT SECONDS-TO-RUN\n", argv[0]);
175 ("Usage : %s HTTP-PORT SECONDS-TO-RUN\n", argv[0]); 175 return 1;
176 return 1; 176 }
177 }
178 177
179 if (TLS_daemon == NULL) 178 if (TLS_daemon == NULL)
180 { 179 {
181 printf ("Error: failed to start TLS_daemon"); 180 fprintf (stderr, "Error: failed to start TLS_daemon\n");
182 return 1; 181 return 1;
183 } 182 }
184 else { 183 else
185 printf ("MHD daemon listening on port %d\n", atoi (argv[1])); 184 {
186 } 185 printf ("MHD daemon listening on port %d\n", atoi (argv[1]));
186 }
187 187
188 sleep (atoi (argv[2])); 188 sleep (atoi (argv[2]));
189 189