--- parser3/src/classes/smtp/Attic/smtp.C 2001/04/10 06:57:23 1.2 +++ parser3/src/classes/smtp/Attic/smtp.C 2002/02/08 07:27:42 1.8 @@ -1,18 +1,16 @@ /** @file Parser: SMTP sender. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - - Author: Alexander Petrosyan (http://design.ru/paf) - - $Id: smtp.C,v 1.2 2001/04/10 06:57:23 paf Exp $ + Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://paf.design.ru) + $Id: smtp.C,v 1.8 2002/02/08 07:27:42 paf Exp $ Parts of the code here is based upon an early gensock and blat */ -#include "smtp.h" #include "pa_exception.h" +#include "smtp.h" SMTP::SMTP(Pool& pool, const String& aorigin_string) : Pooled(pool), origin_string(aorigin_string) { @@ -58,7 +56,7 @@ ConnectToHost(const char *hostname, cons CloseConnect(); - THROW(0, 0, + throw Exception(0, 0, &origin_string, "connect to %s:%s failed", hostname, service); @@ -224,7 +222,7 @@ SendLine(const char *data, unsigned long while( length > 0 ) { if( SOCKET_ERROR == select(0, NULL, &fds, NULL, &timeout) ) - THROW(0, 0, + throw Exception(0, 0, &origin_string, "connection::put_data() unexpected error from select: %d", WSAGetLastError()); @@ -249,7 +247,7 @@ SendLine(const char *data, unsigned long break; default: - THROW(0, 0, + throw Exception(0, 0, &origin_string, "connection::put_data() unexpected error from send(): %d", ws_error); @@ -323,7 +321,7 @@ SendSmtpError(const char * message) SendLine("QUIT\r\n", 6); CloseConnect(); - THROW(0, 0, + throw Exception(0, 0, &origin_string, "failed: %s", message); } @@ -415,7 +413,7 @@ open_socket( const char *server, const c ConnectToHost(server, service); if( gethostname(my_hostname, sizeof(my_hostname)) ) - THROW(0, 0, + throw Exception(0, 0, &origin_string, "lookup of '%s' failed", my_hostname); } @@ -466,7 +464,7 @@ prepare_message(char *from, char *to, co SendLine(out_data, lstrlen(out_data) ); if( 250 != get_line() ) - THROW(0, 0, + throw Exception(0, 0, &origin_string, "The mail server doesn't like the name %s. Have you set the 'To: ' field correctly?", ptr);