Changeset 51733 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 26, 2014 9:20:40 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
r51635 r51733 73 73 static int applyCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName); 74 74 static int applyRawHeaders(RTHTTP pHttp, const QList<QByteArray> &headers, const QNetworkRequest &request); 75 static int performGetRequest(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply); 75 static int performGetRequestForText(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply); 76 static int performGetRequestForBinary(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply); 76 77 static int checkCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName); 77 78 static int downloadCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName); … … 158 159 { 159 160 /* Perform GET request: */ 160 return performGetRequest (m_pHttp, m_request, m_reply);161 return performGetRequestForText(m_pHttp, m_request, m_reply); 161 162 } 162 163 … … 261 262 262 263 /* static */ 263 int UINetworkReplyPrivateThread::performGetRequest (RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply)264 int UINetworkReplyPrivateThread::performGetRequestForText(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply) 264 265 { 265 266 /* Make sure HTTP is created: */ … … 268 269 269 270 /* Perform blocking HTTP GET request: */ 270 char *pszBuf = 0;271 char *pszBuffer = 0; 271 272 int rc = RTHttpGetText(pHttp, 272 273 request.url().toString().toAscii().constData(), 273 &pszBuf); 274 reply = QByteArray(pszBuf); 275 RTMemFree(pszBuf); 274 &pszBuffer); 275 reply = QByteArray(pszBuffer); 276 RTMemFree(pszBuffer); 277 return rc; 278 } 279 280 /* static */ 281 int UINetworkReplyPrivateThread::performGetRequestForBinary(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply) 282 { 283 /* Make sure HTTP is created: */ 284 if (!pHttp) 285 return VERR_INVALID_POINTER; 286 287 /* Perform blocking HTTP GET request: */ 288 void *pBuffer = 0; 289 size_t size = 0; 290 int rc = RTHttpGetBinary(pHttp, 291 request.url().toString().toAscii().constData(), 292 &pBuffer, &size); 293 reply = QByteArray((const char*)pBuffer, (int)size); 294 RTMemFree(pBuffer); 276 295 return rc; 277 296 } … … 363 382 QByteArray certificate; 364 383 const QNetworkRequest address(QUrl("http://www.verisign.com/repository/roots/root-certificates/PCA-3G5.pem")); 365 int rc = performGetRequest (pHttp, address, certificate);384 int rc = performGetRequestForText(pHttp, address, certificate); 366 385 367 386 /* Verify certificate: */ … … 383 402 QByteArray certificate; 384 403 const QNetworkRequest address(QUrl("http://www.verisign.com/repository/roots/root-certificates/PCA-3.pem")); 385 int rc = performGetRequest (pHttp, address, certificate);404 int rc = performGetRequestForText(pHttp, address, certificate); 386 405 387 406 /* Verify certificate: */
Note:
See TracChangeset
for help on using the changeset viewer.