|
|
|
@ -80,7 +80,7 @@ struct http_server* http_server_new( struct http_server_args* args, http_server_
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( -1 == listen( srv->sock, 0 ) ) {
|
|
|
|
|
if( -1 == listen( srv->sock, 10 ) ) {
|
|
|
|
|
printf( "Unable to listen on %s:%d: %s\n",
|
|
|
|
|
args->bind_address, args->bind_port, strerror(errno)
|
|
|
|
|
);
|
|
|
|
@ -117,11 +117,10 @@ void http_server_process( struct http_server* srv )
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Handle connection
|
|
|
|
|
//uint64_t time;
|
|
|
|
|
/*
|
|
|
|
|
//*
|
|
|
|
|
struct timespec ts;
|
|
|
|
|
clock_gettime( CLOCK_MONOTONIC, &ts );
|
|
|
|
|
time = (uint64_t)ts.tv_sec * 1000000000 + (uint64_t)ts.tv_nsec;
|
|
|
|
|
uint64_t time = (uint64_t)ts.tv_sec * 1000000000 + (uint64_t)ts.tv_nsec;
|
|
|
|
|
printf( "Accepting connection at %ld\n", time );
|
|
|
|
|
//*/
|
|
|
|
|
srv->active += 1;
|
|
|
|
@ -147,11 +146,11 @@ void http_server_process( struct http_server* srv )
|
|
|
|
|
http_request_process( req, &srv->context );
|
|
|
|
|
count += 1;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
//*
|
|
|
|
|
if( count > 0 ) {
|
|
|
|
|
printf( "Processed %d requests\n", count );
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
//*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void http_server_release( struct http_server* srv )
|
|
|
|
|