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