| Index: webrtc/base/httpserver.cc
|
| diff --git a/webrtc/base/httpserver.cc b/webrtc/base/httpserver.cc
|
| index 083fc0751a85ad17bc7c8531e8309be223e4ab52..b19069123bf07d58c270ffb1f8ef5d118f14df52 100644
|
| --- a/webrtc/base/httpserver.cc
|
| +++ b/webrtc/base/httpserver.cc
|
| @@ -92,7 +92,7 @@ HttpServer::Connection*
|
| HttpServer::Find(int connection_id) {
|
| ConnectionMap::iterator it = connections_.find(connection_id);
|
| if (it == connections_.end())
|
| - return NULL;
|
| + return nullptr;
|
| return it->second;
|
| }
|
|
|
| @@ -118,9 +118,11 @@ HttpServer::Remove(int connection_id) {
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| HttpServer::Connection::Connection(int connection_id, HttpServer* server)
|
| - : connection_id_(connection_id), server_(server),
|
| - current_(NULL), signalling_(false), close_(false) {
|
| -}
|
| + : connection_id_(connection_id),
|
| + server_(server),
|
| + current_(nullptr),
|
| + signalling_(false),
|
| + close_(false) {}
|
|
|
| HttpServer::Connection::~Connection() {
|
| // It's possible that an object hosted inside this transaction signalled
|
| @@ -139,14 +141,14 @@ HttpServer::Connection::BeginProcess(StreamInterface* stream) {
|
|
|
| StreamInterface*
|
| HttpServer::Connection::EndProcess() {
|
| - base_.notify(NULL);
|
| + base_.notify(nullptr);
|
| base_.abort(HE_DISCONNECTED);
|
| return base_.detach();
|
| }
|
|
|
| void
|
| HttpServer::Connection::Respond(HttpServerTransaction* transaction) {
|
| - RTC_DCHECK(current_ == NULL);
|
| + RTC_DCHECK(current_ == nullptr);
|
| current_ = transaction;
|
| if (current_->response.begin() == current_->response.end()) {
|
| current_->response.set_error(HC_INTERNAL_SERVER_ERROR);
|
| @@ -161,7 +163,7 @@ HttpServer::Connection::Respond(HttpServerTransaction* transaction) {
|
|
|
| void
|
| HttpServer::Connection::InitiateClose(bool force) {
|
| - bool request_in_progress = (HM_SEND == base_.mode()) || (NULL == current_);
|
| + bool request_in_progress = (HM_SEND == base_.mode()) || (nullptr == current_);
|
| if (!signalling_ && (force || !request_in_progress)) {
|
| server_->Remove(connection_id_);
|
| } else {
|
| @@ -178,7 +180,7 @@ HttpServer::Connection::onHttpHeaderComplete(bool chunked, size_t& data_size) {
|
| if (data_size == SIZE_UNKNOWN) {
|
| data_size = 0;
|
| }
|
| - RTC_DCHECK(current_ != NULL);
|
| + RTC_DCHECK(current_ != nullptr);
|
| bool custom_document = false;
|
| server_->SignalHttpRequestHeader(server_, current_, &custom_document);
|
| if (!custom_document) {
|
| @@ -190,7 +192,7 @@ HttpServer::Connection::onHttpHeaderComplete(bool chunked, size_t& data_size) {
|
| void
|
| HttpServer::Connection::onHttpComplete(HttpMode mode, HttpError err) {
|
| if (mode == HM_SEND) {
|
| - RTC_DCHECK(current_ != NULL);
|
| + RTC_DCHECK(current_ != nullptr);
|
| signalling_ = true;
|
| server_->SignalHttpRequestComplete(server_, current_, err);
|
| signalling_ = false;
|
| @@ -204,11 +206,11 @@ HttpServer::Connection::onHttpComplete(HttpMode mode, HttpError err) {
|
| } else if (mode == HM_CONNECT) {
|
| base_.recv(¤t_->request);
|
| } else if (mode == HM_RECV) {
|
| - RTC_DCHECK(current_ != NULL);
|
| + RTC_DCHECK(current_ != nullptr);
|
| // TODO: do we need this?
|
| //request_.document_->rewind();
|
| HttpServerTransaction* transaction = current_;
|
| - current_ = NULL;
|
| + current_ = nullptr;
|
| server_->SignalHttpRequest(server_, transaction);
|
| } else if (mode == HM_SEND) {
|
| Thread::Current()->Dispose(current_->response.document.release());
|
| @@ -267,7 +269,7 @@ void HttpListenServer::StopListening() {
|
|
|
| void HttpListenServer::OnReadEvent(AsyncSocket* socket) {
|
| RTC_DCHECK(socket == listener_.get());
|
| - AsyncSocket* incoming = listener_->Accept(NULL);
|
| + AsyncSocket* incoming = listener_->Accept(nullptr);
|
| if (incoming) {
|
| StreamInterface* stream = new SocketStream(incoming);
|
| //stream = new LoggingAdapter(stream, LS_VERBOSE, "HttpServer", false);
|
|
|