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

Side by Side Diff: net/tools/quic/quic_client.cc

Issue 131743009: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use size_t instead of int to fix win_x64 compile error 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_client_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 if (connected() && (event->in_events & EPOLLOUT)) { 241 if (connected() && (event->in_events & EPOLLOUT)) {
242 session_->connection()->OnCanWrite(); 242 session_->connection()->OnCanWrite();
243 } 243 }
244 if (event->in_events & EPOLLERR) { 244 if (event->in_events & EPOLLERR) {
245 DLOG(INFO) << "Epollerr"; 245 DLOG(INFO) << "Epollerr";
246 } 246 }
247 } 247 }
248 248
249 void QuicClient::OnClose(QuicDataStream* stream) { 249 void QuicClient::OnClose(QuicDataStream* stream) {
250 QuicSpdyClientStream* client_stream =
251 static_cast<QuicSpdyClientStream*>(stream);
252 if (response_listener_.get() != NULL) {
253 response_listener_->OnCompleteResponse(
254 stream->id(), client_stream->headers(), client_stream->data());
255 }
256
250 if (!print_response_) { 257 if (!print_response_) {
251 return; 258 return;
252 } 259 }
253 260
254 QuicSpdyClientStream* client_stream =
255 static_cast<QuicSpdyClientStream*>(stream);
256 const BalsaHeaders& headers = client_stream->headers(); 261 const BalsaHeaders& headers = client_stream->headers();
257 printf("%s\n", headers.first_line().as_string().c_str()); 262 printf("%s\n", headers.first_line().as_string().c_str());
258 for (BalsaHeaders::const_header_lines_iterator i = 263 for (BalsaHeaders::const_header_lines_iterator i =
259 headers.header_lines_begin(); 264 headers.header_lines_begin();
260 i != headers.header_lines_end(); ++i) { 265 i != headers.header_lines_end(); ++i) {
261 printf("%s: %s\n", i->first.as_string().c_str(), 266 printf("%s: %s\n", i->first.as_string().c_str(),
262 i->second.as_string().c_str()); 267 i->second.as_string().c_str());
263 } 268 }
264 printf("%s\n", client_stream->data().c_str()); 269 printf("%s\n", client_stream->data().c_str());
265 } 270 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 QuicEncryptedPacket packet(buf, bytes_read, false); 312 QuicEncryptedPacket packet(buf, bytes_read, false);
308 313
309 IPEndPoint client_address(client_ip, client_address_.port()); 314 IPEndPoint client_address(client_ip, client_address_.port());
310 session_->connection()->ProcessUdpPacket( 315 session_->connection()->ProcessUdpPacket(
311 client_address, server_address, packet); 316 client_address, server_address, packet);
312 return true; 317 return true;
313 } 318 }
314 319
315 } // namespace tools 320 } // namespace tools
316 } // namespace net 321 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | net/tools/quic/quic_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698