Frage

I have done all the searching and can't find a solution to this weird problem that's been bugging me for about 5 hours. I started this app in Lazarus, but then took it across to D5pro to see if I could solve the problem. Thought it might have been a Lazarus "thing."

In D5, I have an app fully-working (so far so good) and I decided to try some different approaches to the look and feel so I "Save Project As" into a new folder. I then went through all of the included Units and saved them to the new Folder. I copied the two OpenSSL .DLL to the new folder. Did a compile and run and it all works fine. Well, almost.

When I tried the new app, the POP3 Unit crashes at "Login"

I have stepped through and all of the basic login stuff, Server, Name, SSL parameters etc is identical to the former version.

I went back to the original app and did a full Build and it still worked fine. I did a full Build on the new app and it still crashes at Login.

It gets through the pop3.Sock.SSLDoConnect() OK, but comes back from pop3.Login() with an error 10061 which according to the BlckSock Synapse-Unit, means "Connection refused."

When it returns from this call Result:=ssConnect(s, @name, SizeOfVarSin(name)); which I assume is in the .DLL it has a Result of -1 which then triggers the GetLastError and that is "10061 - Connection refused"

As far as I can find, everything is identical between the two projects. All Library Paths are in the Environment and not within the project.

Any thoughts and suggestions?

War es hilfreich?

Lösung 2

OK, problem solved.

Sir Rufo, it was a good idea but it did not help, but thanks for trying.

I had copied the ssleay32.dll into the new app folder BEFORE I started compiling. It did not work. I did a full Build and it still did not work.

I decided to delete the ssleay32.dll and libeay32.dll and do a full Build. I ran it and of course it crashed, but this time I expected that.

I then copied the two .ddl back into the new app folder and did another full Build.

Bingo problem solved. Seems weird but it is working with both Lazarus and D5. Something to do with the way the .dll gets linked into compiled .dcu.

Doing the Build with no .dll available cleared that. Dropping the .dll back into the Folder and another Build got the .dll linking correctly included into the .dcu.

Aaarrggghhhhh :)

Andere Tipps

There is not much to work with. Can you see all parameters in the debugger on the various external call moments?

A change of compiler of course can make hidden bugs come to the surface, just like e.g. optimization. A well known difference is that the life time of temps might vary (see here).

Probably you need to nail the defining difference first. As with Delphi, the debugger is your friend here.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top