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

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

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/tools/quic/quic_server.cc
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index 2d1a52d3f0dc010f5c60e19eb1147dbedd6a0e71..a904940be1294427e247a7a70c69b64b58d5995f 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -77,9 +77,9 @@ void QuicServer::Initialize() {
QuicEpollClock clock(&epoll_server_);
scoped_ptr<CryptoHandshakeMessage> scfg(
- crypto_config_.AddDefaultConfig(
- QuicRandom::GetInstance(), &clock,
- QuicCryptoServerConfig::ConfigOptions()));
+ crypto_config_.AddDefaultConfig(QuicRandom::GetInstance(),
+ &clock,
+ QuicCryptoServerConfig::ConfigOptions()));
}
QuicServer::~QuicServer() {
@@ -127,11 +127,14 @@ bool QuicServer::Listen(const IPEndPoint& address) {
// 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));
+ 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));
+ 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";
@@ -142,9 +145,8 @@ bool QuicServer::Listen(const IPEndPoint& address) {
socklen_t raw_addr_len = sizeof(raw_addr);
CHECK(address.ToSockAddr(reinterpret_cast<sockaddr*>(&raw_addr),
&raw_addr_len));
- rc = bind(fd_,
- reinterpret_cast<const sockaddr*>(&raw_addr),
- sizeof(raw_addr));
+ rc =
+ bind(fd_, reinterpret_cast<const sockaddr*>(&raw_addr), sizeof(raw_addr));
if (rc < 0) {
LOG(ERROR) << "Bind failed: " << strerror(errno);
return false;
@@ -164,12 +166,12 @@ bool QuicServer::Listen(const IPEndPoint& address) {
}
epoll_server_.RegisterFD(fd_, this, kEpollFlags);
- dispatcher_.reset(new QuicDispatcher(
- config_,
- crypto_config_,
- supported_versions_,
- &epoll_server_,
- server_initial_flow_control_receive_window_));
+ dispatcher_.reset(
+ new QuicDispatcher(config_,
+ crypto_config_,
+ supported_versions_,
+ &epoll_server_,
+ server_initial_flow_control_receive_window_));
dispatcher_->Initialize(fd_);
return true;
@@ -196,9 +198,11 @@ void QuicServer::OnEvent(int fd, EpollEvent* event) {
DVLOG(1) << "EPOLLIN";
bool read = true;
while (read) {
- read = ReadAndDispatchSinglePacket(
- fd_, port_, dispatcher_.get(),
- overflow_supported_ ? &packets_dropped_ : NULL);
+ read = ReadAndDispatchSinglePacket(
+ fd_,
+ port_,
+ dispatcher_.get(),
+ overflow_supported_ ? &packets_dropped_ : NULL);
}
}
if (event->in_events & EPOLLOUT) {
@@ -222,10 +226,8 @@ bool QuicServer::ReadAndDispatchSinglePacket(int fd,
IPEndPoint client_address;
IPAddressNumber server_ip;
- int bytes_read =
- QuicSocketUtils::ReadPacket(fd, buf, arraysize(buf),
- packets_dropped,
- &server_ip, &client_address);
+ int bytes_read = QuicSocketUtils::ReadPacket(
+ fd, buf, arraysize(buf), packets_dropped, &server_ip, &client_address);
if (bytes_read < 0) {
return false; // We failed to read.

Powered by Google App Engine
This is Rietveld 408576698