--- parser3/src/classes/mail.C 2003/02/03 11:40:56 1.88.2.2 +++ parser3/src/classes/mail.C 2003/02/04 15:15:02 1.88.2.5 @@ -5,9 +5,10 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_MAIL_C="$Date: 2003/02/03 11:40:56 $"; +static const char* IDENT_MAIL_C="$Date: 2003/02/04 15:15:02 $"; #include "pa_config_includes.h" +#include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" @@ -266,7 +267,7 @@ static const String& message_hash_to_str } } else throw Exception("parser.runtime", - &method_name, + method_name, "has no $body"); return result; @@ -283,13 +284,13 @@ static void sendmail(Request& r, const S const char* exception_type="email.format"; if(!from) // we use in sendmail -f {from} && SMTP MAIL from: {from} throw Exception(exception_type, - &method_name, + method_name, "parameter does not specify 'from' header field"); #ifdef _MSC_VER if(!to) // we use only in SMTP RCPT to: {to} throw Exception(exception_type, - &method_name, + method_name, "parameter does not specify 'to' header field"); SMTP& smtp=*new(pool) SMTP(pool, method_name); @@ -306,7 +307,7 @@ static void sendmail(Request& r, const S smtp.Send(server, port, message_cstr, from->cstr(), to->cstr()); } else throw Exception("parser.runtime", - &method_name, + method_name, "$"MAIN_CLASS_NAME":"MAIL_NAME".SMTP not defined"); #else // unix @@ -318,7 +319,7 @@ static void sendmail(Request& r, const S if(mail_conf) { #ifdef PA_FORCED_SENDMAIL throw Exception("parser.runtime", - &method_name, + method_name, "Parser was configured with --with-sendmail="PA_FORCED_SENDMAIL " key, to change sendmail you should reconfigure and recompie it"); #else @@ -326,7 +327,7 @@ static void sendmail(Request& r, const S sendmail_command=&sendmail_value->as_string(); else throw Exception("parser.runtime", - &method_name, + method_name, "$"MAIN_CLASS_NAME":"MAIL_NAME".%s not defined", sendmailkey_cstr); #endif @@ -390,7 +391,7 @@ static void sendmail(Request& r, const S in, out, err); if(exit_status || err.size()) throw Exception("email.send", - &method_name, + method_name, "'%s' reported problem: %s (%d)", file_spec->cstr(), err.size()?err.cstr():"UNKNOWN", @@ -401,14 +402,14 @@ static void sendmail(Request& r, const S // methods -static void _send(Request& r, const String& method_name, MethodParams *params) { +static void _send(Request& r, StringPtr method_name, MethodParams& params) { Pool& pool=r.pool(); - Value& vhash=params->as_no_junction(0, "message must not be code"); + Value& vhash=params.as_no_junction(0, "message must not be code"); Hash *hash=vhash.get_hash(&method_name); if(!hash) throw Exception("parser.runtime", - &method_name, + method_name, "message must be hash"); const String *from=0; @@ -422,7 +423,7 @@ static void _send(Request& r, const Stri ; const String& message=hash->get(*body_name)/*old format*/? message_hash_to_string(r, method_name, *hash, 0, &from, to_param) : // old - static_cast(r.get_self())->message_hash_to_string(r, &method_name, hash, 0, &from, to_param); // new + static_cast(r.get_self())->message_hash_to_string(r, method_name, hash, 0, &from, to_param); // new //r.write_pass_lang(message); sendmail(r, method_name, message, from, to);