Skip to content

Commit

Permalink
src: rename misleading arg in ClientHelloParser
Browse files Browse the repository at this point in the history
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: #44500
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
tniessen authored and juanarbol committed Oct 11, 2022
1 parent 9a52ee7 commit 49cf345
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/crypto/crypto_clienthello-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_clienthello.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 49cf345

Please sign in to comment.