32 |
#endif |
#endif |
33 |
|
|
34 |
extern int ssl_params_refresh; |
extern int ssl_params_refresh; |
35 |
|
int hic_write_fd; /* fd to write to HIC thread */ |
36 |
|
|
37 |
/* globals */ |
/* globals */ |
38 |
int backlog = SO_MAXCONN; |
int backlog = SO_MAXCONN; |
44 |
/* static to boa.c */ |
/* static to boa.c */ |
45 |
static void fixup_server_root(void); |
static void fixup_server_root(void); |
46 |
static socket_type create_server_socket( int port, int); |
static socket_type create_server_socket( int port, int); |
47 |
|
static int hic_init(void); |
48 |
static void drop_privs(void); |
static void drop_privs(void); |
49 |
static server_params *smp_init(socket_type server_s[2]); |
static server_params *smp_init(socket_type server_s[2]); |
50 |
static int sock_opt = 1; |
static int sock_opt = 1; |
187 |
* by the children. |
* by the children. |
188 |
*/ |
*/ |
189 |
block_main_signals(); |
block_main_signals(); |
190 |
|
|
191 |
|
hic_write_fd = hic_init(); |
192 |
|
|
193 |
/* spawn the children pool |
/* spawn the children pool |
194 |
*/ |
*/ |
337 |
return; |
return; |
338 |
} |
} |
339 |
|
|
340 |
|
#ifdef ENABLE_HIC |
341 |
|
#define hic_max_threads 1 |
342 |
|
static int hic_fd[2]; |
343 |
|
|
344 |
|
/* This function will return a server_params pointer. This |
345 |
|
* pointer is to be used as a pointer to the select loop. |
346 |
|
*/ |
347 |
|
static int hic_init() |
348 |
|
{ |
349 |
|
//int *hic_fd[2]; |
350 |
|
|
351 |
|
#ifdef ENABLE_SMP |
352 |
|
pthread_t tid; |
353 |
|
|
354 |
|
if (pipe( hic_fd) == -1) { |
355 |
|
log_error_time(); |
356 |
|
fprintf(stderr, "Error in pipe() for hic_fd.\n"); |
357 |
|
exit(1); |
358 |
|
} |
359 |
|
|
360 |
|
// for( i=0;i<hic_max_threads;i++) { |
361 |
|
if (pthread_create( &tid, NULL, &hic_main_loop, (void*)hic_fd) != 0) |
362 |
|
{ |
363 |
|
log_error_time(); |
364 |
|
fprintf(stderr, |
365 |
|
"Could not dispatch hic thread.\n"); |
366 |
|
exit(1); |
367 |
|
} |
368 |
|
// } |
369 |
|
|
370 |
|
log_error_time(); |
371 |
|
fprintf(stderr, |
372 |
|
"Dispatched HIC main thread.\n"); |
373 |
|
|
374 |
|
|
375 |
|
#endif |
376 |
|
|
377 |
|
return hic_fd[1]; |
378 |
|
} |
379 |
|
|
380 |
|
#endif /* ENABLE_HIC */ |
381 |
|
|
382 |
static socket_type create_server_socket( int port, int secure) |
static socket_type create_server_socket( int port, int secure) |
383 |
{ |
{ |