summaryrefslogtreecommitdiff
path: root/src/mongo/util
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-02-17 16:33:56 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-02-17 18:29:13 -0500
commit543bf89e0870fa3a565a071519d928204d51ad20 (patch)
treee7f48e4b2e5ecb4a339f4698b09682f0a063ac96 /src/mongo/util
parent75dfb6a2597d84a8828c9e683449c2f66e1e0420 (diff)
downloadmongo-543bf89e0870fa3a565a071519d928204d51ad20.tar.gz
SERVER-22709 Log that connection was accepted before configuring socket
Diffstat (limited to 'src/mongo/util')
-rw-r--r--src/mongo/util/net/listen.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mongo/util/net/listen.cpp b/src/mongo/util/net/listen.cpp
index 499ca30b519..dfd65034b8a 100644
--- a/src/mongo/util/net/listen.cpp
+++ b/src/mongo/util/net/listen.cpp
@@ -325,14 +325,6 @@ void Listener::initAndListen() {
}
continue;
}
- if (from.getType() != AF_UNIX)
- disableNagle(s);
-
-#ifdef SO_NOSIGPIPE
- // ignore SIGPIPE signals on osx, to avoid process exit
- const int one = 1;
- setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(int));
-#endif
long long myConnectionNumber = globalConnectionNumber.addAndFetch(1);
@@ -343,6 +335,15 @@ void Listener::initAndListen() {
<< myConnectionNumber << " (" << conns << word << " now open)" << endl;
}
+ if (from.getType() != AF_UNIX)
+ disableNagle(s);
+
+#ifdef SO_NOSIGPIPE
+ // ignore SIGPIPE signals on osx, to avoid process exit
+ const int one = 1;
+ setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(int));
+#endif
+
std::shared_ptr<Socket> pnewSock(new Socket(s, from));
#ifdef MONGO_CONFIG_SSL
if (_ssl) {
@@ -546,8 +547,6 @@ void Listener::initAndListen() {
}
continue;
}
- if (from.getType() != AF_UNIX)
- disableNagle(s);
long long myConnectionNumber = globalConnectionNumber.addAndFetch(1);
@@ -558,6 +557,9 @@ void Listener::initAndListen() {
<< " (" << conns << word << " now open)" << endl;
}
+ if (from.getType() != AF_UNIX)
+ disableNagle(s);
+
std::shared_ptr<Socket> pnewSock(new Socket(s, from));
#ifdef MONGO_CONFIG_SSL
if (_ssl) {