Changeset 85734 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Aug 12, 2020 8:38:51 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139881
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostUpdateImpl.cpp
r85733 r85734 263 263 // Following the sequence of steps in UIUpdateStepVirtualBox::sltStartStep() 264 264 // Build up our query URL starting with the URL basename 265 Bstr url("https://update.virtualbox.org/query.php/?");265 Utf8Str strUrl("https://update.virtualbox.org/query.php/?"); 266 266 Bstr platform; 267 267 rc = mVirtualBox->COMGETTER(PackageType)(platform.asOutParam()); 268 268 if (FAILED(rc)) 269 269 return setErrorVrc(rc, tr("%s: IVirtualBox::packageType() failed: %Rrc"), __FUNCTION__, rc); 270 url.appendPrintf("platform=%ls", platform.raw()); // e.g. SOLARIS_64BITS_GENERIC270 strUrl.appendPrintf("platform=%ls", platform.raw()); // e.g. SOLARIS_64BITS_GENERIC 271 271 272 272 // Get the complete current version string for the query URL … … 275 275 if (FAILED(rc)) 276 276 return setErrorVrc(rc, tr("%s: IVirtualBox::versionNormalized() failed: %Rrc"), __FUNCTION__, rc); 277 url.appendPrintf("&version=%ls", versionNormalized.raw()); // e.g. 6.1.1278 // url.appendPrintf("&version=6.0.12"); // comment out previous line and uncomment this one for testing277 strUrl.appendPrintf("&version=%ls", versionNormalized.raw()); // e.g. 6.1.1 278 // strUrl.appendPrintf("&version=6.0.12"); // comment out previous line and uncomment this one for testing 279 279 280 280 ULONG revision; … … 282 282 if (FAILED(rc)) 283 283 return setErrorVrc(rc, tr("%s: IVirtualBox::revision() failed: %Rrc"), __FUNCTION__, rc); 284 url.appendPrintf("_%ld", revision); // e.g. 135618284 strUrl.appendPrintf("_%u", revision); // e.g. 135618 285 285 286 286 // acquire the System Properties interface … … 312 312 if (FAILED(rc)) 313 313 return rc; // ISystemProperties::setVBoxUpdateCount calls setError() on failure 314 url.appendPrintf("&count=%lu", cVBoxUpdateCount);314 strUrl.appendPrintf("&count=%u", cVBoxUpdateCount); 315 315 316 316 // Update the query URL and the VBoxUpdate settings (if necessary) with the 'Target' information. … … 323 323 { 324 324 case VBoxUpdateTarget_AllReleases: 325 url.appendPrintf("&branch=allrelease"); // query.php expects 'allrelease' and not 'allreleases'325 strUrl.appendPrintf("&branch=allrelease"); // query.php expects 'allrelease' and not 'allreleases' 326 326 break; 327 327 case VBoxUpdateTarget_WithBetas: 328 url.appendPrintf("&branch=withbetas");328 strUrl.appendPrintf("&branch=withbetas"); 329 329 break; 330 330 case VBoxUpdateTarget_Stable: 331 331 default: 332 url.appendPrintf("&branch=stable");332 strUrl.appendPrintf("&branch=stable"); 333 333 break; 334 334 } … … 338 338 return rc; // ISystemProperties::setTarget calls setError() on failure 339 339 340 LogRelFunc(("VBox update URL = %s\n", Utf8Str(url).c_str())); 341 342 // Setup the User-Agent headers for the GET request 340 LogRelFunc(("VBox update URL = %s\n", strUrl.c_str())); 341 342 /* 343 * Setup the User-Agent headers for the GET request 344 */ 343 345 Bstr version; 344 346 rc = mVirtualBox->COMGETTER(Version)(version.asOutParam()); // e.g. 6.1.0_RC1 … … 359 361 return setErrorVrc(vrc, tr("%s: RTHttpAddHeader() failed: %Rrc (on User-Agent)"), __FUNCTION__, vrc); 360 362 363 /* 364 * Configure proxying. 365 */ 361 366 ProxyMode_T enmProxyMode; 362 367 rc = pSystemProperties->COMGETTER(ProxyMode)(&enmProxyMode); … … 367 372 { 368 373 Bstr strProxyURL; 369 370 374 rc = pSystemProperties->COMGETTER(ProxyURL)(strProxyURL.asOutParam()); 371 375 if (FAILED(rc)) … … 382 386 } 383 387 384 void *pvResponse = 0; 388 /* 389 * Perform the GET request, returning raw binary stuff. 390 */ 391 void *pvResponse = NULL; 385 392 size_t cbResponse = 0; 386 vrc = RTHttpGetBinary(hHttp, Utf8Str(url).c_str(), &pvResponse, &cbResponse);393 vrc = RTHttpGetBinary(hHttp, strUrl.c_str(), &pvResponse, &cbResponse); 387 394 if (RT_FAILURE(vrc)) 388 395 return setErrorVrc(vrc, tr("%s: RTHttpGetBinary() failed: %Rrc"), __FUNCTION__, vrc); … … 409 416 410 417 // clean-up HTTP request paperwork 418 /** @todo r=bird: There is no chance that this would be NIL here unless 419 * you've got stack corruption. Besides, RTHttpDestruct ignores NIL. */ 411 420 if (hHttp != NIL_RTHTTP) 412 421 RTHttpDestroy(hHttp);
Note:
See TracChangeset
for help on using the changeset viewer.