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_server.h" | 5 #include "net/tools/quic/quic_server.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <features.h> | 8 #include <features.h> |
9 #include <netinet/in.h> | 9 #include <netinet/in.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 if (event->in_events & EPOLLIN) { | 163 if (event->in_events & EPOLLIN) { |
164 LOG(ERROR) << "EPOLLIN"; | 164 LOG(ERROR) << "EPOLLIN"; |
165 bool read = true; | 165 bool read = true; |
166 while (read) { | 166 while (read) { |
167 read = ReadAndDispatchSinglePacket( | 167 read = ReadAndDispatchSinglePacket( |
168 fd_, port_, dispatcher_.get(), | 168 fd_, port_, dispatcher_.get(), |
169 overflow_supported_ ? &packets_dropped_ : NULL); | 169 overflow_supported_ ? &packets_dropped_ : NULL); |
170 } | 170 } |
171 } | 171 } |
172 if (event->in_events & EPOLLOUT) { | 172 if (event->in_events & EPOLLOUT) { |
| 173 LOG(INFO) << "Epollout"; |
173 bool can_write_more = dispatcher_->OnCanWrite(); | 174 bool can_write_more = dispatcher_->OnCanWrite(); |
174 if (can_write_more) { | 175 if (can_write_more) { |
175 event->out_ready_mask |= EPOLLOUT; | 176 event->out_ready_mask |= EPOLLOUT; |
176 } | 177 } |
177 } | 178 } |
178 if (event->in_events & EPOLLERR) { | 179 if (event->in_events & EPOLLERR) { |
| 180 LOG(INFO) << "Epollerr"; |
179 } | 181 } |
180 } | 182 } |
181 | 183 |
182 bool QuicServer::ReadAndDispatchSinglePacket(int fd, | 184 bool QuicServer::ReadAndDispatchSinglePacket(int fd, |
183 int port, | 185 int port, |
184 QuicDispatcher* dispatcher, | 186 QuicDispatcher* dispatcher, |
185 int* packets_dropped) { | 187 int* packets_dropped) { |
186 // Allocate some extra space so we can send an error if the client goes over | 188 // Allocate some extra space so we can send an error if the client goes over |
187 // the limit. | 189 // the limit. |
188 char buf[2 * kMaxPacketSize]; | 190 char buf[2 * kMaxPacketSize]; |
(...skipping 22 matching lines...) Expand all Loading... |
211 } | 213 } |
212 | 214 |
213 IPEndPoint server_address(server_ip, port); | 215 IPEndPoint server_address(server_ip, port); |
214 dispatcher->ProcessPacket(server_address, client_address, guid, packet); | 216 dispatcher->ProcessPacket(server_address, client_address, guid, packet); |
215 | 217 |
216 return true; | 218 return true; |
217 } | 219 } |
218 | 220 |
219 } // namespace tools | 221 } // namespace tools |
220 } // namespace net | 222 } // namespace net |
OLD | NEW |