VirtualBox

Ignore:
Timestamp:
Apr 22, 2010 12:40:25 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60431
Message:

FE/Qt: Fixing segfault in QIHttp class and this class-users.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIHttp.h

    r25177 r28589  
    66
    77/*
    8  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    119119    }
    120120
     121    /* This method is doing effictevely the same as abort()
     122     * but in its turn trying to do all after other things been done. */
     123    void abortAll()
     124    {
     125        QTimer::singleShot(0, this, SLOT(abort()));
     126    }
     127
    121128signals:
    122129
     
    125132private slots:
    126133
     134    /* We should hide this method from direct call as its very
     135     * dangerous to call it while other requests are being processed.
     136     * Use abortAll() to get the same result. */
     137    void abort()
     138    {
     139        QHttp::abort();
     140    }
     141
    127142    void timeouted()
    128143    {
    129144        mErrorCode = TimeoutError;
    130         abort();
     145        abortAll();
    131146    }
    132147
     
    138153            case 301:
    139154                mErrorCode = MovedPermanentlyError;
    140                 return abort();
     155                return abortAll();
    141156            case 302:
    142157                mErrorCode = MovedTemporarilyError;
    143                 return abort();
     158                return abortAll();
    144159            case 404:
    145160                mErrorCode = PageNotFoundError;
    146                 return abort();
     161                return abortAll();
    147162            default:
    148163                mErrorCode = (AdvancedError) QHttp::error();
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloader.cpp

    r27691 r28589  
    167167{
    168168    /* Abort connection as we already got all we need */
    169     m_pHttp->abort();
     169    m_pHttp->abortAll();
    170170}
    171171
     
    173173 * to download file of proposed size if no error present or
    174174 * abort download progress if error is present */
    175 void UIDownloader::acknowledgeFinished(bool fError)
    176 {
    177     NOREF(fError);
    178 
    179     AssertMsg(fError, ("Error must be 'true' due to aborting.\n"));
    180 
     175void UIDownloader::acknowledgeFinished(bool /* fError */)
     176{
    181177    m_pHttp->disconnect(this);
    182178
    183179    switch (m_pHttp->errorCode())
    184180    {
    185         case QIHttp::Aborted:
     181        case QIHttp::NoError: /* full packet comes before aborting */
     182        case QIHttp::Aborted: /* part of packet comes before aborting */
    186183        {
    187184            /* Ask the user if he wish to download it */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloaderUserManual.cpp

    r27756 r28589  
    112112    /* If current source was wrong but other is present
    113113     * we will try other source else we should finish: */
    114     if (fError && !m_sourcesList.isEmpty())
     114    if (m_pHttp->errorCode() != QIHttp::Aborted && m_pHttp->errorCode() != QIHttp::NoError && !m_sourcesList.isEmpty())
    115115        startDownload();
    116116    else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette