comparison Core/HttpServer/MongooseServer.cpp @ 656:08eca5d86aad

fixes to cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Nov 2013 11:19:31 +0100
parents 6f8ae46ed90e
children 2d0a347e8cfc
comparison
equal deleted inserted replaced
655:93adc693cc60 656:08eca5d86aad
127 std::set<std::string> discardedFiles_; 127 std::set<std::string> discardedFiles_;
128 128
129 void Clear() 129 void Clear()
130 { 130 {
131 for (Content::iterator it = content_.begin(); 131 for (Content::iterator it = content_.begin();
132 it != content_.end(); it++) 132 it != content_.end(); ++it)
133 { 133 {
134 delete *it; 134 delete *it;
135 } 135 }
136 } 136 }
137 137
138 Content::iterator Find(const std::string& filename) 138 Content::iterator Find(const std::string& filename)
139 { 139 {
140 for (Content::iterator it = content_.begin(); 140 for (Content::iterator it = content_.begin();
141 it != content_.end(); it++) 141 it != content_.end(); ++it)
142 { 142 {
143 if ((*it)->GetFilename() == filename) 143 if ((*it)->GetFilename() == filename)
144 { 144 {
145 return it; 145 return it;
146 } 146 }
252 252
253 253
254 HttpHandler* MongooseServer::FindHandler(const UriComponents& forUri) const 254 HttpHandler* MongooseServer::FindHandler(const UriComponents& forUri) const
255 { 255 {
256 for (Handlers::const_iterator it = 256 for (Handlers::const_iterator it =
257 handlers_.begin(); it != handlers_.end(); it++) 257 handlers_.begin(); it != handlers_.end(); ++it)
258 { 258 {
259 if ((*it)->IsServedUri(forUri)) 259 if ((*it)->IsServedUri(forUri))
260 { 260 {
261 return *it; 261 return *it;
262 } 262 }
568 struct mg_connection *connection, 568 struct mg_connection *connection,
569 const struct mg_request_info *request) 569 const struct mg_request_info *request)
570 { 570 {
571 if (event == MG_NEW_REQUEST) 571 if (event == MG_NEW_REQUEST)
572 { 572 {
573 MongooseServer* that = (MongooseServer*) (request->user_data); 573 MongooseServer* that = reinterpret_cast<MongooseServer*>(request->user_data);
574 MongooseOutput output(connection); 574 MongooseOutput output(connection);
575 575
576 // Check remote calls 576 // Check remote calls
577 if (!that->IsRemoteAccessAllowed() && 577 if (!that->IsRemoteAccessAllowed() &&
578 request->remote_ip != LOCALHOST) 578 request->remote_ip != LOCALHOST)
814 void MongooseServer::ClearHandlers() 814 void MongooseServer::ClearHandlers()
815 { 815 {
816 Stop(); 816 Stop();
817 817
818 for (Handlers::iterator it = 818 for (Handlers::iterator it =
819 handlers_.begin(); it != handlers_.end(); it++) 819 handlers_.begin(); it != handlers_.end(); ++it)
820 { 820 {
821 delete *it; 821 delete *it;
822 } 822 }
823 } 823 }
824 824