Changeset 9573


Ignore:
Timestamp:
Nov 25, 2009, 7:26:30 PM (13 years ago)
Author:
charles
Message:

(trunk libT) #2595: "file too large error?" -- this can generate an EFBIG warning sparse preallocation is on and the peer makes an invalid request. At worst this kind of oddball case should generate a debug message notice, not a torrent error. Reported by Waldorf.

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r9544 r9573  
    147147    {
    148148        if( ioMode == TR_IO_READ ) {
    149             int rc = tr_pread(fd, buf, buflen, fileOffset);
    150             if(rc < 0) {
     149            const int rc = tr_pread( fd, buf, buflen, fileOffset );
     150            if( rc < 0 ) {
    151151                err = errno;
    152152                tr_torerr( tor, "read failed for \"%s\": %s",
     
    154154            }
    155155        } else if( ioMode == TR_IO_PREFETCH ) {
    156             int rc = tr_prefetch(fd, fileOffset, buflen);
    157             if(rc < 0) {
    158                 err = errno;
    159                 tr_torerr( tor, "prefetch failed for \"%s\": %s",
     156            const int rc = tr_prefetch( fd, fileOffset, buflen );
     157            if( rc < 0 ) {
     158                tr_tordbg( tor, "prefetch failed for \"%s\": %s",
    160159                           file->name, tr_strerror( err ) );
    161160            }
    162161        } else if( ioMode == TR_IO_WRITE ) {
    163             int rc = tr_pwrite(fd, buf, buflen, fileOffset);
    164             if(rc < 0) {
     162            const int rc = tr_pwrite( fd, buf, buflen, fileOffset );
     163            if( rc < 0 ) {
    165164                err = errno;
    166165                tr_torerr( tor, "write failed for \"%s\": %s",
    167166                           file->name, tr_strerror( err ) );
    168167            }
    169         } else
     168        } else {
    170169            abort();
     170        }
    171171    }
    172172
  • trunk/libtransmission/utils.c

    r9550 r9573  
    825825
    826826int
    827 tr_snprintf( char *       buf,
    828              size_t       buflen,
    829              const char * fmt,
    830              ... )
     827tr_snprintf( char * buf, size_t buflen, const char * fmt, ... )
    831828{
    832829    int     len;
Note: See TracChangeset for help on using the changeset viewer.