PurePOP3 library : POP3 functions

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

The log file was generated this time - Ive sent you a PM.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote: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
So the crash occurs after PureSMTP has sent the base64 encoded username, and before it sends the base64 encoded password. Crash during 2nd base64 encode ?
I made a little change. Could you test again the beta lib ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Now it gets past #10 and displays:

Extra1

Just sent username



then...
11
Status: 2

then...
12
Message:334 UG ... Q6

then...
13
RECEIVE: 334 UG ... Q6

then...
It crashes!
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

It crashes during the 2nd base64 encoding.
Why = ???

Does this code crash under Vista ?

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 

For i = 0 To 10
  Debug Base64Encode("hello world")
Next 
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

No, that base64 test works just fine.

It crashed between #13 and #14 in the 2nd test of your library, but crashed just after #10 the first time. What else did you change at the point just after #10?

Was it just the EXTRA message?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:No, that base64 test works just fine.
It crashed between #13 and #14 in the 2nd test of your library, but crashed just after #10 the first time. What else did you change at the point just after #10?
Was it just the EXTRA message?
In the 1st version I send Username/Password, in the 2nd version I send the Username, wait for server answer and then send the Password. No other change. The extra message is displayed after password/username is sent.

I don't know what the problem is, probably like I said a strange memory management problem (why only VISTA ? ; the other crash problem it was only Win98/Me ...). I have no idea at the moment.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

If you want to PM me some source code, I can test it out and then you can see if its TailBite thats maybe causing the problem or something else?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:If you want to PM me some source code, I can test it out and then you can see if its TailBite thats maybe causing the problem or something else?
If you can reproduce that problem with PureSMTP_VISTA_TEST.exe (using authentication) then it's not a Tailbite problem (if you cannot, then it may be a Tailbite problem).
Could you test the PB3.94 library version ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

3.94 crashes at the same place

The PureSMTP_VISTA_TEST programs works, but crashes (sometimes) if you put the wrong user/password information.

Note: the crashing appears to be "random", sometimes it will produce the correct error info until you rerun the program - then it will crash at the 1st go of incorrect info.

Maybe this is because of something else?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:3.94 crashes at the same place

The PureSMTP_VISTA_TEST programs works, but crashes (sometimes) if you put the wrong user/password information.

Note: the crashing appears to be "random", sometimes it will produce the correct error info until you rerun the program - then it will crash at the 1st go of incorrect info.

Maybe this is because of something else?
Maybe. It should not crash anyway.
Does it crash under XP (with wrong password) ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

It works fine under XP.

I can get the PureSMTP_VISTA_TEST program to crash every time now. It happens when I enter the wrong password.

If you have any source for this I can try track it down.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:It works fine under XP.
Even with the wrong password ?
DoubleDutch wrote:I can get the PureSMTP_VISTA_TEST program to crash every time now. It happens when I enter the wrong password.
So it's a Vista related problem, nothing to do with Tailbite (the test executable was not built with the library) or this Purebasic version (the crash also happens with the PB3.94 library).
DoubleDutch wrote:If you have any source for this I can try track it down.
You already have :
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
With this kind of error the crash may occur far away from the initial problem. Anyway, the only thing that changes if you use authentication is the base64 encoding.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I dont have the source for PureSMTP_VISTA_TEST.pb ???
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:I dont have the source for PureSMTP_VISTA_TEST.pb ???
I meant : you already have tracked it down (error line).

I will worry about Vista compatibility when I will switch to it (if my app/lib is compatible with Win98/ME/2k/XP/2k3 it's enough for me).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

That's a pity. I would have worked with you to get yours working okay with Vista.

Looks like I may have to code my own SMTP library.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply