diff options
author | vkuzkokov <vkuzkokov@chromium.org> | 2015-03-30 07:18:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-30 14:19:31 +0000 |
commit | e67c8beaf6d2bac124a0ff72a2c9bc5cf92daa24 (patch) | |
tree | 44335d4837be8931513e033ac766d8ec45ea95a2 /net/server | |
parent | 461b7956175a5e7b1fe129dd10406cf58f8435b4 (diff) | |
download | chromium_src-e67c8beaf6d2bac124a0ff72a2c9bc5cf92daa24.zip chromium_src-e67c8beaf6d2bac124a0ff72a2c9bc5cf92daa24.tar.gz chromium_src-e67c8beaf6d2bac124a0ff72a2c9bc5cf92daa24.tar.bz2 |
HttpServer: don't crash in SetReceiveBufferSize/SetSendBufferSize if connection is closed.
BUG=470902
Review URL: https://codereview.chromium.org/1045773002
Cr-Commit-Position: refs/heads/master@{#322772}
Diffstat (limited to 'net/server')
-rw-r--r-- | net/server/http_server.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/server/http_server.cc b/net/server/http_server.cc index a3f25ef..f496dc7 100644 --- a/net/server/http_server.cc +++ b/net/server/http_server.cc @@ -124,14 +124,14 @@ int HttpServer::GetLocalAddress(IPEndPoint* address) { void HttpServer::SetReceiveBufferSize(int connection_id, int32 size) { HttpConnection* connection = FindConnection(connection_id); - DCHECK(connection); - connection->read_buf()->set_max_buffer_size(size); + if (connection) + connection->read_buf()->set_max_buffer_size(size); } void HttpServer::SetSendBufferSize(int connection_id, int32 size) { HttpConnection* connection = FindConnection(connection_id); - DCHECK(connection); - connection->write_buf()->set_max_buffer_size(size); + if (connection) + connection->write_buf()->set_max_buffer_size(size); } void HttpServer::DoAcceptLoop() { |