r2042 - in trunk/src/target/OM-2007/applications/openmoko-rssreader: . src

zecke at sita.openmoko.org zecke at sita.openmoko.org
Sat May 19 21:22:30 CEST 2007


Author: zecke
Date: 2007-05-19 21:22:29 +0200 (Sat, 19 May 2007)
New Revision: 2042

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
Log:
2007-05-19  Holger Freyther  <zecke at selfish.org>

        Improve caching. org.openembedded.dev has a patch to libmrss
        0.17.2 to add a new method. Using this method we take over the
        ownership of the buffer of the downloaded file. This avoid all
        errors with mrss_write.
        We are now caching the original file.

        * src/callbacks.c:
        (feed_update_thread):



Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog	2007-05-19 07:44:20 UTC (rev 2041)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog	2007-05-19 19:22:29 UTC (rev 2042)
@@ -1,5 +1,16 @@
 2007-05-19  Holger Freyther  <zecke at selfish.org>
 
+        Improve caching. org.openembedded.dev has a patch to libmrss
+        0.17.2 to add a new method. Using this method we take over the
+        ownership of the buffer of the downloaded file. This avoid all
+        errors with mrss_write.
+        We are now caching the original file.
+
+        * src/callbacks.c:
+        (feed_update_thread):
+
+2007-05-19  Holger Freyther  <zecke at selfish.org>
+
         Do not crash on non valid pubDates
 
         * src/callbacks.c:

Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c	2007-05-19 07:44:20 UTC (rev 2041)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c	2007-05-19 19:22:29 UTC (rev 2042)
@@ -184,7 +184,9 @@
     for ( int i = 0; i < NUMBER_OF_FEEDS; ++i ) {
         mrss_t *rss_data;
         gchar *url = s_feeds[i].url;
-        int ret = mrss_parse_url( url, &rss_data );
+        gchar *buffer = NULL;
+        int  size;
+        int ret = mrss_parse_url_and_transfer_buffer( url, &rss_data, NULL, &buffer, &size );
         if ( ret ) {
             /* TODO use the footer to report error? */
             g_debug( "parse_url failed.." );
@@ -199,13 +201,11 @@
         /*
          * now cache the feed, a bit inefficient as we do not write to a file directly
          */
-        char *buffer = NULL;
-        mrss_write_buffer (rss_data, &buffer);
         if (buffer) {
-            moko_cache_write_object (data->cache, url, buffer, -1, NULL);
+            moko_cache_write_object (data->cache, url, buffer, size, NULL);
+            free (buffer);
         }
 
-        free (buffer);
         mrss_free( rss_data );
     }
 





More information about the commitlog mailing list