Changeset 2042


Ignore:
Timestamp:
05/19/07 21:22:29 (6 years ago)
Author:
zecke
Message:

2007-05-19 Holger Freyther <zecke@…>

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):
Location:
trunk/src/target/OM-2007/applications/openmoko-rssreader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog

    r2030 r2042  
     12007-05-19  Holger Freyther  <zecke@selfish.org> 
     2 
     3        Improve caching. org.openembedded.dev has a patch to libmrss 
     4        0.17.2 to add a new method. Using this method we take over the 
     5        ownership of the buffer of the downloaded file. This avoid all 
     6        errors with mrss_write. 
     7        We are now caching the original file. 
     8 
     9        * src/callbacks.c: 
     10        (feed_update_thread): 
     11 
    1122007-05-19  Holger Freyther  <zecke@selfish.org> 
    213 
  • trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c

    r2030 r2042  
    185185        mrss_t *rss_data; 
    186186        gchar *url = s_feeds[i].url; 
    187         int ret = mrss_parse_url( url, &rss_data ); 
     187        gchar *buffer = NULL; 
     188        int  size; 
     189        int ret = mrss_parse_url_and_transfer_buffer( url, &rss_data, NULL, &buffer, &size ); 
    188190        if ( ret ) { 
    189191            /* TODO use the footer to report error? */ 
     
    200202         * now cache the feed, a bit inefficient as we do not write to a file directly 
    201203         */ 
    202         char *buffer = NULL; 
    203         mrss_write_buffer (rss_data, &buffer); 
    204204        if (buffer) { 
    205             moko_cache_write_object (data->cache, url, buffer, -1, NULL); 
    206         } 
    207  
    208         free (buffer); 
     205            moko_cache_write_object (data->cache, url, buffer, size, NULL); 
     206            free (buffer); 
     207        } 
     208 
    209209        mrss_free( rss_data ); 
    210210    } 
Note: See TracChangeset for help on using the changeset viewer.