Project

General

Profile

Actions

Feature #652

closed

Log remote IP for message "request timed out after writing..."

Added by chernousov over 18 years ago. Updated almost 9 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

Something like this would be very useful:

in server.c


xHome src # svn diff server.c
Index: server.c
===================================================================
--- server.c    (revision 1126)
+++ server.c    (working copy)
@@ -1144,7 +1144,8 @@
                                                if (srv->cur_ts - con->write_request_ts > con->conf.max_write_idle) {
                                                        /* time - out */
 #if 1
-                                                       log_error_write(srv, __FILE__, __LINE__, "sbsosds",
+                                                       log_error_write(srv, __FILE__, __LINE__, "ssbsosds",
+                                                                       inet_ntop_cache_get_ip(srv, &(con->dst_addr)),
                                                                        "NOTE: a request for",
                                                                        con->request.uri,
                                                                        "timed out after writing",
Actions #1

Updated by gstrauss almost 9 years ago

Trivial patch

diff --git a/src/server.c b/src/server.c
index 26ecbcc..39a8407 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1343,8 +1343,10 @@ int main (int argc, char **argv) {
                                                if (srv->cur_ts - con->write_request_ts > con->conf.max_write_idle) {
                                                        /* time - out */
                                                        if (con->conf.log_timeouts) {
-                                                               log_error_write(srv, __FILE__, __LINE__, "sbsosds",
-                                                                       "NOTE: a request for",
+                                                               log_error_write(srv, __FILE__, __LINE__, "sbsbsosds",
+                                                                       "NOTE: a request from",
+                                                                       con->dst_addr_buf,
+                                                                       "for",
                                                                        con->request.uri,
                                                                        "timed out after writing",
                                                                        con->bytes_written,

Actions #2

Updated by stbuehler almost 9 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r3109.

Actions

Also available in: Atom