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

Side by Side Diff: net/tools/flip_server/acceptor_thread.cc

Issue 9705026: Fix a -Wstring-plus-int warning in (linux-only) flip_server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/flip_server/acceptor_thread.h" 5 #include "net/tools/flip_server/acceptor_thread.h"
6 6
7 #include <netinet/in.h> 7 #include <netinet/in.h>
8 #include <netinet/tcp.h> // For TCP_NODELAY 8 #include <netinet/tcp.h> // For TCP_NODELAY
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 void SMAcceptorThread::HandleConnection(int server_fd, 83 void SMAcceptorThread::HandleConnection(int server_fd,
84 struct sockaddr_in *remote_addr) { 84 struct sockaddr_in *remote_addr) {
85 int on = 1; 85 int on = 1;
86 int rc; 86 int rc;
87 if (acceptor_->disable_nagle_) { 87 if (acceptor_->disable_nagle_) {
88 rc = setsockopt(server_fd, IPPROTO_TCP, TCP_NODELAY, 88 rc = setsockopt(server_fd, IPPROTO_TCP, TCP_NODELAY,
89 reinterpret_cast<char*>(&on), sizeof(on)); 89 reinterpret_cast<char*>(&on), sizeof(on));
90 if (rc < 0) { 90 if (rc < 0) {
91 close(server_fd); 91 close(server_fd);
92 LOG(ERROR) << "setsockopt() failed fd=" + server_fd; 92 LOG(ERROR) << "setsockopt() failed fd=" << server_fd;
93 return; 93 return;
94 } 94 }
95 } 95 }
96 96
97 SMConnection* server_connection = FindOrMakeNewSMConnection(); 97 SMConnection* server_connection = FindOrMakeNewSMConnection();
98 if (server_connection == NULL) { 98 if (server_connection == NULL) {
99 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Acceptor: Closing fd " << server_fd; 99 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Acceptor: Closing fd " << server_fd;
100 close(server_fd); 100 close(server_fd);
101 return; 101 return;
102 } 102 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 void SMAcceptorThread::SMConnectionDone(SMConnection* sc) { 203 void SMAcceptorThread::SMConnectionDone(SMConnection* sc) {
204 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Done with connection."; 204 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Done with connection.";
205 tmp_unused_server_connections_.push_back(sc); 205 tmp_unused_server_connections_.push_back(sc);
206 } 206 }
207 207
208 } // namespace net 208 } // namespace net
209 209
210 210
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698