Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Unified Diff: net/tools/quic/quic_default_packet_writer.cc

Issue 127633002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_default_packet_writer.cc
diff --git a/net/tools/quic/quic_default_packet_writer.cc b/net/tools/quic/quic_default_packet_writer.cc
index 9d3e30831c1c8c19e4f5b8936e32b82de56aa025..6d77c00a9f565a7f37209ef7f1590e1edc53bdab 100644
--- a/net/tools/quic/quic_default_packet_writer.cc
+++ b/net/tools/quic/quic_default_packet_writer.cc
@@ -9,7 +9,9 @@
namespace net {
namespace tools {
-QuicDefaultPacketWriter::QuicDefaultPacketWriter(int fd) : fd_(fd) {}
+QuicDefaultPacketWriter::QuicDefaultPacketWriter(int fd)
+ : fd_(fd),
+ write_blocked_(false) {}
QuicDefaultPacketWriter::~QuicDefaultPacketWriter() {}
@@ -18,13 +20,26 @@ WriteResult QuicDefaultPacketWriter::WritePacket(
const net::IPAddressNumber& self_address,
const net::IPEndPoint& peer_address,
QuicBlockedWriterInterface* blocked_writer) {
- return QuicSocketUtils::WritePacket(fd_, buffer, buf_len,
- self_address, peer_address);
+ DCHECK(!IsWriteBlocked());
+ WriteResult result = QuicSocketUtils::WritePacket(
+ fd_, buffer, buf_len, self_address, peer_address);
+ if (result.status == WRITE_STATUS_BLOCKED) {
+ write_blocked_ = true;
+ }
+ return result;
}
bool QuicDefaultPacketWriter::IsWriteBlockedDataBuffered() const {
return false;
}
+bool QuicDefaultPacketWriter::IsWriteBlocked() const {
+ return write_blocked_;
+}
+
+void QuicDefaultPacketWriter::SetWritable() {
+ write_blocked_ = false;
+}
+
} // namespace tools
} // namespace net
« no previous file with comments | « net/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698