Log IP address instead of file descriptor.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 15 Apr 2013 22:37:31 +0000 (00:37 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 15 Apr 2013 22:37:31 +0000 (00:37 +0200)
server.cpp

index 46bda5b..3d915c2 100644 (file)
@@ -268,7 +268,7 @@ read_request_again:
        
                switch (status) {
                case RP_OUT_OF_SPACE:
-                       log(WARNING, "fd %d sent overlong request!", client->sock);
+                       log(WARNING, "[%s] Client sent overlong request!", client->remote_addr.c_str());
                        close_client(client);
                        return;
                case RP_NOT_FINISHED_YET:
@@ -276,7 +276,7 @@ read_request_again:
                        // See if there's more data for us.
                        goto read_request_again;
                case RP_EXTRA_DATA:
-                       log(WARNING, "fd %d had junk data after request!", client->sock);
+                       log(WARNING, "[%s] Junk data after request!", client->remote_addr.c_str());
                        close_client(client);
                        return;
                case RP_FINISHED:
@@ -357,8 +357,8 @@ sending_data_again:
                        return;
                }
                if (bytes_to_send > stream->backlog_size) {
-                       log(WARNING, "fd %d lost %lld bytes, maybe too slow connection",
-                               client->sock,
+                       log(WARNING, "[%s] Client lost %lld bytes, maybe too slow connection",
+                               client->remote_addr.c_str(),
                                (long long int)(bytes_to_send - stream->backlog_size));
                        client->stream_pos = stream->bytes_received - stream->backlog_size;
                        client->bytes_lost += bytes_to_send - stream->backlog_size;