Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:33
    LongDelphiHalfLife commented #192
  • Aug 09 15:09
    rlebeau commented #192
  • Aug 09 10:32
    BrewIntegration commented #192
  • Aug 04 07:49
    baka0815 commented #299
  • Jul 30 03:38
    corneliusdavid opened #424
  • Jul 29 19:25
    corneliusdavid commented #418
  • Jul 29 08:16
    ThomasLevering commented #418
  • Jul 28 16:07
    corneliusdavid closed #418
  • Jul 28 16:07
    corneliusdavid commented #418
  • Jul 27 18:55
    Blackbird700 commented #419
  • Jul 27 17:27
    rlebeau edited #422
  • Jul 27 17:23
    rlebeau commented #419
  • Jul 27 17:21
    rlebeau commented #419
  • Jul 27 00:56
    Blackbird700 commented #419
  • Jul 27 00:36
    rlebeau commented #419
  • Jul 27 00:24
    rlebeau commented #419
  • Jul 26 18:39
    Blackbird700 commented #419
  • Jul 26 15:08
    rlebeau edited #133
  • Jul 25 17:27
    rlebeau commented #419
  • Jul 25 17:13
    rlebeau commented #419
Jeroen Wiert Pluimers
@jpluimers
I was afraid so. No problem: thanks for confirming.
Walter Prins
@ByteJuggler

With apologies in advance for the lengthy post, I'm hoping someone more immediately familiar with the ins and outs of Indy and how its used by Datasnap can point me in the right direction.

I'm trying to make a Datasnap server serve a file with RESUME support. Just making it serve a file is relatively trivial obviously, just add a TDSHttpServiceFileDispatcher component and attach to the TDSHTTPService. However the default service does not appear to support "RESUME" as pausing and resuming a download with (for example) the "DownThemAll" Firefox downloader in fact restarts the download.

In this context, I've found the following post by Remy on SO: http://stackoverflow.com/questions/21494524/indy-http-server-with-resume-support which implies that, at least for Indy, this is the default behaviour and that to support RESUME one has to intercept the GET request and interpose a TIdHTTPRangeStream object if ARequestInfo.Ranges.Count > 0.

Now as Datasnap is based internally on Indy, I'm hoping that I might apply the same approach but it's not entirely clear what the most appropriate place to do so is, as Datasnap abstracts away Indy as an implementation detail in many places and as a result the Indy "Ranges" property is not always available. when you seemingly want/need it.

Based on tracing the Datasnap code my current plan was to patch unit Datasnap.DSHTTP, method TIndyDispatchFileRequest.SetContentStream(AStream: TStream) on line 1555 to essentially do as suggested in the SO post. However the FRRequestInfo object present inside TIndyDispatchFileRequest at that point is not in fact the TIdHTTPRequestObject (that has a Ranges member), and it's not immediately obvious how one might get at it, so I'm wondering whether this is fundamentally perhaps the wrong place/way to tackle this problem.

Question: What is the right approach to tackle this problem? (One other thought I had was to patch IdCustomHTTPServer.DoCommandGet to interrogate the ARequestInfo and AResponseInfo after calling FOnCommandGet...)

(To add: Eventually I'd like to implement a file download using resume support in a Delphi client, as outlined in the following SO question: http://stackoverflow.com/questions/2963246/download-pause-and-resume-an-download-using-indy-components)

Walter Prins
@ByteJuggler
(Using Delphi 10 Seattle)
Remy Lebeau
@rlebeau
@ByteJuggler DataSnap may use Indy internally, but it is not based on Indy. In fact, in recent Delphi versions, Embarcadero has been slowly moving away from Indy in their technologies, like DataSnap, towards their own custom platform-native solutions. That being said, I don't know or use DataSnap, so I could be missing something, but since Indy is being used behind an abstraction layer, I don't see a way to get direct access to Indy's Request/Response objects from DataSnap's wrappers.
Remy Lebeau
@rlebeau
@ByteJuggler looking into it deeper, I just now found that DataSnap's TDSHTTPResponseIndy class has a public ResponseInfo property that is an IPPeerAPI.IIPHTTPResponseInfo interface, which has a public GetObject() method. DataSnap's IPPeerServer.TIdHTTPResponseInfoPeer class implements IIPHTTPResponseInfo, where its GetObject() implementation returns Indy's TIdHTTPResponseInfo object from TIdHTTPServer. But TIdHTTPResponseInfoPeer is a private class in the IPPeerServer unit's implementation section, so you can't access it. But if you manually declare an equivilent class in your own code, you might get away with a type-cast hack to access the Indy object.
Ludwig Behm
@lbehm
I basically intercepted in DoCommandGet and stored the TIdHTTPRequestInfo and TIdHTTPResponseInfo in a __thread local variable, which I can use in my DS ServerMethods
Ludwig Behm
@lbehm
I wrote a replacement for TIdHTTPWebBrokerBridge, removed the WebModule, implemented my own FileDispatcher (based on Indy infrastructure not embarcaderos inet*.bpl) and handle DataSnap related requests to TDSRESTWebDispatcher::DispatchRequest manually
at least serving static files is quite a bit faster now ;)
Jeroen Wiert Pluimers
@jpluimers
Interesting. Is the code public?
Ludwig Behm
@lbehm
@jpluimers If you mean my code, no, not yet
Jeroen Wiert Pluimers
@jpluimers
Let us know if/when.
Mauro Botta
@maurobotta
@rlebeau Hi Remy, Have you any update for TLS 1.2 support of Indy ?

from EMB forum : https://forums.embarcadero.com/thread.jspa?messageID=870089&#870089

Apple will require TLS v 1.2 from 1 Jan 2017, Delphi don't support it ( DataSnap - App ), are there any workaround ?
I need that DataSnap TCP mode ( standalone .exe server ) support TLS 1.2 on Berlin Update 2
Remy thank you for Indy support, Are there any update for it ?

Any link:

https://techcrunch.com/2016/06/14/apple-will-require-https-connections-for-ios-apps-by-the-end-of-2016/
https://plus.google.com/103013776067604117964/posts/b3Si46bjnwA
https://indy.fulgan.com/indy10.changelog.txt

Ludwig Behm
@lbehm
@maurobotta Are we talking about HTTPS? If so, it should be possible.
I don't know about Delphi, but in C++ (Berlin Update1) I simply set ((TIdServerIOHandlerSSLOpenSSL*) Server->IOHandler)->SSLOptions->SSLVersions = TIdSSLVersions(32);
Ohh do you mean direct TCP-Socket-Connections on port 211? I think Apple only cares about HTTPS. So you should be fine
Remy Lebeau
@rlebeau
@maurobotta Indy has supported TLS 1.2 for awhile now. If Embarcadero does not use TLS 1.2 in DataSnap, that is on them.
@devimplode SSLVersions = TIdSSLVersions(32); is not good syntax to use, it is dependant on an implementation detail of how Sets are laid out in memory. You should use SSLVersions = TIdSSLVersions() << sslvTLSv1_2; instead
Ludwig Behm
@lbehm
@rlebeau I tried that... (yes I read the manual =D ) but didn't get it to work. Does my attempt create problems in the memory?
Remy Lebeau
@rlebeau
@devimplode the syntax I showed works fine. Your type-cast will technically work, no problem with memory, but it isn't very readable or well known. I didn't even know Set had a constructor like that until I just now looked at it.
Ludwig Behm
@lbehm
@rlebeau thanks for the infos!^^ The goal was to make it configurable. My result:
_SSLProtocols_ = 0;
TStringList *protoList = new TStringList('"', ':');
protoList->DelimitedText = "tlsv1:tlsv1_1:tlsv1_2";
if (protoList->IndexOf("ssl2") >= 0)
    _SSLProtocols_ = _SSLProtocols_ | 1 /*((int)Idsslopenssl::TIdSSLVersion::sslvSSLv2)*/;
if (protoList->IndexOf("ssl3") >= 0)
    _SSLProtocols_ = _SSLProtocols_ | 2 /*((int)Idsslopenssl::TIdSSLVersion::sslvSSLv3)*/;
if (protoList->IndexOf("tlsv1") >= 0)
    _SSLProtocols_ = _SSLProtocols_ | 8 /*((int)Idsslopenssl::TIdSSLVersion::sslvTLSv1)*/;
if (protoList->IndexOf("tlsv1_1") >= 0)
    _SSLProtocols_ = _SSLProtocols_ | 16 /*((int)Idsslopenssl::TIdSSLVersion::sslvTLSv1_1)*/;
if (protoList->IndexOf("tlsv1_2") >= 0)
    _SSLProtocols_ = _SSLProtocols_ | 32 /*((int)Idsslopenssl::TIdSSLVersion::sslvTLSv1_2)*/;

SSLHandler->SSLOptions->SSLVersions = TIdSSLVersions(_SSLProtocols_);
Remy Lebeau
@rlebeau
This is the intended way to use it:
TIdSSLVersions _SSLProtocols_;
...
_SSLProtocols_ = TIdSSLVersions();
TStringList *protoList = new TStringList('"', ':');
protoList->DelimitedText = "tlsv1:tlsv1_1:tlsv1_2";
if (protoList->IndexOf("ssl2") != -1)
    _SSLProtocols_ << sslvSSLv2;
if (protoList->IndexOf("ssl3") != -1)
    _SSLProtocols_ << sslvSSLv3;
if (protoList->IndexOf("tlsv1") != -1)
    _SSLProtocols_ << sslvTLSv1;
if (protoList->IndexOf("tlsv1_1") != -1)
    _SSLProtocols_ << sslvTLSv1_1;
if (protoList->IndexOf("tlsv1_2") != -1)
    _SSLProtocols_ << sslvTLSv1_2;

SSLHandler->SSLOptions->SSLVersions = _SSLProtocols_;
Ludwig Behm
@lbehm
yep, it works now - thank you @rlebeau !
Ludwig Behm
@lbehm
when we're talking about ssl... how hard would it be to implement ocsp stapling? =)
Remy Lebeau
@rlebeau
@devimplode never heard of it
Jeroen Wiert Pluimers
@jpluimers
@rlebeau https://en.wikipedia.org/wiki/OCSP_stapling a mechanism for checking the revocation of certificates.
Ludwig Behm
@lbehm
@rlebeau OCSP is the replacement for CRL. The basic concept is that the user-agent looks in the certificate definition, finds a OCSP server address, and asks them if the certificate is still valid.
Now we have the problem, that these OCSP servers haven't that great uptime. Here comes OCSP Stapling to the rescue: It's basically a TLS extension in the HTTPS connection. The HTTPS web server checks it's certificates for an OCSP server. If found, then he, the web server, asks the OCSP server every now and then for the validity of the certificate (signed with a timestamp from the CA), and passes it to the user-agent when a connection is established.
If everything works well the user-agents finds that signed OCSP-response and doesn't have to query and wait for a response from a hard-to-reach 3rd party.
Btw: It also improves user privacy - the 3rd party (CA/OCSP server) can't see anymore which server is browsed.
Ludwig Behm
@lbehm
I already looked at some implementations in nginx and openssl s_server.... and gave up - that's just very strange stuff in openssl...
Remy Lebeau
@rlebeau
@devimplode Indy does not currently support OCSP stapling, but it might be doable, at least client-side: http://stackoverflow.com/a/11591672/65863
Mr Jayme Jeffman
@jjeffman
Hello Remy. I have just reinstalled Indy10 on C++Builder 6.0 Pro, but after adding the bpl packages they disappear after closing the IDE, Is there any Indy forum active for browsing old posts ?
Remy Lebeau
@rlebeau
@jjeffman there used to be an Indy forum at http://forums2.atozed.com, but the server crashed a few months ago and the forum has not been brought back online yet. What you describe is not specific to Indy, though. Did you install the packages while another project was also open in the IDE? If so, the packages would be associated with that project. Make sure to install the packages when no other projects are open. Also check the Registry to make sure the packages are not disabled.
Mr Jayme Jeffman
@jjeffman
There was no any other project opened. I have separated the files which where placed on C6 into its file types at $(BCB)\Components\Indy10. I have put the .lib and .bpi files in Indy\Lib; the .bpl files in Indy\Bin; the .hpp files in Indy\Include; When I install the packages and after load an application which use Indy components it compiles normally. But the components are not kept on the ide if I close BCB.
Mr Jayme Jeffman
@jjeffman
@rlebeau I have alse taken ownership (Windows10) from all the folders and files where C++Builder is installed, but the components still are not present when the C++Builder IDE is opened. I have been getting the "file not found" error.
Mr Jayme Jeffman
@jjeffman
@rlebeau I have just succeeded on keeping the components in the palette. I had to copy the bpl files to the $(BCB)\Bin folder. Thank you very much indeed.
Remy Lebeau
@rlebeau
@jjeffman they don't belong in the $(BCB)\bin folder, only the IDE's own files should be in there. Since you are using non-standard folders for the output, did you add your folders to the IDE's includes and library paths? See http://stackoverflow.com/questions/23674831/
Mustafa Şengül
@semusta
hi guys
is there indy documentaion for c++ builder links ? ty
PaulRedkite
@PaulRedkite
Hi All,
PaulRedkite
@PaulRedkite
Hi All, I am attempting to install Indy 10 into Delphi 2009 on a Windows 10 machine. I am able to compile all of the various DPK files with no problems, but am getting an issue when I try to install the 2 compiled BPL files into the component library. The error is, The procedure entry point @Ididn@intialization$qqrv could not be located in the dynamic link library c:\program files (x86)\codegear\ rad studio\6.0\bin\dclIndyCore120.bpl. Is anyone aware of any specific issues with Windows 10. I have successfully installed done this before in Delphi 9, but on a Windows 7 PC.
Kudzu
@czhower
You likely have old copies of indy or more than one version lying around. you need to search and destroy them.
Remy Lebeau
@rlebeau
@PaulRedkite did you first remove the Indy version that ships pre-installed in the IDE?
@semusta http://indyproject.org/Sockets/Docs/index.aspx, though some of it is a bit dated. There is nothing specific to C++Builder, though. Indy works the same in Delphi and C++, it is just a matter of the different code syntax between the two languages.
souch
@souch
Hi, I think I found a small bug in indy. As I don't know were to send it, I put it here directly. When using Indy on Android with delphi seattle, timeout seems buggy : I think the problem lies here : IdGlobal.Ticks64 function never initialize the "tv" struct as gettimeofday is not called (neither USE_BASEUNIX nor KYLIXCOMPAT is defined).
Remy Lebeau
@rlebeau
Doed Android provide gettimeofday() or clock_gettime()? Are either available in Delphi on Android?
Remy Lebeau
@rlebeau
Android runs on top of Linux, so I wonder if enabling {$DEFINE USE_clock_gettime} at the top of the implementation section of IdGlobal.pas would work when {$IFDEF ANDROID} is true
Hugo Luiz Cruz
@hugoluiz
Hi All, I'm trying install the last Indy10 version on Delphi Berlin but when I try to compile I am getting this message: [Fatal Error] Cannot compile package 'IndySystem240' which is currently required by Delphi 10.1 Berlin. I am missing some thing ?
Remy Lebeau
@rlebeau
@hugoluiz Are there other errors before that one? Did you remove the pre-installed version of Indy first?
ntsmkfob
@ntsmkfob
Hi all, up to now, we've used Indy to send email to our sports club members using our ISP (BT Business). We would send an email containing 20 BCCs and throttle the throughput to keep in the ISPs volume limits per hour. That went out of the window when they switched to using Outlook.com to host their emailing. We've switched to using an SMTP service (AuthSMTP) who recommend sending individual emails, no BCC. The old way had a fair processing overhead, but that didn't matter as there would be a minimum of 10 secs interval between emails. Now I want to basically loop through the recipient list as fast as possible - basically Connect, loop through list clearing and building headers, Send and finally Disconnect., rather than Connect, Send one email, Disconnect and loop. Am I digging a hole for myself?
Marcelo Lauxen
@marcelolx
Hey people, i have a doubt
specifically at the TIdFTP component on the palette Indy Clients, Delphi XE2
I intend to to upload and download files from my ftp server, and keep the file modification date, is it possible?