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

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

Issue 1640343002: relnote: moves ProcessPacketInterface from quic_dispatcher.h to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed usage of net/tools/quic/quic_packet_reader.h from quic_client.h Created 4 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_client.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_client.cc
diff --git a/net/tools/quic/quic_client.cc b/net/tools/quic/quic_client.cc
index 0f621398b69dcd5bd57560f598189d20c01f3d40..8fea17f92e8028ee3e79c4fc8524b225edb3f1dd 100644
--- a/net/tools/quic/quic_client.cc
+++ b/net/tools/quic/quic_client.cc
@@ -29,6 +29,9 @@
#define SO_RXQ_OVFL 40
#endif
+// TODO(rtenneti): Add support for MMSG_MORE.
+#define MMSG_MORE 0
+
using std::string;
using std::vector;
@@ -73,7 +76,8 @@ QuicClient::QuicClient(IPEndPoint server_address,
packets_dropped_(0),
overflow_supported_(false),
store_response_(false),
- latest_response_code_(-1) {}
+ latest_response_code_(-1),
+ packet_reader_(CreateQuicPacketReader()) {}
QuicClient::~QuicClient() {
if (connected()) {
@@ -392,7 +396,16 @@ void QuicClient::OnEvent(int fd, EpollEvent* event) {
DCHECK_EQ(fd, GetLatestFD());
if (event->in_events & EPOLLIN) {
- while (connected() && ReadAndProcessPacket()) {
+ while (connected()) {
+ if (
+#if MMSG_MORE
+ !ReadAndProcessPackets()
+#else
+ !ReadAndProcessPacket()
+#endif
+ ) {
+ break;
+ }
}
}
if (connected() && (event->in_events & EPOLLOUT)) {
@@ -450,6 +463,12 @@ QuicPacketWriter* QuicClient::CreateQuicPacketWriter() {
return new QuicDefaultPacketWriter(GetLatestFD());
}
+QuicPacketReader* QuicClient::CreateQuicPacketReader() {
+ // TODO(rtenneti): Add support for QuicPacketReader.
+ // return new QuicPacketReader();
+ return nullptr;
+}
+
int QuicClient::ReadPacket(char* buffer,
int buffer_len,
IPEndPoint* server_address,
@@ -508,5 +527,11 @@ int QuicClient::GetLatestFD() const {
return fd_address_map_.back().first;
}
+void QuicClient::ProcessPacket(const IPEndPoint& self_address,
+ const IPEndPoint& peer_address,
+ const QuicEncryptedPacket& packet) {
+ session()->connection()->ProcessUdpPacket(self_address, peer_address, packet);
+}
+
} // namespace tools
} // namespace net
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698