Changeset 2260


Ignore:
Timestamp:
Jul 1, 2007, 2:54:37 AM (15 years ago)
Author:
charles
Message:

make the "Error while parsing bencoded data" more helpful by showing the bad bencoded data. (though the string might be very long...)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_prefs.c

    r2154 r2260  
    184184    { FALSE, -1, FALSE },
    185185    /* PREF_ID_USEUPLIMIT */
    186     { TRUE, PREF_ID_UPLIMIT,   TRUE },
     186    { FALSE, PREF_ID_UPLIMIT,   TRUE },
    187187    { FALSE, -1, FALSE },
    188188    /* PREF_ID_ASKDIR */
  • trunk/libtransmission/metainfo.c

    r2219 r2260  
    158158}
    159159
    160 int
     160static int
    161161realparse( tr_info_t * inf, const uint8_t * buf, size_t size )
    162162{
     
    167167    if( tr_bencLoad( buf, size, &meta, NULL ) )
    168168    {
    169         tr_err( "Error while parsing bencoded data" );
     169        tr_err( "Error while parsing bencoded data [%*.*s]", (int)size, (int)size, (char*)buf );
    170170        return TR_EINVALID;
    171171    }
     
    524524}
    525525
    526 void
     526static void
    527527savedname( char * name, size_t len, const char * hash, const char * tag )
    528528{
     
    549549}
    550550
    551 uint8_t * readtorrent( const char * path, size_t * size )
     551static uint8_t *
     552readtorrent( const char * path, size_t * size )
    552553{
    553554    uint8_t    * buf;
     
    604605
    605606/* Save a copy of the torrent file in the saved torrent directory */
    606 int savetorrent( const char * hash, const char * tag,
    607                  const uint8_t * buf, size_t buflen )
     607static int
     608savetorrent( const char * hash, const char * tag,
     609             const uint8_t * buf, size_t buflen )
    608610{
    609611    char   path[MAX_PATH_LENGTH];
     
    629631}
    630632
    631 int
     633static int
    632634parseFiles( tr_info_t * inf, benc_val_t * name,
    633635            benc_val_t * files, benc_val_t * length )
Note: See TracChangeset for help on using the changeset viewer.