summaryrefslogtreecommitdiffstats
path: root/net/server/http_server.cc
diff options
context:
space:
mode:
authorvkuzkokov <vkuzkokov@chromium.org>2015-03-30 07:18:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-30 14:19:31 +0000
commite67c8beaf6d2bac124a0ff72a2c9bc5cf92daa24 (patch)
tree44335d4837be8931513e033ac766d8ec45ea95a2 /net/server/http_server.cc
parent461b7956175a5e7b1fe129dd10406cf58f8435b4 (diff)
downloadchromium_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/http_server.cc')
-rw-r--r--net/server/http_server.cc8
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() {