ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Search/HttpHandler.cpp
(Generate patch)

Comparing trunk/Search/HttpHandler.cpp (file contents):
Revision 350 by Douglas Thrift, 2004-05-27T20:29:11-07:00 vs.
Revision 360 by Douglas Thrift, 2004-08-19T20:09:52-07:00

# Line 85 | Line 85 | HttpHandler::~HttpHandler()
85   #endif // _WIN32
86   }
87  
88 < bool HttpHandler::handle(URL &url, const string referer, bool head)
88 > bool HttpHandler::handle(URL &url, const string& referer, bool head)
89   {
90          bool answer(false);
91  
# Line 159 | Line 159 | bool HttpHandler::handle(URL &url, const
159                  putline("Host: " + url.getAddress() + ':' + port.str());
160          }
161  
162 <        if (referer != "")
162 >        if (!referer.empty())
163          {
164                  putline("Referer: " + referer);
165          }
# Line 167 | Line 167 | bool HttpHandler::handle(URL &url, const
167          putline("Connection: close");
168          putline();
169  
170 <        code response;
170 >        Code response;
171          string line;
172  
173          do
# Line 196 | Line 196 | bool HttpHandler::handle(URL &url, const
196  
197                  number >> response;
198  
199 <                if (response < ok) do line = getline(); while (line != "");
199 >                if (response < ok) do line = getline(); while (!line.empty());
200          }
201          while (response < ok);
202  
# Line 204 | Line 204 | bool HttpHandler::handle(URL &url, const
204          {
205                  line = getline();
206  
207 <                if (line != "")
207 >                if (!line.empty())
208                  {
209                          unsigned colon(line.find(':'));
210                          string field(line.substr(0, colon)), value(line.substr(colon + 1));
# Line 231 | Line 231 | bool HttpHandler::handle(URL &url, const
231                          }
232                  }
233          }
234 <        while (line != "");
234 >        while (!line.empty());
235  
236          switch (response)
237          {
# Line 280 | Line 280 | void HttpHandler::clear()
280  
281          closesocket(http);
282  
283        type = "";
283          length = 0;
285        location = "";
284  
285 +        type.erase();
286 +        location.erase();
287          page.clear();
288          page.str("");
289  
# Line 425 | Line 425 | void HttpHandler::populate()
425          }
426   }
427  
428 < void HttpHandler::putline(const string line)
428 > void HttpHandler::putline(const string& line)
429   {
430          sprintf(buffer, "%s\r\n", line.c_str());
431  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines