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

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

Issue 994193002: Compile quic_server on MacOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undefine __APPLE_USE_RFC_n after use Created 5 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 unified diff | Download patch
« no previous file with comments | « net/net.gyp ('k') | net/tools/quic/quic_socket_utils.cc » ('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/socket.h> 10 #include <sys/socket.h>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 QuicClient::DummyPacketWriterFactory::~DummyPacketWriterFactory() {} 113 QuicClient::DummyPacketWriterFactory::~DummyPacketWriterFactory() {}
114 114
115 QuicPacketWriter* QuicClient::DummyPacketWriterFactory::Create( 115 QuicPacketWriter* QuicClient::DummyPacketWriterFactory::Create(
116 QuicConnection* /*connection*/) const { 116 QuicConnection* /*connection*/) const {
117 return writer_; 117 return writer_;
118 } 118 }
119 119
120 120
121 bool QuicClient::CreateUDPSocket() { 121 bool QuicClient::CreateUDPSocket() {
122 int address_family = server_address_.GetSockAddrFamily(); 122 int address_family = server_address_.GetSockAddrFamily();
123 fd_ = socket(address_family, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP); 123 fd_ = QuicSocketUtils::CreateNonBlockingSocket(address_family, SOCK_DGRAM,
124 IPPROTO_UDP);
124 if (fd_ < 0) { 125 if (fd_ < 0) {
125 LOG(ERROR) << "CreateSocket() failed: " << strerror(errno); 126 return false; // failure already logged
126 return false;
127 } 127 }
128 128
129 int get_overflow = 1; 129 int get_overflow = 1;
130 int rc = setsockopt(fd_, SOL_SOCKET, SO_RXQ_OVFL, &get_overflow, 130 int rc = setsockopt(fd_, SOL_SOCKET, SO_RXQ_OVFL, &get_overflow,
131 sizeof(get_overflow)); 131 sizeof(get_overflow));
132 if (rc < 0) { 132 if (rc < 0) {
133 DLOG(WARNING) << "Socket overflow detection not supported"; 133 DLOG(WARNING) << "Socket overflow detection not supported";
134 } else { 134 } else {
135 overflow_supported_ = true; 135 overflow_supported_ = true;
136 } 136 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 QuicEncryptedPacket packet(buf, bytes_read, false); 400 QuicEncryptedPacket packet(buf, bytes_read, false);
401 401
402 IPEndPoint client_address(client_ip, client_address_.port()); 402 IPEndPoint client_address(client_ip, client_address_.port());
403 session_->connection()->ProcessUdpPacket( 403 session_->connection()->ProcessUdpPacket(
404 client_address, server_address, packet); 404 client_address, server_address, packet);
405 return true; 405 return true;
406 } 406 }
407 407
408 } // namespace tools 408 } // namespace tools
409 } // namespace net 409 } // namespace net
OLDNEW
« no previous file with comments | « net/net.gyp ('k') | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698