socket handling/libURL changed between 4.0 and 4.6?

Bernard Devlin bdrunrev at gmail.com
Sat Apr 9 15:23:07 EDT 2011


I have some very simple code that works in 4.0 (on both Linux and
Windows), but which fails on 4.6.  The code posts XML to a webserver
and now fails on both Linux and Windows using 4.6.  It is making
PROPFIND requests to a webdav server.  But fundamentally it is just
HTTP request/response, and should work in 4.6 just as it works in 4.0.

The problem manifests itself as a socket timeout on 4.6, but there is
not timeout on 4.0.  The normal response times from the server are in
a sub-4000 ms range, but even if I set the socketTimeoutInterval to
30000 ms, the code fails with a socket timeout. Reverting back to 4.0,
and the same code works in a sub-4000 ms range with no timeout.

on mouseUp
   resetAll
   put fld "request" into tXml
   libURLSetCustomHTTPHeaders (fld "headers")  -- headers contains
PROPFIND method
   put "http://192.168.0.202:1980/" into tURL
   try
      wait 50 milliseconds with messages
      post tXml to URL tURL
   catch tError
      put "error" && tError
   finally
      put the long time & cr & it & cr & the result into fld "response"
      put the long time & cr &  libUrlLastRhHeaders() into fld "ResponseHeaders"
   end try
end mouseUp

The server has not changed, and I've tried alternatiing repeatedly
between 4.0 and 4.6, and the problem is there consistently with 4.6
and not at all with 4.0.

I see in 4.5 there was a change to DNS resolution, so I tried adding a
manual entry to my hosts file, but even though a browser can resolve
the ip address from the hostname, Livecode still fails. With
Revolution 4.0, it works with either IP address or a hostname resolved
via lookup to the hosts file.

I also put a HTTP inspector between the IDE and the server.  After
setting the httpProxy, with 4.0 I can intercept the calls to the
server and view them; but with 4.6 they do not even reach the HTTP
inspector.

I tried setting up libURL logging using:

 libUrlSetLogField ("field" && quote & "LogField" & quote)

but it didn't make any difference - logging doesn't seem to work on 4.0 or 4.6.

I tried putting breakpoints inside the libURL handlers themselves, but
they never seem to get triggered - not even on 4.0 where the "post to
URL" is working.  Is there something I'm missing in how one should be
able to step into the libURL code?

Bernard Devlin




More information about the Use-livecode mailing list