EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Another Indy question

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#20915
Posted: 07/28/2012 15:44:12
by Ciaran Costelloe (Standard support level)
Joined: 07/10/2009
Posts: 26

Hi.

Consider the following in SBIndyIOHandler10.pas:

Code
// Please uncomment the following conditional define if you are using
// Indy 10.1.1 to 10.5.5
{.$define INDY1011}
// Please uncomment the following conditional define if you are using
// Indy 10.2.3 or higher
{$define INDY1023}
// Please uncomment the following conditional define if you are using
// Indy 10.5.5 (coming with RAD Studio 2010) or higher
{$define INDY1055}

{$ifdef INDY1011}
  {$undef INDY_RECVENC}
  {$undef INDY_WD_CONST}
  {$define INDY_WD_VAR}
{$else}
{$ifdef INDY1023}
  {$define INDY_RECVENC}
  {$undef INDY_WD_CONST}
  {$undef INDY_WD_VAR}
{$else}
  {$undef INDY_RECVENC}
  {$undef INDY_WD_CONST}
  {$undef INDY_WD_VAR}
{$endif}
{$endif}

From the comments, and since I am using Indy 10.5.8.0, I should comment out {.$define INDY1011} but leave INDY1023 and INDY1055 defined.  However, when you examine the ifdefs, the last $else block will never get executed by anybody.  So either I should comment out the {$define INDY1023} or else the ifdef block needs to be rewritten as:

{$ifdef INDY1011}
  {$undef INDY_RECVENC}
  {$undef INDY_WD_CONST}
  {$define INDY_WD_VAR}
{$else}
  {$ifdef INDY1055}
    {$undef INDY_RECVENC}
    {$undef INDY_WD_CONST}
    {$undef INDY_WD_VAR}
  {$else}
    {$ifdef INDY1023}
      {$define INDY_RECVENC}
      {$undef INDY_WD_CONST}
      {$undef INDY_WD_VAR}
    {$endif}
  {$endif}
{$endif}


I initially thought to just comment out INDY1023, but it is in another ifdef near the end of the code. What is the correct approach?
#20916
Posted: 07/29/2012 01:31:26
by Eugene Mayevski (EldoS Corp.)

Your defines (first lines) don't seem to be uncommented right. What exactly version of Indy do you have?

On a side note, please use CODE button to mark code blocks. I've done this for you now.


Sincerely yours
Eugene Mayevski
#20922
Posted: 07/29/2012 06:47:10
by Ciaran Costelloe (Standard support level)
Joined: 07/10/2009
Posts: 26

I think I have managed to confuse you, sorry. I have not commented out the defines yet - the first section of code is straight from SBIndyIOHandler10.pas. Did not notice the CODE button, and your reformatting puts my question in the code block (and my stating that I was using Indy 10.5.8.0). The following is a reformatted version of my question.

Code
1.// Please uncomment the following conditional define if you are using
2.// Indy 10.1.1 to 10.5.5
3.{.$define INDY1011}
4.// Please uncomment the following conditional define if you are using
5.// Indy 10.2.3 or higher
6.{$define INDY1023}
7.// Please uncomment the following conditional define if you are using
8.// Indy 10.5.5 (coming with RAD Studio 2010) or higher
9.{$define INDY1055}
10.
11.{$ifdef INDY1011}
12.  {$undef INDY_RECVENC}
13.  {$undef INDY_WD_CONST}
14.  {$define INDY_WD_VAR}
15.{$else}
16.{$ifdef INDY1023}
17.  {$define INDY_RECVENC}
18.  {$undef INDY_WD_CONST}
19.  {$undef INDY_WD_VAR}
20.{$else}
21.  {$undef INDY_RECVENC}
22.  {$undef INDY_WD_CONST}
23.  {$undef INDY_WD_VAR}
24.{$endif}
25.{$endif}


From the comments, and since I am using Indy 10.5.8.0, I should comment out {.$define INDY1011} but leave INDY1023 and INDY1055 defined. However, when you examine the ifdefs, the last $else block will never get executed by anybody. So either I should comment out the {$define INDY1023} or else the ifdef block needs to be rewritten as:

Code
29.{$ifdef INDY1011}
30.  {$undef INDY_RECVENC}
31.  {$undef INDY_WD_CONST}
32.  {$define INDY_WD_VAR}
33.{$else}
34.  {$ifdef INDY1055}
35.    {$undef INDY_RECVENC}
36.    {$undef INDY_WD_CONST}
37.    {$undef INDY_WD_VAR}
38.  {$else}
39.    {$ifdef INDY1023}
40.      {$define INDY_RECVENC}
41.      {$undef INDY_WD_CONST}
42.      {$undef INDY_WD_VAR}
43.    {$endif}
44.  {$endif}
45.{$endif}


I initially thought to just comment out INDY1023, but it is in another ifdef near the end of the code. What is the correct approach?
#20923
Posted: 07/29/2012 07:49:36
by Eugene Mayevski (EldoS Corp.)

The code above worked for all users no matter what version of Indy they had. I'd like to offer you to try to compile and install packages, and *then*, if something doesn't work, then we start solving your particular problem.


Sincerely yours
Eugene Mayevski
#20924
Posted: 07/29/2012 08:05:24
by Eugene Mayevski (EldoS Corp.)

Just tested installing components to Delphi XE2 with both {$define INDY1023} and {$define INDY1055} defined (just as written in the comments) and this worked for me.


Sincerely yours
Eugene Mayevski
#20925
Posted: 07/29/2012 18:59:36
by Ciaran Costelloe (Standard support level)
Joined: 07/10/2009
Posts: 26

That is good news, thanks for the inconvenience in trying it out. It does not bother me, but that means that it is irrelevant whether you use {$define INDY1055} or not (unless it affects some file in the "uses"). In particular, in the {$ifdef} that follows it, the following block can never be executed:

Code
  {$undef INDY_RECVENC}
  {$undef INDY_WD_CONST}
  {$undef INDY_WD_VAR}


Anyway, it does not bother me, I just thought I would point it out. I will continue on, if I do find something I will let you know (I will be using it to add SSL support to an IMAP application that uses TIdIMAP4, and later add SSL to an application that uses TIdTcpClient and TIdTcpServer - my attempts using Indy's SSL IOHandler failed frustratingly, mainly because I could find no reason for why connection attempts failed!).

Thanks for all the effort.

Ciaran
#20930
Posted: 07/30/2012 19:55:59
by Ciaran Costelloe (Standard support level)
Joined: 07/10/2009
Posts: 26

Sorry, I have tried various options, but cannot install your Indy SSL components
using SSLBBoxSrvIndy10D11.dpk and SSLBBoxCltIndy10D11.dpk.
In both the following cases, I don't define INDY1011 but do define INDY1055.

If I DONT define INDY1023, I get a number of errors, the first being the error:
[DCC Error] SBIndyIOHandler10.pas(526): E2170 Cannot override a non-virtual method
...on line 526:
function ReadFromSource(ARaiseExceptionIfDisconnected: Boolean = True;
ATimeout: Integer = IdTimeoutDefault;
ARaiseExceptionOnTimeout: Boolean = True): Integer; override;

If I DO define INDY1023, I get only one error:
[DCC Error] SBIndyIOHandler10.pas(682): E2009 Incompatible types: 'Parameter lists differ'
...on line 682:
FSecureClient.OnReceive := OnSecureClientReceive;
(the last param, Written, is an integer on the left-hand side but an integer@ on the right-hand side).

By the way, I had to manually edit both
SSLBBoxSrvIndy10D11.dpk and SSLBBoxCltIndy10D11.dpk and change the 100
references to 110 (eg IndyProtocols100 to IndyProtocols110). It is probably irrelevant because I got the same results whether I first installed Indy's 100 versions or 110 versions.

Anything else I can try?
Ciaran
#20931
Posted: 07/31/2012 01:43:58
by Eugene Mayevski (EldoS Corp.)

Do you have custom version of Indy installed? From your posts it looks like your version of Indy is newer than the one that came with Indy. Where did you download that particular version?


Sincerely yours
Eugene Mayevski
#20939
Posted: 07/31/2012 14:57:44
by Ciaran Costelloe (Standard support level)
Joined: 07/10/2009
Posts: 26

Yes, I have Indy version 10.5.8.0 installed (looks like it was created by Indy in 1st October 2010). Because of that, I commented out //{$define Delphi_2007_default_packages} in both SSLBBoxCliIndy10D11.dpk and SSLBBoxSrvIndy10D11.dpk. They are referencing IndyCore/System/Protocols110.dcp.

They are installed in CodeGear RAD Studio (2007).

After I got the error, I uninstalled both SecureBlackBox and Indy and re-installed everything, in case it was some silly installation error.

Ciaran
#20955
Posted: 08/01/2012 06:16:59
by Eugene Mayevski (EldoS Corp.)

Your IDE attempts to compile SecureBlackbox code against Indy included with Delphi 2007. I had the same problem and when I removed default Indy path from library paths in IDE Options (not in project settings!), Indy files became "not found" and after specifying right paths the code of SecureBlackbox IOHandlers was compiled fine. Almost - there's one minor glitch that happened in build 215 and was fixed for SBB 10. In brief - when the error happens you'll need to cast the value from TCustomCertStorage to TElMemoryCertStorage.


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 7966 times

Number of guests: 2, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!