From 8c1e155f44d5238eaee373a0d794f1d511a6d122 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 3 Oct 2016 22:07:18 +0900 Subject: [PATCH] nghttpx: Make it simple to calculate length --- src/shrpx_client_handler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 1948faad..01044d43 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -423,7 +423,8 @@ ClientHandler::ClientHandler(Worker *worker, int fd, SSL *ssl, auto buf = make_byte_ref(balloc_, len + 1); auto p = buf.base; *p++ = '_'; - p = util::random_alpha_digit(p, p + len - 1, worker_->get_randgen()); + p = util::random_alpha_digit(p, p + SHRPX_OBFUSCATED_NODE_LENGTH, + worker_->get_randgen()); *p = '\0'; forwarded_for_ = StringRef{buf.base, p};