- Timestamp:
- Apr 11, 2013 9:03:50 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
r43733 r45476 42 42 : m_request(request) 43 43 , m_iError(VINF_SUCCESS) 44 , m_pHttp(0) 44 45 { 45 46 } … … 49 50 int error() const { return m_iError; } 50 51 52 /* API: Abort stuff: */ 53 void abort() 54 { 55 /* Make sure http is created: */ 56 if (!m_pHttp) 57 return; 58 59 /* Call for http abort: */ 60 RTHttpAbort(m_pHttp); 61 } 62 51 63 private: 52 64 … … 58 70 59 71 /* Create: */ 60 RTHTTP hHttp; 61 m_iError = RTHttpCreate(&hHttp); 72 m_iError = RTHttpCreate(&m_pHttp); 62 73 63 74 /* Setup proxy: */ … … 65 76 if (proxyManager.proxyEnabled()) 66 77 { 67 RTHttpSetProxy( hHttp,78 RTHttpSetProxy(m_pHttp, 68 79 proxyManager.proxyHost().toAscii().constData(), 69 80 proxyManager.proxyPort().toUInt(), 0, 0); … … 86 97 } 87 98 const char **ppFormattedHeaders = formattedHeaderPointerVector.data(); 88 RTHttpSetHeaders( hHttp, formattedHeaderPointerVector.size(), ppFormattedHeaders);99 RTHttpSetHeaders(m_pHttp, formattedHeaderPointerVector.size(), ppFormattedHeaders); 89 100 } 90 101 … … 93 104 { 94 105 char *pszBuf = 0; 95 m_iError = RTHttpGet( hHttp,106 m_iError = RTHttpGet(m_pHttp, 96 107 m_request.url().toString().toAscii().constData(), 97 108 &pszBuf); … … 101 112 102 113 /* Destroy: */ 103 RTHttpDestroy(hHttp); 114 RTHttpDestroy(m_pHttp); 115 m_pHttp = 0; 104 116 } 105 117 … … 107 119 QNetworkRequest m_request; 108 120 int m_iError; 121 RTHTTP m_pHttp; 109 122 QByteArray m_reply; 110 123 }; … … 138 151 { 139 152 /* Terminate network-reply thread: */ 153 m_pThread->abort(); 140 154 m_pThread->wait(); 141 155 delete m_pThread; … … 146 160 void abort() 147 161 { 148 m_error = QNetworkReply::OperationCanceledError; 149 emit finished(); 162 m_pThread->abort(); 150 163 } 151 164 … … 188 201 case VINF_SUCCESS: 189 202 m_error = QNetworkReply::NoError; 203 break; 204 case VERR_HTTP_ABORTED: 205 m_error = QNetworkReply::OperationCanceledError; 190 206 break; 191 207 case VERR_HTTP_NOT_FOUND:
Note:
See TracChangeset
for help on using the changeset viewer.