nghttpx: Make it simple to calculate length

This commit is contained in:
Tatsuhiro Tsujikawa 2016-10-03 22:07:18 +09:00
parent dba0d2791c
commit 8c1e155f44
1 changed files with 2 additions and 1 deletions

View File

@ -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};