| Index: webrtc/base/httpserver.cc
|
| diff --git a/webrtc/base/httpserver.cc b/webrtc/base/httpserver.cc
|
| index 6594581aec9d6a4268f3bb75876016fd2d528cca..0c8235d127d5e817241d748de0e6a2ad82ee669c 100644
|
| --- a/webrtc/base/httpserver.cc
|
| +++ b/webrtc/base/httpserver.cc
|
| @@ -93,7 +93,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;
|
| }
|
|
|
| @@ -119,9 +119,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
|
| @@ -140,14 +142,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);
|
| @@ -162,7 +164,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 {
|
| @@ -179,7 +181,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) {
|
| @@ -191,7 +193,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;
|
| @@ -205,11 +207,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());
|
| @@ -269,7 +271,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);
|
|
|