Add logging for Settings frame transportation.
gfe-relnote: no behavior change and v99 only.
PiperOrigin-RevId: 255506334
Change-Id: I65f8ee9cf102f40e00307c6437d790d33bd0dbf3
diff --git a/quic/core/http/http_frames.h b/quic/core/http/http_frames.h
index ff59614..cf282ee 100644
--- a/quic/core/http/http_frames.h
+++ b/quic/core/http/http_frames.h
@@ -6,9 +6,12 @@
#define QUICHE_QUIC_CORE_HTTP_HTTP_FRAMES_H_
#include <map>
+#include <ostream>
#include "net/third_party/quiche/src/quic/core/quic_types.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_string_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
@@ -98,6 +101,21 @@
bool operator==(const SettingsFrame& rhs) const {
return values == rhs.values;
}
+
+ std::string ToString() const {
+ std::string s;
+ for (auto it : values) {
+ std::string setting =
+ QuicStrCat("[id->", it.first, " | value->", it.second, "] ");
+ QuicStrAppend(&s, setting);
+ }
+ return s;
+ }
+ friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
+ const SettingsFrame& s) {
+ os << s.ToString();
+ return os;
+ }
};
// 4.2.6. PUSH_PROMISE
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc
index 9e166e0..85585bd 100644
--- a/quic/core/http/quic_receive_control_stream.cc
+++ b/quic/core/http/quic_receive_control_stream.cc
@@ -163,6 +163,8 @@
}
bool QuicReceiveControlStream::OnSettingsFrame(const SettingsFrame& settings) {
+ QUIC_DVLOG(1) << "Control Stream " << id()
+ << " received settings frame: " << settings;
QuicSpdySession* spdy_session = static_cast<QuicSpdySession*>(session());
for (auto& it : settings.values) {
uint64_t setting_id = it.first;
diff --git a/quic/core/http/quic_send_control_stream.cc b/quic/core/http/quic_send_control_stream.cc
index 941c6c0..f5f34f1 100644
--- a/quic/core/http/quic_send_control_stream.cc
+++ b/quic/core/http/quic_send_control_stream.cc
@@ -36,6 +36,8 @@
std::unique_ptr<char[]> buffer;
QuicByteCount frame_length =
encoder_.SerializeSettingsFrame(settings, &buffer);
+ QUIC_DVLOG(1) << "Control stream " << id() << " is writing settings frame "
+ << settings;
WriteOrBufferData(QuicStringPiece(buffer.get(), frame_length),
/*fin = */ false, nullptr);
settings_sent_ = true;