From fe46b1d19de9f4f0d4fe7d9006a36b0ecfc2162d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 4 Sep 2022 16:24:10 +0200 Subject: [PATCH] src: rename misleading arg in ClientHelloParser Despite being named onend_arg, the pointer is passed both to the onend_cb and to the onhello_cb. Rename it to cb_arg, which matches the name of the class field cb_arg_. PR-URL: https://github.com/nodejs/node/pull/44500 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Darshan Sen --- src/crypto/crypto_clienthello-inl.h | 4 ++-- src/crypto/crypto_clienthello.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto/crypto_clienthello-inl.h b/src/crypto/crypto_clienthello-inl.h index 4f133e83832d1e..1b8a0c00c3074d 100644 --- a/src/crypto/crypto_clienthello-inl.h +++ b/src/crypto/crypto_clienthello-inl.h @@ -51,7 +51,7 @@ inline void ClientHelloParser::Reset() { inline void ClientHelloParser::Start(ClientHelloParser::OnHelloCb onhello_cb, ClientHelloParser::OnEndCb onend_cb, - void* onend_arg) { + void* cb_arg) { if (!IsEnded()) return; Reset(); @@ -61,7 +61,7 @@ inline void ClientHelloParser::Start(ClientHelloParser::OnHelloCb onhello_cb, state_ = kWaiting; onhello_cb_ = onhello_cb; onend_cb_ = onend_cb; - cb_arg_ = onend_arg; + cb_arg_ = cb_arg; } inline void ClientHelloParser::End() { diff --git a/src/crypto/crypto_clienthello.h b/src/crypto/crypto_clienthello.h index 0d3bf60f96bc69..3af08bc6475ecf 100644 --- a/src/crypto/crypto_clienthello.h +++ b/src/crypto/crypto_clienthello.h @@ -66,7 +66,7 @@ class ClientHelloParser { void Parse(const uint8_t* data, size_t avail); inline void Reset(); - inline void Start(OnHelloCb onhello_cb, OnEndCb onend_cb, void* onend_arg); + inline void Start(OnHelloCb onhello_cb, OnEndCb onend_cb, void* cb_arg); inline void End(); inline bool IsPaused() const; inline bool IsEnded() const;