Index: trunk/src/VBox/Main/src-server/HostUpdateImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/HostUpdateImpl.cpp	(revision 85733)
+++ trunk/src/VBox/Main/src-server/HostUpdateImpl.cpp	(revision 85734)
@@ -263,10 +263,10 @@
     // Following the sequence of steps in UIUpdateStepVirtualBox::sltStartStep()
     // Build up our query URL starting with the URL basename
-    Bstr url("https://update.virtualbox.org/query.php/?");
+    Utf8Str strUrl("https://update.virtualbox.org/query.php/?");
     Bstr platform;
     rc = mVirtualBox->COMGETTER(PackageType)(platform.asOutParam());
     if (FAILED(rc))
         return setErrorVrc(rc, tr("%s: IVirtualBox::packageType() failed: %Rrc"), __FUNCTION__, rc);
-    url.appendPrintf("platform=%ls", platform.raw()); // e.g. SOLARIS_64BITS_GENERIC
+    strUrl.appendPrintf("platform=%ls", platform.raw()); // e.g. SOLARIS_64BITS_GENERIC
 
     // Get the complete current version string for the query URL
@@ -275,6 +275,6 @@
     if (FAILED(rc))
         return setErrorVrc(rc, tr("%s: IVirtualBox::versionNormalized() failed: %Rrc"), __FUNCTION__, rc);
-    url.appendPrintf("&version=%ls", versionNormalized.raw()); // e.g. 6.1.1
-    // url.appendPrintf("&version=6.0.12"); // comment out previous line and uncomment this one for testing
+    strUrl.appendPrintf("&version=%ls", versionNormalized.raw()); // e.g. 6.1.1
+    // strUrl.appendPrintf("&version=6.0.12"); // comment out previous line and uncomment this one for testing
 
     ULONG revision;
@@ -282,5 +282,5 @@
     if (FAILED(rc))
         return setErrorVrc(rc, tr("%s: IVirtualBox::revision() failed: %Rrc"), __FUNCTION__, rc);
-    url.appendPrintf("_%ld", revision); // e.g. 135618
+    strUrl.appendPrintf("_%u", revision); // e.g. 135618
 
     // acquire the System Properties interface
@@ -312,5 +312,5 @@
     if (FAILED(rc))
         return rc; // ISystemProperties::setVBoxUpdateCount calls setError() on failure
-    url.appendPrintf("&count=%lu", cVBoxUpdateCount);
+    strUrl.appendPrintf("&count=%u", cVBoxUpdateCount);
 
     // Update the query URL and the VBoxUpdate settings (if necessary) with the 'Target' information.
@@ -323,12 +323,12 @@
     {
         case VBoxUpdateTarget_AllReleases:
-            url.appendPrintf("&branch=allrelease"); // query.php expects 'allrelease' and not 'allreleases'
+            strUrl.appendPrintf("&branch=allrelease"); // query.php expects 'allrelease' and not 'allreleases'
             break;
         case VBoxUpdateTarget_WithBetas:
-            url.appendPrintf("&branch=withbetas");
+            strUrl.appendPrintf("&branch=withbetas");
             break;
         case VBoxUpdateTarget_Stable:
         default:
-            url.appendPrintf("&branch=stable");
+            strUrl.appendPrintf("&branch=stable");
             break;
     }
@@ -338,7 +338,9 @@
         return rc; // ISystemProperties::setTarget calls setError() on failure
 
-    LogRelFunc(("VBox update URL = %s\n", Utf8Str(url).c_str()));
-
-    // Setup the User-Agent headers for the GET request
+    LogRelFunc(("VBox update URL = %s\n", strUrl.c_str()));
+
+    /*
+     * Setup the User-Agent headers for the GET request
+     */
     Bstr version;
     rc = mVirtualBox->COMGETTER(Version)(version.asOutParam()); // e.g. 6.1.0_RC1
@@ -359,4 +361,7 @@
         return setErrorVrc(vrc, tr("%s: RTHttpAddHeader() failed: %Rrc (on User-Agent)"), __FUNCTION__, vrc);
 
+    /*
+     * Configure proxying.
+     */
     ProxyMode_T enmProxyMode;
     rc = pSystemProperties->COMGETTER(ProxyMode)(&enmProxyMode);
@@ -367,5 +372,4 @@
     {
         Bstr strProxyURL;
-
         rc = pSystemProperties->COMGETTER(ProxyURL)(strProxyURL.asOutParam());
         if (FAILED(rc))
@@ -382,7 +386,10 @@
     }
 
-    void *pvResponse = 0;
+    /*
+     * Perform the GET request, returning raw binary stuff.
+     */
+    void *pvResponse = NULL;
     size_t cbResponse = 0;
-    vrc = RTHttpGetBinary(hHttp, Utf8Str(url).c_str(), &pvResponse, &cbResponse);
+    vrc = RTHttpGetBinary(hHttp, strUrl.c_str(), &pvResponse, &cbResponse);
     if (RT_FAILURE(vrc))
         return setErrorVrc(vrc, tr("%s: RTHttpGetBinary() failed: %Rrc"), __FUNCTION__, vrc);
@@ -409,4 +416,6 @@
 
     // clean-up HTTP request paperwork
+    /** @todo r=bird: There is no chance that this would be NIL here unless
+     *        you've got stack corruption.  Besides, RTHttpDestruct ignores NIL. */
     if (hHttp != NIL_RTHTTP)
         RTHttpDestroy(hHttp);
