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

Unified Diff: net/tools/quic/quic_server.cc

Issue 397793004: Replace setsockopt(IP_PKTINFO) and setsockopt(IPV6_RECVPKTINFO) calls by (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server.cc
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index 40e389cd4ef863a18f4976fe37bc01e7d6d1c62c..e496cd6d8876561ce31ed5554361312439856479 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -28,12 +28,16 @@
#define SO_RXQ_OVFL 40
#endif
+namespace net {
+namespace tools {
+
+namespace {
+
const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET;
-static const char kSourceAddressTokenSecret[] = "secret";
+const char kSourceAddressTokenSecret[] = "secret";
const uint32 kServerInitialFlowControlWindow = 100 * net::kMaxPacketSize;
-namespace net {
-namespace tools {
+} // namespace
QuicServer::QuicServer()
: port_(0),
@@ -92,6 +96,8 @@ bool QuicServer::Listen(const IPEndPoint& address) {
return false;
}
+ // Enable the socket option that allows the local address to be
+ // returned if the socket is bound to more than one address.
int rc = QuicSocketUtils::SetGetAddressInfo(fd_, address_family);
ramant (doing other things) 2014/07/15 23:02:39 nit: do we need to call SetReceiveBufferSize and S
wtc 2014/07/16 01:09:22 I don't think these socket options depend on each
if (rc < 0) {
@@ -122,20 +128,6 @@ bool QuicServer::Listen(const IPEndPoint& address) {
return false;
}
- // Enable the socket option that allows the local address to be
- // returned if the socket is bound to more than on address.
- int get_local_ip = 1;
- rc = setsockopt(fd_, IPPROTO_IP, IP_PKTINFO,
- &get_local_ip, sizeof(get_local_ip));
- if (rc == 0 && address_family == AF_INET6) {
- rc = setsockopt(fd_, IPPROTO_IPV6, IPV6_RECVPKTINFO,
- &get_local_ip, sizeof(get_local_ip));
- }
- if (rc != 0) {
- LOG(ERROR) << "Failed to set required socket options";
- return false;
- }
-
sockaddr_storage raw_addr;
socklen_t raw_addr_len = sizeof(raw_addr);
CHECK(address.ToSockAddr(reinterpret_cast<sockaddr*>(&raw_addr),
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698