pan2 r347 - in trunk/pan: data data-impl tasks



Author: csk
Date: Sat Jul  5 10:09:01 2008
New Revision: 347
URL: http://svn.gnome.org/viewvc/pan2?rev=347&view=rev

Log:
Bug 482140 â Pan-0.132: Get last N days' headers fails when no headers in N days


Modified:
   trunk/pan/data-impl/data-impl.h
   trunk/pan/data-impl/xover.cc
   trunk/pan/data/data.h
   trunk/pan/tasks/task-xover.cc

Modified: trunk/pan/data-impl/data-impl.h
==============================================================================
--- trunk/pan/data-impl/data-impl.h	(original)
+++ trunk/pan/data-impl/data-impl.h	Sat Jul  5 10:09:01 2008
@@ -574,7 +574,7 @@
                                          const Quark          & group,
                                          const StringView     & subject,
                                          const StringView     & author,
-                                         const StringView     & date,
+                                         const time_t           date,
                                          const StringView     & message_id,
                                          const StringView     & references,
                                          const unsigned long    byte_count,

Modified: trunk/pan/data-impl/xover.cc
==============================================================================
--- trunk/pan/data-impl/xover.cc	(original)
+++ trunk/pan/data-impl/xover.cc	Sat Jul  5 10:09:01 2008
@@ -227,7 +227,7 @@
                        const Quark         & group,
                        const StringView    & subject,
                        const StringView    & author,
-                       const StringView    & time_posted,
+                       const time_t          time_posted,
                        const StringView    & message_id,
                        const StringView    & references_in,
                        const unsigned long   byte_count,
@@ -293,7 +293,7 @@
       a.message_id = art_mid;
       a.is_binary = part_count >= 1;
       a.set_part_count (a.is_binary ? part_count : 1);
-      a.time_posted = time_posted.empty() ? 0 : g_mime_utils_header_decode_date (time_posted.str, NULL);
+      a.time_posted = time_posted;
       a.xref.insert (server, xref);
       load_article (group, &a, references);
       new_article = &a;

Modified: trunk/pan/data/data.h
==============================================================================
--- trunk/pan/data/data.h	(original)
+++ trunk/pan/data/data.h	Sat Jul  5 10:09:01 2008
@@ -537,7 +537,7 @@
                                          const Quark          & group,
                                          const StringView     & subject,
                                          const StringView     & author,
-                                         const StringView     & time,
+                                         const time_t           time,
                                          const StringView     & message_id,
                                          const StringView     & references,
                                          const unsigned long    byte_count,

Modified: trunk/pan/tasks/task-xover.cc
==============================================================================
--- trunk/pan/tasks/task-xover.cc	(original)
+++ trunk/pan/tasks/task-xover.cc	Sat Jul  5 10:09:01 2008
@@ -299,23 +299,24 @@
 
   const char * fallback_charset = NULL; // FIXME
 
+  // are we done?
+  const time_t time_posted = g_mime_utils_header_decode_date (date.str, NULL);
+  if( _mode==DAYS && time_posted<_days_cutoff ) {
+    _server_to_minitasks[nntp->_server].clear ();
+    return;
+  }
+
   ++_parts_so_far;
 
   const Article * article = _data.xover_add (
     nntp->_server, nntp->_group,
     (header_is_nonencoded_utf8(subj) ? subj : header_to_utf8(subj,fallback_charset).c_str()),
     (header_is_nonencoded_utf8(author) ? author : header_to_utf8(author,fallback_charset).c_str()),
-    date, mid, ref, bytes, lines, xref);
+    time_posted, mid, ref, bytes, lines, xref);
 
   if (article)
-  {
     ++_articles_so_far;
 
-    // are we done?
-    if (_mode==DAYS && article->time_posted<_days_cutoff)
-      _server_to_minitasks[nntp->_server].clear ();
-  }
-
   // emit a status update
   int& prev = _last_xover_number[nntp];
   increment_step (number - prev);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]