Revert "SERVER-500 more port/socket corner cases"

This reverts commit b691dc629e.
This commit is contained in:
Aaron
2010-01-11 22:04:39 -08:00
parent 367a68dffc
commit 4c03735ef8

View File

@@ -271,10 +271,13 @@ namespace mongo {
cerr << "count for port: " << port_ << " is not 0 is: " << dbs.count( port_ ) << endl;
assert( dbs.count( port_ ) == 0 );
}
if ( port_ <= 0 || portToSocket.find( port_ ) == portToSocket.end() || portToSocket[ port_ ] <= 0 ) {
if ( port_ > 0 ) {
if ( portToSocket.find( port_ ) == portToSocket.end() ) {
oldSocket_ = -1;
} else {
oldSocket_ = portToSocket[ port_ ];
} else {
oldSocket_ = portToSocket[ port_ ];
assert( oldSocket_ > 0 );
}
}
}
@@ -284,11 +287,8 @@ namespace mongo {
// port allocator left this socket open to prevent someone else from grabbing
// the port -- now we need to close the socket
if ( oldSocket_ > 0 ) {
if ( oldSocket_ > 0 )
assert( 0 == close( oldSocket_ ) );
portToSocket[ port_ ] = -1;
oldSocket_ = -1;
}
fflush( 0 );
pid_ = fork();