Skip to content

Commit

Permalink
asiegel/explorer-fixes-2: reverted http change
Browse files Browse the repository at this point in the history
  • Loading branch information
asiegel-jt authored and jumpsiegel committed Sep 18, 2024
1 parent 0d8194b commit 542b0bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
14 changes: 2 additions & 12 deletions src/ballet/http/fd_http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ close_conn( fd_http_server_t * http,
#ifdef FD_HTTP_SERVER_DEBUG
FD_LOG_NOTICE(( "Closing connection %lu (fd=%d) (%d-%s)", conn_idx, http->pollfds[ conn_idx ].fd, reason, fd_http_server_connection_close_reason_str( reason ) ));
#endif
if( !http->conns[ conn_idx ].keep_alive ) {
if( FD_UNLIKELY( -1==close( http->pollfds[ conn_idx ].fd ) ) ) FD_LOG_ERR(( "close failed (%i-%s)", errno, strerror( errno ) ));
}
if( FD_UNLIKELY( -1==close( http->pollfds[ conn_idx ].fd ) ) ) FD_LOG_ERR(( "close failed (%i-%s)", errno, strerror( errno ) ));
http->pollfds[ conn_idx ].fd = -1;
if( FD_LIKELY( conn_idx<http->max_conns ) ) {
if( FD_LIKELY( http->callbacks.close ) ) http->callbacks.close( conn_idx, reason, http->callback_ctx );
Expand All @@ -259,7 +257,7 @@ fd_http_server_ws_close( fd_http_server_t * http,
should be closed. Any errors from an accept(2), read(2), or send(2)
that are not expected here will be considered fatal and terminate the
server. */

static inline int
is_expected_network_error( int err ) {
return
Expand Down Expand Up @@ -404,14 +402,6 @@ read_conn_http( fd_http_server_t * http,
}
}

conn->keep_alive = 0;
for( ulong i=0UL; i<num_headers; i++ ) {
if( FD_LIKELY( headers[ i ].name_len==10UL && !strncasecmp( headers[ i ].name, "Connection", 10UL ) ) ) {
conn->keep_alive = ( headers[ i ].value_len==10UL && !strncasecmp( headers[ i ].value, "keep-alive", 10UL ) );
break;
}
}

char content_type_nul_terminated[ 128 ] = {0};
for( ulong i=0UL; i<num_headers; i++ ) {
if( FD_LIKELY( headers[ i ].name_len==12UL && !strncasecmp( headers[ i ].name, "Content-Type", 12UL ) ) ) {
Expand Down
2 changes: 0 additions & 2 deletions src/ballet/http/fd_http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ struct fd_http_server_connection {
char * request_bytes;
ulong request_bytes_read;

int keep_alive;

fd_http_server_response_t response;
ulong response_bytes_written;

Expand Down

0 comments on commit 542b0bc

Please sign in to comment.