VirtualBox

Ticket #3641: http_redirect.diff

File http_redirect.diff, 2.9 KB (added by Robert Millan, 15 years ago)
  • src/VBox/Frontends/VirtualBox/include/QIHttp.h

    Copyright (c) 2009  Robert Millan
    
    Permission is hereby granted, free of charge, to any person
    obtaining a copy of this software and associated documentation
    files (the "Software"), to deal in the Software without
    restriction, including without limitation the rights to use,
    copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following
    conditions:
    
    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.
    
     
    5656        /* Advanced QHttp errors */
    5757        TimeoutError,         /* MaxWaitTime time passed with no response */
    5858        PageNotFoundError,    /* Corresponds to 404 == not found header */
     59        MovedPermanentlyError, /* Corresponds to 301 == moved permanently response */
    5960        MovedTemporarilyError /* Corresponds to 302 == moved temporarily response */
    6061    };
    6162
     
    9293                return tr ("Could not locate the file on "
    9394                           "the server (response: %1)").arg (mStatusCode);
    9495            case MovedTemporarilyError:
     96            case MovedPermanentlyError:
    9597                return QString::null; /* should be redirected anyway */
    9698            default:
    9799                return QHttp::errorString();
     
    133135        mStatusCode = aResponse.statusCode();
    134136        switch (mStatusCode)
    135137        {
     138            case 301:
     139                mErrorCode = MovedPermanentlyError;
     140                return abort();
    136141            case 302:
    137142                mErrorCode = MovedTemporarilyError;
    138143                return abort();
  • src/VBox/Frontends/VirtualBox/src/VBoxDownloaderWgt.cpp

     
    104104                QTimer::singleShot (0, this, SLOT (suicide()));
    105105            break;
    106106        }
     107        case QIHttp::MovedPermanentlyError:
    107108        case QIHttp::MovedTemporarilyError:
    108109        {
    109110            /* Restart downloading at new location */

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy