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

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

Issue 1810103002: Always use recvmmsg or recvmsg if it's available, and consolidate ReadAndDispatchPackets and ReadAn… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116987771
Patch Set: Created 4 years, 9 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_client.h ('k') | net/tools/quic/quic_packet_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client.cc
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc
index 04b7d2f50352c0a17c11b1a595892954cbf5162f..ef1c1b8f163c51439ed8828cd965814f3fb89ac8 100644
--- a/net/tools/quic/quic_client.cc
+++ b/net/tools/quic/quic_client.cc
@@ -74,7 +74,6 @@ QuicClient::QuicClient(IPEndPoint server_address,
initialized_(false),
packets_dropped_(0),
overflow_supported_(false),
- use_recvmmsg_(false),
store_response_(false),
latest_response_code_(-1),
packet_reader_(new QuicPacketReader()) {}
@@ -94,10 +93,6 @@ QuicClient::~QuicClient() {
bool QuicClient::Initialize() {
QuicClientBase::Initialize();
-#if MMSG_MORE
- use_recvmmsg_ = true;
-#endif
-
set_num_sent_client_hellos(0);
set_num_stateless_rejects_received(0);
set_connection_error(QUIC_NO_ERROR);
@@ -396,15 +391,9 @@ void QuicClient::OnEvent(int fd, EpollEvent* event) {
if (event->in_events & EPOLLIN) {
bool more_to_read = true;
while (connected() && more_to_read) {
- if (use_recvmmsg_) {
- more_to_read = packet_reader_->ReadAndDispatchPackets(
- GetLatestFD(), QuicClient::GetLatestClientAddress().port(), this,
- overflow_supported_ ? &packets_dropped_ : nullptr);
- } else {
- more_to_read = QuicPacketReader::ReadAndDispatchSinglePacket(
- GetLatestFD(), QuicClient::GetLatestClientAddress().port(), this,
- overflow_supported_ ? &packets_dropped_ : nullptr);
- }
+ more_to_read = packet_reader_->ReadAndDispatchPackets(
+ GetLatestFD(), QuicClient::GetLatestClientAddress().port(), this,
+ overflow_supported_ ? &packets_dropped_ : nullptr);
}
}
if (connected() && (event->in_events & EPOLLOUT)) {
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_packet_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698