login about faq

VB 6.0 on 64bit Windows 7 Pro New DLL Version: 9.5.0.48 Old chilkathttp DLL Version: 9.3.2.0

Same code works with old DLL, but downloads fail in new DLL only change in code is PercentDone(pctdone/percent) callback

thanks for any help Randy

asked Mar 12 '15 at 17:44

rgibson's gravatar image

rgibson
113


This is part of a utility program I wrote a few years ago it downloads all the tools I need in the field to fix/clean up infected systems. there is a small text file with name,url, localfilename that gets read, downloads the latest version unzips if needed and a few other things. when I updated to the mono DLL, several of my programs had issues, most of which have been fixed. LastErrorText, both good and failed are below

Thanks for the help

Code snip

Public WithEvents http As ChilkatHttp

Private Sub Command1_Click() Set http = New ChilkatHttp success = http.UnlockComponent("SuperSecretCodeGoesHere") If (success <> 1) Then MsgBox "Failed To Unlock HTTP Component" Exit Sub End If

GetFile

End Sub Private Sub GetFile() Dim strErrLog, strUrl, strFileName, strInfo As String Dim success As Long

Set http = New ChilkatHttp
http.MimicIE = True
http.FollowRedirects = True     ' <------------ it's turned on
http.KeepEventLog = True

' Any url ending in / and not a direct filename    
strUrl = "http://downloads.malwarebytes.org/file/mbam/"

strFileName = "InstallMBAM.EXE"
strInfo = "MalwareBytes Anti-Malware"

success = http.Download(strUrl, App.Path & "\" & strFileName)
strErrLog = http.LastErrorText
If success = 1 Then
    Label1.Caption = "It Worked!"

    Debug.Print strErrLog

Else
    Label1.Caption = "It Failed!"

    Debug.Print strErrLog

End If

End Sub

Success log

   ++++++++++++++++++++++++++++++++++++
ChilkatLog:
  Download:
    DllDate: Aug  5 2012
    UnlockPrefix: RAGSOFHttp
    Username: SHOP2:randy
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    backgroundThread: 0
    url: http://downloads.malwarebytes.org/file/mbam/
    toLocalPath: D:ProgrammingAppsIWroteGetToolstestcodeInstallMBAM.EXE
    localFileAlreadyExists: 1  ***EXISTING FILE DOES NOT MATTER
    QuickGetToOutput_Download:
      qGet_1:
        simpleHttpRequest_3:
          httpMethod: GET
          requestUrl: http://downloads.malwarebytes.org/file/mbam/
          Connecting to web server...
          httpServer: downloads.malwarebytes.org
          port: 80
          ConnectTimeoutMs_1: 10000
          calling ConnectSocket2
          IPV6 enabled connect with NO heartbeat.
          connectingTo: downloads.malwarebytes.org
          dnsCacheLookup: downloads.malwarebytes.org
          Resolving domain name (IPV4)
          GetHostByNameHB_ipv4: Elapsed time: 16 millisec
          myIP_1: 192.168.1.99
          myPort_1: 59611
          connect successful (1)
          connectElapsedMs: 47
          -- BuildIeGetRequest --
          Not auto-adding cookies.
          sendElapsedMs: 0
          StatusCode: 302
          StatusText: Moved Temporarily
          Reading response body...
          readResponseElapsedMs: 63
          redirectUrl: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
          newUrlLocation:
            url: http://downloads.malwarebytes.org/file/mbam/
            location: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
            newUrlFinal: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
          --newUrlLocation
          RedirectGet:
            QuickGetToOutput_Redirect:
              newUrl: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
              qGet_1:
                simpleHttpRequest_3:
                  httpMethod: GET
                  requestUrl: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
                  Using new connection...
                  httpServer: data-cdn.mbamupdates.com
                  port: 80
                  ConnectTimeoutMs_1: 10000
                  calling ConnectSocket2
                  IPV6 enabled connect with NO heartbeat.
                  connectingTo: data-cdn.mbamupdates.com
                  dnsCacheLookup: data-cdn.mbamupdates.com
                  Resolving domain name (IPV4)
                  GetHostByNameHB_ipv4: Elapsed time: 15 millisec
                  myIP_1: 192.168.1.99
                  myPort_1: 59612
                  connect successful (1)
                  -- BuildIeGetRequest --
                  Not auto-adding cookies.
                  sendElapsedMs: 0
                  StatusCode: 200
                  StatusText: OK
                  Reading response body...
                  readResponseElapsedMs: 2122
                --simpleHttpRequest_3
              --qGet_1
            --QuickGetToOutput_Redirect
          --RedirectGet
        --simpleHttpRequest_3
      --qGet_1
    --QuickGetToOutput_Download
    DownloadNumBytes: 20447072
    bFileDeleted: 0
    totalElapsedMs: 2247
    ContentLength: 20447072
    Success.
  --Download
--ChilkatLog

++++++++++++++++++++++++++++++++++++

Failure log
ChilkatLog:
  Download:
    DllDate: Mar  6 2015
    ChilkatVersion: 9.5.0.48
    UnlockPrefix: RAGSOFHttp
    Username: SHOP2:randy
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    url: http://downloads.malwarebytes.org/file/mbam/
    toLocalPath: D:ProgrammingAppsIWroteGetToolstestcodeInstallMBAM.EXE
    currentWorkingDir: D:ProgrammingAppsIWroteGetToolstestcode
    a_httpDownload:
      httpDownloadFile:
        localFilePath: D:ProgrammingAppsIWroteGetToolstestcodeInstallMBAM.EXE
        localFileAlreadyExists: 0
        quickHttpRequest:
          httpVerb: GET
          url: http://downloads.malwarebytes.org/file/mbam/
          openHttpConnection:
            Opening connection directly to HTTP server.
            httpHostname: downloads.malwarebytes.org
            httpPort: 80
            ssl: 0
            HTTP connection succeeded.
          --openHttpConnection
          buildQuickRequest:
            genStartLine:
              startLine: GET /file/mbam/ HTTP/1.1
            --genStartLine
            addCookies:
              Not auto-adding cookies.
              sendCookies: 1
              cookieDir: 
            --addCookies
          --buildQuickRequest
          sendRequestHeader:
            sendHeaderElapsedMs: 0
          --sendRequestHeader
          statusCode: 302
          statusText: Moved Temporarily
          readResponseBody:
            contentLength: 106
          --readResponseBody
        --quickHttpRequest
      --httpDownloadFile
      getRedirectUrl:
        Location: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
        newLocation:
          url: http://downloads.malwarebytes.org/file/mbam/
          location: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
          newUrlFinal: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
        --newLocation
      --getRedirectUrl
      httpDownloadFile:
        localFilePath: D:ProgrammingAppsIWroteGetToolstestcodeInstallMBAM.EXE
        localFileAlreadyExists: 0
        quickHttpRequest:
          httpVerb: GET
          url: http://data-cdn.mbamupdates.com/v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe
          openHttpConnection:
            Using existing connection.
          --openHttpConnection
          buildQuickRequest:
            genStartLine:
              startLine: GET /v2/mbam/consumer/data/mbam-setup-2.0.4.1028.exe HTTP/1.1
            --genStartLine
            addCookies:
              Not auto-adding cookies.
              sendCookies: 1
              cookieDir: 
            --addCookies
          --buildQuickRequest
          sendRequestHeader:
            sendHeaderElapsedMs: 0
          --sendRequestHeader
          statusCode: 503
          statusText: Service Temporarily Unavailable
          readResponseBody:
            contentLength: 21
          --readResponseBody
          checkCloseConnection:
            Response includes connection:close header (or proxy-connection:close header)
          --checkCloseConnection
        --quickHttpRequest
      --httpDownloadFile
    --a_httpDownload
    totalElapsedMs: 406
    ContentLength: 21
    Failed.
  --Download
--ChilkatLog

link

answered Mar 12 '15 at 23:11

rgibson's gravatar image

rgibson
113

This problem is now fixed. Here are the new builds:

32-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-win32.zip
64-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatAx-9.5.0-x64.zip

The problem was that the redirect was to a different sub-domain (data-cdn.mbamupdates.com vs downloads.malwarebytes.org) and Chilkat needed to use a different connection.

link

answered Mar 17 '15 at 09:47

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

1

That was it! Thanks Matt superior support as always P.S. Tried to up vote but my rep is not good enough :(

(Mar 17 '15 at 13:15) rgibson

Thanks Randy! (Sorry about the forum issues -- it's mostly due to higher security due to automated spam problems, and the fact that the open-source software, OSQA, is no longer developed or supported.)

(Mar 17 '15 at 13:18) chilkat ♦♦

Hi Randy,

Please provide the contents of the LastErrorText property immediately after the failed call. A code sample could be useful too.

Also, please put the above in <pre></pre> tags to make it more readable.

link

answered Mar 12 '15 at 22:09

jpbro's gravatar image

jpbro ♦
1.1k2618

Any Ideas, Jason?, Matt?

(Mar 14 '15 at 00:48) rgibson

Unfortunately, I haven't found a solution yet, but I can confirm that I'm experiencing the same problem using your sample code. The server is responding with 503 Service Temporarily Unavailable, which to me implies that the server is making a decision not to provide the requested file for some reason. I've tried variations of MimicIe, MimicFirefox, accepting cookies, etc... but so far nothing has helped. I'm not sure what 9.5 is doing differently than 9.4, sorry!

(Mar 14 '15 at 13:15) jpbro ♦

Thanks for looking, I too tried the variations on mimicxx, cookies, timings etc. i hope Matt/Chilkat sees this and has an answer.

(Mar 14 '15 at 17:09) rgibson

Thanks! I'll have a look ASAP. I have to finish some internal re-factoring before I can look at this, which might take until late Monday or Tuesday.

(Mar 14 '15 at 17:30) chilkat ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×186
×2

Asked: Mar 12 '15 at 17:44

Seen: 1,538 times

Last updated: Mar 17 '15 at 13:18

powered by OSQA