Ignore:
Timestamp:
Aug 5, 2009, 1:25:36 AM (13 years ago)
Author:
charles
Message:

(trunk) #1400, #2308: differentiate warnings and errors; differentiate between local messages and messages from the tracker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r8864 r8869  
    286286        case TR_TRACKER_WARNING:
    287287            tr_torerr( tor, _( "Tracker warning: \"%s\"" ), event->text );
    288             tor->error = -1;
    289             tr_strlcpy( tor->errorString, event->text,
    290                        sizeof( tor->errorString ) );
     288            tor->error = TR_STAT_TRACKER_WARNING;
     289            tr_strlcpy( tor->errorString, event->text, sizeof( tor->errorString ) );
    291290            break;
    292291
    293292        case TR_TRACKER_ERROR:
    294293            tr_torerr( tor, _( "Tracker error: \"%s\"" ), event->text );
    295             tor->error = -2;
    296             tr_strlcpy( tor->errorString, event->text,
    297                        sizeof( tor->errorString ) );
     294            tor->error = TR_STAT_TRACKER_ERROR;
     295            tr_strlcpy( tor->errorString, event->text, sizeof( tor->errorString ) );
    298296            break;
    299297
    300298        case TR_TRACKER_ERROR_CLEAR:
    301             tor->error = 0;
     299            tor->error = TR_STAT_OK;
    302300            tor->errorString[0] = '\0';
    303301            break;
     
    605603    tr_ctorInitTorrentWanted( ctor, tor );
    606604
    607     tor->error   = 0;
     605    tor->error = TR_STAT_OK;
    608606
    609607    tr_bitfieldConstruct( &tor->checkedPieces, tor->info.pieceCount );
     
    860858    s->id = tor->uniqueId;
    861859    s->activity = tr_torrentGetActivity( tor );
    862     s->error  = tor->error;
    863     memcpy( s->errorString, tor->errorString,
    864            sizeof( s->errorString ) );
     860    s->error = tor->error;
     861    memcpy( s->errorString, tor->errorString, sizeof( s->errorString ) );
    865862
    866863    tc = tor->tracker;
     
    12481245    tor->isRunning = TRUE;
    12491246    tor->needsSeedRatioCheck = TRUE;
    1250     *tor->errorString = '\0';
     1247    tor->error = TR_STAT_OK;
     1248    tor->errorString[0] = '\0';
    12511249    tr_torrentResetTransferStats( tor );
    12521250    tor->completeness = tr_cpGetStatus( &tor->completion );
Note: See TracChangeset for help on using the changeset viewer.