i want to wrote my own Pop3 Server
but i first try to include some client functions for testing...
but something stange for me happens
i simply connect to my host ( (i have a comercial Pop3Server running (very well 'cause tried outlook with it and work fines)
what i don't understand is that if i run my prog (it create a logfile) it doesn't write the helo message from the server to my log and neither messagebox it...
but if i run it with my debuger prog (W32DASM 8.93) it works perfectly..
attach the archive of my prog rar format with full sourcecode
in it there is 2 archive in rar format (1 for my maildll.dll where i put lots of functions that i should need and 1 for my prog)
i use TASM5.3
so i someome can tellme what's wrong or optimise some functions i'll be so great

else if someone already had this kind of trouble and know how to correct it,it's also interresting ...
Posted on 2003-10-02 04:30:17 by Thor0Asgard
I never coded a pop3 server, but from the symptoms it sounds like a buffer overflow. I've had similar problems with another project, in particular it didn't work when using a debugger. It seems that heap corruption causes some bizarre effects, and a write past the end of an allocated memory block easily causes that. You are using GlobalAlloc, but as I read somewhere it internally ends up using heap allocations just the same.
It may not be what you need... but at least this vague hint I'm giving you is better than nothing, right? ;) :grin:
Posted on 2003-10-07 18:39:54 by QvasiModo
Hi Thor0Asgard,

I'm not too experienced in sockets programming, but look at this piece of your code

call ioctlsocket, ServsocketHandle, FIONREAD, offset Pop3available_data
mov eax,Pop3available_data
call recv,ServSocketHandle,offset tempmsg,eax,MSG_PEEK

with first call you determine the current amount of bytes in the buffer. this command is useful to determine if a following recv would be block or not. But if the amount of bytes is zero, you call recv with a buffer length of zero, which is bad. Since blocking isnt an issue in this simple test prog, I would suggest to code

call recv,ServSocketHandle,offset tempmsg,sizeof tempmsg,MSG_PEEK

(dont know if SIZEOF operator exists in TASM)

Posted on 2003-10-08 04:04:05 by japheth