diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-09-22 23:44:16 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-09-22 23:44:49 -0400 |
commit | fad753ee002eb823426fa6d315e688364ed60a39 (patch) | |
tree | f44b74e8ea4aa1e8138b1b2501fa0f9063bdae93 /util | |
parent | 2250ff90c53e486a21ee1f3f2a9de71fdd7743ca (diff) | |
download | mongo-fad753ee002eb823426fa6d315e688364ed60a39.tar.gz |
try/catch around send in mini webserver SERVER-3907
Diffstat (limited to 'util')
-rw-r--r-- | util/net/miniwebserver.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/util/net/miniwebserver.cpp b/util/net/miniwebserver.cpp index 0793100d134..f0b58569d22 100644 --- a/util/net/miniwebserver.cpp +++ b/util/net/miniwebserver.cpp @@ -166,8 +166,13 @@ namespace mongo { ss << responseMsg; string response = ss.str(); - sock.send( response.c_str(), response.size() , "http response" ); - sock.close(); + try { + sock.send( response.c_str(), response.size() , "http response" ); + sock.close(); + } + catch ( SocketException& e ) { + log(1) << "couldn't send data to http client: " << e << endl; + } } string MiniWebServer::getHeader( const char * req , string wanted ) { |