Skip to content

Commit

Permalink
nghttp2: convert to debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 9, 2024
1 parent 20fd1c4 commit f3a5fb5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/modules/nghttp2/nghttp2_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static void delete_http2_session_data(http2_session_data *session_data)
{
http2_stream_data *stream_data;
SSL *ssl = bufferevent_openssl_get_ssl(session_data->bev);
fprintf(stderr, "%s disconnected\n", session_data->client_addr);
LM_ERR("%s disconnected\n", session_data->client_addr);
if(ssl) {
SSL_shutdown(ssl);
}
Expand Down Expand Up @@ -517,8 +517,7 @@ static int on_request_recv(nghttp2_session *session,
}
return 0;
}
fprintf(stderr, "%s GET %s\n", session_data->client_addr,
stream_data->request_path);
LM_DBG("%s GET %s\n", session_data->client_addr, stream_data->request_path);
if(!check_path(stream_data->request_path)) {
if(error_reply(session, stream_data) != 0) {
return NGHTTP2_ERR_CALLBACK_FAILURE;
Expand Down Expand Up @@ -676,7 +675,7 @@ static void eventcb(struct bufferevent *bev, short events, void *ptr)
SSL *ssl;
(void)bev;

fprintf(stderr, "%s connected\n", session_data->client_addr);
LM_DBG("%s connected\n", session_data->client_addr);

ssl = bufferevent_openssl_get_ssl(session_data->bev);

Expand All @@ -690,8 +689,7 @@ static void eventcb(struct bufferevent *bev, short events, void *ptr)
#endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */

if(alpn == NULL || alpnlen != 2 || memcmp("h2", alpn, 2) != 0) {
fprintf(stderr, "%s h2 is not negotiated\n",
session_data->client_addr);
LM_DBG("%s h2 is not negotiated\n", session_data->client_addr);
delete_http2_session_data(session_data);
return;
}
Expand All @@ -707,11 +705,11 @@ static void eventcb(struct bufferevent *bev, short events, void *ptr)
return;
}
if(events & BEV_EVENT_EOF) {
fprintf(stderr, "%s EOF\n", session_data->client_addr);
LM_DBG("%s EOF\n", session_data->client_addr);
} else if(events & BEV_EVENT_ERROR) {
fprintf(stderr, "%s network error\n", session_data->client_addr);
LM_DBG("%s network error\n", session_data->client_addr);
} else if(events & BEV_EVENT_TIMEOUT) {
fprintf(stderr, "%s timeout\n", session_data->client_addr);
LM_DBG("%s timeout\n", session_data->client_addr);
}
delete_http2_session_data(session_data);
}
Expand Down

0 comments on commit f3a5fb5

Please sign in to comment.