Page 8 of 23
Posted: Mon Feb 12, 2007 12:00 pm
by gnozal
DoubleDutch wrote:Sorry - nothing to do with threadsafe, just a coincidence.
It's to do with authentication.
I tested your example programs:
PureSMTP_Test.pb -> works fine
PureSMTP_TEST_AUTH.pb -> crashes at PureSMTP_SendMail
Authentication uses base64 encoding ; maybe this is the problem with vista.
Could you please download the test programs again and use authentication (to enable authentication just fill the UseName/Password stringgadgets).
Posted: Mon Feb 12, 2007 12:03 pm
by DoubleDutch
This works:
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, "", Password)
This crashes:
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)
Posted: Mon Feb 12, 2007 12:04 pm
by DoubleDutch
I did fill in the password string, works fine...
Posted: Mon Feb 12, 2007 12:07 pm
by DoubleDutch
Just tested the Base64 commands in PureBasic - no crash.
Posted: Mon Feb 12, 2007 12:13 pm
by DoubleDutch
This also crashes:
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName,"")
When it crashes, it gets this far:
220 spunkymail-a11.g.dreamhost.com ESMTP
Hope this helps...
Posted: Mon Feb 12, 2007 12:13 pm
by gnozal
Could you please download the test programs again and use authentication (to enable authentication just fill the UseName/Password stringgadgets).
Posted: Mon Feb 12, 2007 12:17 pm
by DoubleDutch
Tested with your new test program.
Message sent!
Posted: Mon Feb 12, 2007 12:21 pm
by DoubleDutch
I tested again - this time putting the wrong password in by accident.
It crashed:
Error c00000005
An attempted read or write to/from an address to which theat process isn't allowed
Module: c:\purebasic400\Program\PureSMTP_VISTA_TEST.pb; Line: 416
Posted: Mon Feb 12, 2007 12:24 pm
by DoubleDutch
Trying it again, with correct info had the same error.
Posted: Mon Feb 12, 2007 12:36 pm
by gnozal
DoubleDutch wrote:Tested with your new test program.
Message sent!
That's weird ...
Maybe some strange Tailbite problem like the one with Win98 (
http://www.purebasic.fr/english/viewtop ... &start=141 )
I have uploaded
http://freenet-homepage.de/gnozal/PureSMTP_BETA.zip (standard ANSI debug lib), to be placed in the userlibraries folder.
It will create a PureSMTP_TRACE.txt log file, maybe it will help to locate the problem.
Edit (was posting while you posted)
Line 416 : FreeMemory(*B64EncodeBufferB)
Code: Select all
Procedure.s Base64Encode(strText.s)
Protected Result.s, *B64EncodeBufferA, *B64EncodeBufferB, OutputBufferLength.l, InputBufferLength.l
InputBufferLength = Len(strText)
OutputBufferLength = InputBufferLength * 2
If OutputBufferLength < 64
OutputBufferLength = 64
EndIf
*B64EncodeBufferA = AllocateMemory(InputBufferLength)
If *B64EncodeBufferA
*B64EncodeBufferB = AllocateMemory(OutputBufferLength)
If *B64EncodeBufferB
PokeS(*B64EncodeBufferA, strText) ; PokeS(*B64EncodeBufferA, strText, InputBufferLength, #PB_Ascii) if unicode
Base64Encoder(*B64EncodeBufferA, InputBufferLength, *B64EncodeBufferB, OutputBufferLength)
Result = PeekS(*B64EncodeBufferB)
FreeMemory(*B64EncodeBufferB)
EndIf
FreeMemory(*B64EncodeBufferA)
EndIf
ProcedureReturn Result
EndProcedure
Debug Base64Encode("hello world")
Could you test this code in vista ?
Posted: Mon Feb 12, 2007 12:53 pm
by DoubleDutch
Result of your test source:
aGVsbG8gd29ybGQ=
Result of the test library:
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)
I get a compilation error:
line 16: PureSMTP_SendMail(): Incorrect number of parameters.
Posted: Mon Feb 12, 2007 1:04 pm
by gnozal
DoubleDutch wrote:Result of your test source:
aGVsbG8gd29ybGQ=
So no crash ...
DoubleDutch wrote:Result of the test library:
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)
I get a compilation error:
line 16: PureSMTP_SendMail(): Incorrect number of parameters.
Oops, sorry, wrong lib version, should be fixed.
Posted: Mon Feb 12, 2007 1:14 pm
by DoubleDutch
The only crash I could get with your Base64 routine is if the input is an empty string.
The new lib compiles and generates a PureSMTP_Trace file, but the file has zero length.
Maybe if you have a dialog between each step (incrementing a number). I can tell you which number it stops on?
Posted: Mon Feb 12, 2007 1:32 pm
by gnozal
DoubleDutch wrote:The new lib compiles and generates a PureSMTP_Trace file, but the file has zero length.
Works here ... !
DoubleDutch wrote:Maybe if you have a dialog between each step (incrementing a number). I can tell you which number it stops on?
Ok, I have uploaded a version with MessageRequester.
I need the message more than the number to locate the problem.
Posted: Mon Feb 12, 2007 1:44 pm
by DoubleDutch
The last message that is okay is #10
SEND: YW50aG9 ... NvbQ==
(the ... is me, it didn't display this).
After #10 it crashed.
In case you need to know, message 9, it was:
RECEIVE: 334 VXNI .... WU6