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), |