Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 58c73d1

Browse files
committed
quic: use ToString in prep for FPrintF
PR-URL: #294 Reviewed-By: Anna Henningsen <[email protected]>
1 parent 3982f88 commit 58c73d1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/quic/node_quic_socket-inl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ void QuicSocket::AssociateCID(
6666

6767
void QuicSocket::DisassociateCID(const QuicCID& cid) {
6868
if (cid) {
69-
Debug(this, "Removing association for cid %s", cid.ToHex().c_str());
69+
Debug(this, "Removing association for cid %s", cid.ToString().c_str());
7070
dcid_to_scid_.erase(cid);
7171
}
7272
}
7373

7474
void QuicSocket::AssociateStatelessResetToken(
7575
const StatelessResetToken& token,
7676
BaseObjectPtr<QuicSession> session) {
77-
Debug(this, "Associating stateless reset token %s", token.ToHex().c_str());
77+
Debug(this, "Associating stateless reset token %s", token.ToString().c_str());
7878
token_map_[token] = session;
7979
}
8080

8181
void QuicSocket::DisassociateStatelessResetToken(
8282
const StatelessResetToken& token) {
83-
Debug(this, "Removing stateless reset token %s", token.ToHex().c_str());
83+
Debug(this, "Removing stateless reset token %s", token.ToString().c_str());
8484
token_map_.erase(token);
8585
}
8686

src/quic/node_quic_socket.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ void QuicSocket::OnReceive(
490490
// allow us to pass the QuicCID directly to Debug and have it
491491
// converted to hex only if the category is enabled so we can
492492
// skip committing resources here.
493-
std::string dcid_hex = dcid.ToHex();
493+
std::string dcid_hex = dcid.ToString();
494494
Debug(this, "Received a QUIC packet for dcid %s", dcid_hex.c_str());
495495

496496
BaseObjectPtr<QuicSession> session = FindSession(dcid);

src/quic/node_quic_util-inl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bool QuicCID::Compare::operator()(
4747
false : memcmp(lcid->data, rcid->data, lcid->datalen) == 0;
4848
}
4949

50-
std::string QuicCID::ToHex() const {
50+
std::string QuicCID::ToString() const {
5151
std::vector<char> dest(ptr_->datalen * 2 + 1);
5252
dest[dest.size() - 1] = '\0';
5353
size_t written = StringBytes::hex_encode(
@@ -288,7 +288,7 @@ StatelessResetToken::StatelessResetToken(
288288
GenerateResetToken(buf_, secret, cid);
289289
}
290290

291-
std::string StatelessResetToken::ToHex() const {
291+
std::string StatelessResetToken::ToString() const {
292292
std::vector<char> dest(NGTCP2_STATELESS_RESET_TOKENLEN * 2 + 1);
293293
dest[dest.size() - 1] = '\0';
294294
size_t written = StringBytes::hex_encode(

src/quic/node_quic_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class QuicCID : public MemoryRetainer {
224224
inline bool operator()(const QuicCID& lcid, const QuicCID& rcid) const;
225225
};
226226

227-
inline std::string ToHex() const;
227+
inline std::string ToString() const;
228228

229229
// Copy assignment
230230
QuicCID& operator=(const QuicCID& cid) {
@@ -307,7 +307,7 @@ class StatelessResetToken : public MemoryRetainer {
307307
const uint8_t* token)
308308
: token_(token) {}
309309

310-
inline std::string ToHex() const;
310+
inline std::string ToString() const;
311311
const uint8_t* data() const { return token_; }
312312

313313
struct Hash {

0 commit comments

Comments
 (0)