Welcome! Log In Create A New Profile

Advanced

smtp problems

Posted by jsmaster 
smtp problems
June 11, 2009 09:13PM
[code.google.com]
[code.google.com]
[code.google.com]

Look at char *http::readfromsocket and void email::send

I am getting null from readfromsocket when I shouldn't be. Using telnet, I can send an email using the same ip address and requests. Also, int http::localip gets messed up somehow.. Any help??
Re: smtp problems
June 12, 2009 12:00AM
On the first issue:

char *http::readfromsocket(int bufsize,const int snum){
        delete buffer;
        netstate = 4;
        buffer = new char [bufsize];
...

The buffer pointer here points to garbage on the first call to this function. You likely want to set buffer to NULL in your constructor and check for it being NULL before you call delete (although you can safely call delete with a NULL).

Michael



Edited 1 time(s). Last edit at 06/12/2009 12:42AM by Michael.
Re: smtp problems
June 12, 2009 01:46AM
I think you're looking at an old revision. Check revision 8
Re: smtp problems
June 12, 2009 02:37AM
Oh, revision 8 :-) I've been following your WiiConnect project the past few months and I must have had your older source in my browser cache.

There are two ways I see to get NULL back from readfromsocket(), either you run out of memory or net_read() returns a negative value indicating some error occurred. I would assume net_read() is the cause, but I would verify you're not getting NULL back from new.

The next thing to do is to print out the value returned by net_read(), and go look up the error code in network_wii.c in libogc. Then you'll know more about what went wrong.

Michael
Re: smtp problems
June 15, 2009 05:46PM
Thanks for the help. It's nice to see that someone is following my project!

Well I know it's not running out of memory, or else the netstate would be -10, not -40 (as I got -40 from debugging). It's just acting very strangely, as slight modifications make it work more, but not completely (eg, I was able to get the welcome message from the smtp server when the buffer size was 99). Anyway, I'll look up the error code, and keep fiddling with my code.
Sorry, only registered users may post in this forum.

Click here to login