Changeset bf832a4


Ignore:
Timestamp:
Jul 1, 2011 11:04:09 AM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
57d196e
Parents:
5ae4152
Message:
  • EepGet?:
    • Fix error output bug
    • Output error data for 504 too
File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/EepGet.java

    r5ae4152 rbf832a4  
    704704            case 503: // no outproxy
    705705                _transferFailed = true;
    706                 if (_alreadyTransferred == 0 && !_shouldWriteErrorToOutput) {
     706                if (_alreadyTransferred > 0 || !_shouldWriteErrorToOutput) {
    707707                    _keepFetching = false;
    708708                    return;
     
    719719            case 416: // completed (or range out of reach)
    720720                _bytesRemaining = 0;
    721                 if (_alreadyTransferred == 0 && !_shouldWriteErrorToOutput) {
     721                if (_alreadyTransferred > 0 || !_shouldWriteErrorToOutput) {
    722722                    _keepFetching = false;
    723723                    return;
     
    733733                break;
    734734            case 504: // gateway timeout
    735                 // throw out of doFetch() to fetch() and try again
    736                 throw new IOException("HTTP Proxy timeout");
     735                if (_alreadyTransferred > 0 || (!_shouldWriteErrorToOutput) ||
     736                    _currentAttempt < _numRetries) {
     737                    // throw out of doFetch() to fetch() and try again
     738                    // why throw???
     739                    throw new IOException("HTTP Proxy timeout");
     740                }
     741                // output the error data to the stream
     742                rcOk = true;
     743                if (_out == null) {
     744                    if (_outputStream != null)
     745                        _out = _outputStream;
     746                    else
     747                        _out = new FileOutputStream(_outputFile, true);
     748                }
     749                _transferFailed = true;
     750                break;
    737751            default:
    738                 if (_alreadyTransferred == 0 && !_shouldWriteErrorToOutput) {
     752                if (_alreadyTransferred > 0 || !_shouldWriteErrorToOutput) {
    739753                    _keepFetching = false;
    740754                } else {
Note: See TracChangeset for help on using the changeset viewer.