These are chat archives for IndySockets/Indy

12th
Feb 2016
Ludwig Behm
@lbehm
Feb 12 2016 08:36
sure, I used Restler by myself for other projects
as mentioned above we'r trying to extend a (kind of legacy) c++builder based application and started already with Datasnap (don't know if this was the right decision)
davidpn
@davidpn
Feb 12 2016 09:46
Remy, when you're around: I've modified the Indy code to return the last error when dlopen returns a 0 handle, and it says "No such file or directory".. which is odd because TFIle.Exists on the same file returns true
unless there is a problem with Exists :-/
oh wait.. that's the last error.. sheesh
Matthijs ter Woord
@mterwoord
Feb 12 2016 09:48
@davidpm you get dll loading issues?
davidpn
@davidpn
Feb 12 2016 09:48
<slinks away>
this is dylib.. in the simulator
iOS
Matthijs ter Woord
@mterwoord
Feb 12 2016 09:49
ok, well dyamic lib loading
version mismatch/bitness mismatch?
davidpn
@davidpn
Feb 12 2016 09:49
thats what I'm trying to work out
davidpn
@davidpn
Feb 12 2016 09:56
ok.. so it returns the same error for each attempt anyway
Remy Lebeau
@rlebeau
Feb 12 2016 16:35
what is the actual file path being passed to dlopen()? and which lobrary is Indy failing to load?
m-baumgartner
@m-baumgartner
Feb 12 2016 17:36
Hello,
I'm searching for help here. We're having an issue with Indy 10 VCL. We switched from Delphi XE8 to Delphi Seattle and we're having an issue with TIdAppResponse.Create. Apparently the line 'ContentType := 'text/html'; {do not localize}' has been commented recently.
This also let the CharSet blank. This makes Datasnap fail in some conversions in 'TDSJsonResponseHandler.PopulateResponse'
Any idea how we could fix this? Maybe by setting the Charset in code? if so how?
If we un-comment the line 'ContentType := 'text/html'; {do not localize}' it works just fine
davidpn
@davidpn
Feb 12 2016 21:11
/usr/lib/libcrypto
the file exists.. I even used NSFileManager to check
davidpn
@davidpn
Feb 12 2016 21:45
I've also attempted to use static binding to .a files built for the simulator.. (had to modify the .inc files to cater for it).. in that case it gives me a sigsev
davidpn
@davidpn
Feb 12 2016 21:53
oh.. just discovered DCCIOS32 doesn't do static binding... sheesh
davidpn
@davidpn
Feb 12 2016 22:33
...or at least someone in a ng post said that..
I wrote a test app for simulator that would list all the files in /usr/lib (there's many).. then I attempted to load one using SafeLoadLibrary.. some would load, some wouldn't, including libcrypto and libssl
davidpn
@davidpn
Feb 12 2016 22:41
D'Oh.. forgot about dlerror. Result is: dlopen(/usr/lib/libcrypto.dylib, 1): no suitable image found. Did find: /usr/lib/libcrypto.dylib: mach-o, but not built for iOS simulator
so that explains that
Remy Lebeau
@rlebeau
Feb 12 2016 22:57
@m-baumgartner : the ContentType is commented out on purpose. Did you read the comment in the source code? "RLebeau 8/13/2015: no longer setting a default ContentType here. Doing so sets a default CharSet, which would get carried over if the user assigns a new non-text ContentType without an explicit charset. TAppResponse does not expose access to the FResponseInfo.CharSet property. For example, if the user sets TAppResponse.ContentType to 'image/jpeg', the resulting Content-Type header woud be 'image/jpeg; charset=ISO-8859-1', which can cause problems for some clients. Besides, TIdHTTPResponseInfo.WriteHeader() sets the ContentType to 'text/html; charset=ISO-8859-1' if no ContentType has been provided but there is ContentText/ContentStream data, so this is redundant here anyway..." If you want your response to use a specific charset, set a ContentType that includes a charset attribute, ie: Response.ContentType := 'text/json; charset=utf-8, though you really should be using application/json, which does not have a charset attribute. If TDSJsonResponseHandler is having a problem handling this, then that is an Embarcadero issue.