OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/tools/quic/quic_client.h" | 5 #include "net/tools/quic/quic_client.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <netinet/in.h> | 8 #include <netinet/in.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/epoll.h> | 10 #include <sys/epoll.h> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 155 } |
156 | 156 |
157 void QuicClient::OnEvent(int fd, EpollEvent* event) { | 157 void QuicClient::OnEvent(int fd, EpollEvent* event) { |
158 DCHECK_EQ(fd, GetLatestFD()); | 158 DCHECK_EQ(fd, GetLatestFD()); |
159 | 159 |
160 if (event->in_events & EPOLLIN) { | 160 if (event->in_events & EPOLLIN) { |
161 bool more_to_read = true; | 161 bool more_to_read = true; |
162 while (connected() && more_to_read) { | 162 while (connected() && more_to_read) { |
163 more_to_read = packet_reader_->ReadAndDispatchPackets( | 163 more_to_read = packet_reader_->ReadAndDispatchPackets( |
164 GetLatestFD(), QuicClient::GetLatestClientAddress().port(), | 164 GetLatestFD(), QuicClient::GetLatestClientAddress().port(), |
165 false /* potentially_small_mtu */, *helper()->GetClock(), this, | 165 *helper()->GetClock(), this, |
166 overflow_supported_ ? &packets_dropped_ : nullptr); | 166 overflow_supported_ ? &packets_dropped_ : nullptr); |
167 } | 167 } |
168 } | 168 } |
169 if (connected() && (event->in_events & EPOLLOUT)) { | 169 if (connected() && (event->in_events & EPOLLOUT)) { |
170 writer()->SetWritable(); | 170 writer()->SetWritable(); |
171 session()->connection()->OnCanWrite(); | 171 session()->connection()->OnCanWrite(); |
172 } | 172 } |
173 if (event->in_events & EPOLLERR) { | 173 if (event->in_events & EPOLLERR) { |
174 DVLOG(1) << "Epollerr"; | 174 DVLOG(1) << "Epollerr"; |
175 } | 175 } |
(...skipping 19 matching lines...) Expand all Loading... |
195 return fd_address_map_.back().first; | 195 return fd_address_map_.back().first; |
196 } | 196 } |
197 | 197 |
198 void QuicClient::ProcessPacket(const IPEndPoint& self_address, | 198 void QuicClient::ProcessPacket(const IPEndPoint& self_address, |
199 const IPEndPoint& peer_address, | 199 const IPEndPoint& peer_address, |
200 const QuicReceivedPacket& packet) { | 200 const QuicReceivedPacket& packet) { |
201 session()->ProcessUdpPacket(self_address, peer_address, packet); | 201 session()->ProcessUdpPacket(self_address, peer_address, packet); |
202 } | 202 } |
203 | 203 |
204 } // namespace net | 204 } // namespace net |
OLD | NEW |