Welcome! Log In Create A New Profile

Advanced

stream: sub variable len after output log to the buf

Duan Jiong
August 12, 2015 10:18PM
# HG changeset patch
# User Duan Jiong <djduanjiong@gmail.com>
# Date 1439431265 -28800
# Thu Aug 13 10:01:05 2015 +0800
# Node ID 1c518d211b6b1acbd3a951218d948bd5ee4bec41
# Parent 1bd5eb20bd7c25f6cff96190d3ec048e3f3ebeec
stream: sub variable len after output log to the buf

Otherwise, the log before will be overwrote.

diff -r 1bd5eb20bd7c -r 1c518d211b6b src/stream/ngx_stream_handler.c
--- a/src/stream/ngx_stream_handler.c Wed Aug 12 12:56:59 2015 +0300
+++ b/src/stream/ngx_stream_handler.c Thu Aug 13 10:01:05 2015 +0800
@@ -328,6 +328,7 @@
p = ngx_snprintf(buf, len, ", client: %V, server: %V",
&s->connection->addr_text,
&s->connection->listening->addr_text);
+ len -= p - buf;

if (s->log_handler) {
return s->log_handler(log, p, len);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

stream: sub variable len after output log to the buf

Duan Jiong 494 August 12, 2015 10:18PM

Re: stream: sub variable len after output log to the buf

Vladimir Homutov 241 August 13, 2015 10:12AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready