Browse Source

more minor cookie issues

David Rose 18 years ago
parent
commit
5f87b7e40f
2 changed files with 7 additions and 0 deletions
  1. 1 0
      panda/src/downloader/httpCookie.cxx
  2. 6 0
      panda/src/downloader/httpDate.cxx

+ 1 - 0
panda/src/downloader/httpCookie.cxx

@@ -130,6 +130,7 @@ matches_url(const URLSpec &url) const {
   }
   string server = url.get_server();
   if (server == _domain || 
+      (string(".") + server) == _domain ||
       (server.length() > _domain.length() &&
        server.substr(server.length() - _domain.length()) == _domain &&
        (_domain[0] == '.' || server[server.length() - _domain.length() - 1] == '.'))) {

+ 6 - 0
panda/src/downloader/httpDate.cxx

@@ -214,6 +214,11 @@ HTTPDate(const string &format) {
   }
 
   // Everything checks out; convert the date.
+#ifdef __GNUC__
+  _time = timegm(&t);
+
+#else  // __GNUC__
+  // Without the GNU extension timegm, we have to use mktime() instead.
   _time = mktime(&t);
 
   if (_time != (time_t)-1) {
@@ -222,6 +227,7 @@ HTTPDate(const string &format) {
     extern long int timezone;
     _time -= timezone;
   }
+#endif  // __GNUC__
 }
 
 ////////////////////////////////////////////////////////////////////