summaryrefslogtreecommitdiffstats
path: root/web/server/h2o
diff options
context:
space:
mode:
Diffstat (limited to 'web/server/h2o')
-rw-r--r--web/server/h2o/http_server.c4
-rw-r--r--web/server/h2o/streaming.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/web/server/h2o/http_server.c b/web/server/h2o/http_server.c
index 6980db2737..08ad120b14 100644
--- a/web/server/h2o/http_server.c
+++ b/web/server/h2o/http_server.c
@@ -272,7 +272,7 @@ static int netdata_uberhandler(h2o_handler_t *self, h2o_req_t *req)
if (host != NULL)
uuid_unparse_lower(host->host_uuid, host_uuid_str);
- netdata_log_access("HTTPD OK method: " PRINTF_H2O_IOVEC_FMT
+ nd_log(NDLS_ACCESS, NDLP_DEBUG, "HTTPD OK method: " PRINTF_H2O_IOVEC_FMT
", path: " PRINTF_H2O_IOVEC_FMT
", as host: %s"
", response: %d",
@@ -281,7 +281,7 @@ static int netdata_uberhandler(h2o_handler_t *self, h2o_req_t *req)
host == NULL ? "unknown" : (localhost ? "localhost" : host_uuid_str),
req->res.status);
} else {
- netdata_log_access("HTTPD %d"
+ nd_log(NDLS_ACCESS, NDLP_DEBUG, "HTTPD %d"
" method: " PRINTF_H2O_IOVEC_FMT
", path: " PRINTF_H2O_IOVEC_FMT
", forwarding to file handler as path: " PRINTF_H2O_IOVEC_FMT,
diff --git a/web/server/h2o/streaming.c b/web/server/h2o/streaming.c
index d7c9a564a5..063e487afc 100644
--- a/web/server/h2o/streaming.c
+++ b/web/server/h2o/streaming.c
@@ -294,8 +294,9 @@ void stream_process(h2o_stream_conn_t *conn, int initial)
socklen_t len = h2o_socket_getpeername(conn->sock, &client);
char peername[NI_MAXHOST];
size_t peername_len = h2o_socket_getnumerichost(&client, len, peername);
- memcpy(w.client_ip, peername, peername_len);
- w.client_ip[peername_len] = 0;
+ size_t cpy_len = sizeof(w.client_ip) < peername_len ? sizeof(w.client_ip) : peername_len;
+ memcpy(w.client_ip, peername, cpy_len);
+ w.client_ip[cpy_len - 1] = 0;
w.user_agent = conn->user_agent;
rc = rrdpush_receiver_thread_spawn(&w, conn->url, conn);