diff options
author | danzh <danzh@chromium.org> | 2016-03-04 13:58:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-04 22:00:06 +0000 |
commit | 33407f13bfd05bc2614fd063bcbc6ad38904ad24 (patch) | |
tree | aa9cbf53a28b2be8eae6b95fbe6beafe70b5715a /net/tools/quic/quic_socket_utils.cc | |
parent | 5906d7d07155203356125d21f34a349442cea5be (diff) | |
download | chromium_src-33407f13bfd05bc2614fd063bcbc6ad38904ad24.zip chromium_src-33407f13bfd05bc2614fd063bcbc6ad38904ad24.tar.gz chromium_src-33407f13bfd05bc2614fd063bcbc6ad38904ad24.tar.bz2 |
Landing recent QUIC changes until 7:19 PM, Feb 26, 2016 UTC-5.
relnote: Deprecate --FLAGS_quic_use_stream_sequencer_buffer.
Merge internal change: 115699221
https://codereview.chromium.org/1764913002/#ps20001
relnote: Deprecate --FLAGS_enable_quic_fec.
Disable the ability to enable FEC protection via connection options.
First change to remove FEC.
Merge internal change: 115690862
https://codereview.chromium.org/1766623002/#ps20001
relnote: Make QUIC version negotiation stateless. The QUIC dispatcher now detects version mismatch before creating a QUIC session and sends out a version negotiation packet at that point. Protected by --Flag_quic_stateless_version_negotiation
Merge internal change: 115603675
https://codereview.chromium.org/1761253002/#ps20001
relnote: Reserve exactly enough space for QUIC timestamps in QuicAckFrame. received_packet_times. No functional change.
Merge internal change: 115591435
https://codereview.chromium.org/1760973003/#ps20001
relnote: Remove single line virtual methods that are not overridden anywhere.
QUIC client change.
Merge internal change: 115591067
https://codereview.chromium.org/1761643004/#ps20001
relnote: QUIC toy client/server change
Replace custom client packet reading code with call to
QuicPacketReader::ReadAndDispatchSinglePacket
Merge internal change: 115551866
https://codereview.chromium.org/1760423002/#ps20001
relnote: Remove virtual keyword from QuicSpdyStream::WriteTrailers.
Merge internal change: 115456160
https://codereview.chromium.org/1745303003/#ps40001
relnote: Switch to unique_ptr<GURL> for request uri in SpdyBalsaUtils::RequestHeadersToSpdyHeaders(). No function change.
Merge internal change: 115455799
https://codereview.chromium.org/1749303002/#ps40001
relnote: QUIC toy client/server changes
Adds a QuicSocketUtils::CreateUDPSocket method, and rename the existing
client/server CreateUDPSocket methods to be a bit more descriptive.
Merge internal change: 115444705
https://codereview.chromium.org/1752823002/#ps40001
relnote: Remove an unused declaration of QuicAckNotifier.
Merge internal change: 115400573
https://codereview.chromium.org/1751923003/#ps40001
relnote: Added new method OnStreamEnd to SpdyFramerVisitorInterface, stubbed implementations, No functional change.
Added a new visitor interface method to the SpdyFramerVisitorInterface
with signature:
virtual void OnStreamEnd(SpdyStreamId stream_id) = 0;
Stubbed the new method in all implementors.
The eventual goal is to use the new method to handle stream ends
consistently, removing the need for fin boolean arguments in the other
methods in the visitor.
Merge internal change: 115370186
https://codereview.chromium.org/1749203002/#ps40001
relnote: Deprecate --FLAGS_quic_distinguish_incoming_outgoing_streams.
Merge internal change: 115342288
https://codereview.chromium.org/1755663002#ps60001
relnote: Remove unnecessary ReadPacket method.
Merge internal change: 115339832
https://codereview.chromium.org/1750303003/#ps60001
relnote: Deprecate --FLAGS_quic_supports_trailers
Merge internal change: 115244730
https://codereview.chromium.org/1753453003
relnote: Add 3 Quic e2e tests of server push. No behavior change.
Merge internal change: 115228444
https://codereview.chromium.org/1746803003
relnote: QuicSession::CreateIncomingDynamicStream now retains ownership of the created stream. No functional change.
Adds the ActivateStream call to CreateIncomingDynamicStream, which makes
it behave in a similar way to CreateOutgoingDynamicStream. Both methods
now retain ownership of the created stream (ActivateStream adds it to
the dynamic_stream_map_).
Merge internal change: 115218980
https://codereview.chromium.org/1744103003
Review URL: https://codereview.chromium.org/1761263002
Cr-Commit-Position: refs/heads/master@{#379375}
Diffstat (limited to 'net/tools/quic/quic_socket_utils.cc')
-rw-r--r-- | net/tools/quic/quic_socket_utils.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net/tools/quic/quic_socket_utils.cc b/net/tools/quic/quic_socket_utils.cc index 36c5fb4..42141df 100644 --- a/net/tools/quic/quic_socket_utils.cc +++ b/net/tools/quic/quic_socket_utils.cc @@ -223,4 +223,39 @@ WriteResult QuicSocketUtils::WritePacket(int fd, errno); } +// static +int QuicSocketUtils::CreateUDPSocket(const IPEndPoint& address, + bool* overflow_supported) { + int address_family = address.GetSockAddrFamily(); + int fd = socket(address_family, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP); + if (fd < 0) { + LOG(ERROR) << "socket() failed: " << strerror(errno); + return -1; + } + + int get_overflow = 1; + int rc = setsockopt(fd, SOL_SOCKET, SO_RXQ_OVFL, &get_overflow, + sizeof(get_overflow)); + if (rc < 0) { + DLOG(WARNING) << "Socket overflow detection not supported"; + } else { + *overflow_supported = true; + } + + if (!QuicSocketUtils::SetReceiveBufferSize(fd, kDefaultSocketReceiveBuffer)) { + return -1; + } + + if (!QuicSocketUtils::SetSendBufferSize(fd, kDefaultSocketReceiveBuffer)) { + return -1; + } + + rc = QuicSocketUtils::SetGetAddressInfo(fd, address_family); + if (rc < 0) { + LOG(ERROR) << "IP detection not supported" << strerror(errno); + return -1; + } + return fd; +} + } // namespace net |