125 |
|
|
126 |
static void check_Impl(); |
static void check_Impl(); |
127 |
static void initialize_service(); |
static void initialize_service(); |
128 |
static int authenticate(Socket_T); |
static int authenticate(const char*); |
129 |
static int is_host_allow(const char *); |
static int is_host_allow(const char *); |
130 |
static void destroy_host_allow(HostsAllow); |
static void destroy_host_allow(HostsAllow); |
131 |
static Socket_T socket_producer(int, int, void*); |
static Socket_T socket_producer(int, int, void*); |
189 |
continue; |
continue; |
190 |
} |
} |
191 |
|
|
|
if(! authenticate(S)) { |
|
|
socket_free(&S); |
|
|
continue; |
|
|
} |
|
|
|
|
192 |
http_processor(S); |
http_processor(S); |
193 |
|
|
194 |
} |
} |
196 |
if(S) { |
if(S) { |
197 |
socket_free(&S); |
socket_free(&S); |
198 |
} |
} |
199 |
|
|
200 |
delete_ssl_server_socket(mySSLServerConnection); |
delete_ssl_server_socket(mySSLServerConnection); |
201 |
close(myServerSocket); |
close_socket(myServerSocket); |
202 |
|
|
203 |
} |
} |
204 |
|
|
350 |
* FALSE. If allow Basic Authentication is defined in the Run.Auth |
* FALSE. If allow Basic Authentication is defined in the Run.Auth |
351 |
* object, authentication is delegated to the processor module. |
* object, authentication is delegated to the processor module. |
352 |
*/ |
*/ |
353 |
static int authenticate(Socket_T S) { |
static int authenticate(const char *host) { |
354 |
|
|
355 |
if(is_host_allow(socket_get_remote_host(S))) { |
if(is_host_allow(host)) { |
356 |
|
|
357 |
return TRUE; |
return TRUE; |
358 |
|
|
363 |
return TRUE; |
return TRUE; |
364 |
|
|
365 |
} |
} |
366 |
|
|
367 |
|
log("%s: Denied connection from non-authorized client [%s]\n", prog, host); |
368 |
|
|
369 |
return FALSE; |
return FALSE; |
370 |
|
|
444 |
goto error; |
goto error; |
445 |
} |
} |
446 |
|
|
447 |
|
if(! authenticate(inet_ntoa(in.sin_addr))) { |
448 |
|
goto error; |
449 |
|
} |
450 |
|
|
451 |
|
|
452 |
return socket_create_a(client, inet_ntoa(in.sin_addr), port, sslserver); |
return socket_create_a(client, inet_ntoa(in.sin_addr), port, sslserver); |
453 |
|
|
454 |
error: |
error: |
455 |
close_socket(client); |
close_socket(client); |
|
|
|
456 |
return NULL; |
return NULL; |
457 |
|
|
458 |
} |
} |