httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soc-r...@apache.org
Subject svn commit: r373411 - in /httpd/mod_smtpd/trunk/src: mod_smtpd.h smtp_core.c smtp_protocol.c
Date Mon, 30 Jan 2006 01:37:30 GMT
Author: soc-rian
Date: Sun Jan 29 17:37:28 2006
New Revision: 373411

URL: http://svn.apache.org/viewcvs?rev=373411&view=rev
Log:
Put per_command_pool in the smtpd_session_rec, removed from parameter list
in hooks, for consistency with the rest of apache.


Modified:
    httpd/mod_smtpd/trunk/src/mod_smtpd.h
    httpd/mod_smtpd/trunk/src/smtp_core.c
    httpd/mod_smtpd/trunk/src/smtp_protocol.c

Modified: httpd/mod_smtpd/trunk/src/mod_smtpd.h
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/src/mod_smtpd.h?rev=373411&r1=373410&r2=373411&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/src/mod_smtpd.h (original)
+++ httpd/mod_smtpd/trunk/src/mod_smtpd.h Sun Jan 29 17:37:28 2006
@@ -134,6 +134,10 @@
 
     /* notes on this session */
     struct ap_conf_vector_t *session_config;
+
+    /* per command pool
+       (cleared after every command) */
+    apr_pool_t *per_command_pool;
 } smtpd_session_rec;
   
 /* public */
@@ -161,42 +165,37 @@
 
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode,
                           unrecognized_command,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           char *command, char *data,
+                          (smtpd_session_rec *scr, char *command, char *data,
                            smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, connect,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, reset_envelope,
                           (smtpd_session_rec *scr));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, helo,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           char *str, smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, char *str,
+                           smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, ehlo,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           char *str, smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, char *str,
+                           smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, mail,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           char *str, apr_table_t *mail_parameters,
+                          (smtpd_session_rec *scr, char *str,
+                           apr_table_t *mail_parameters,
                            smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, rcpt,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           char *str, apr_table_t *rcpt_parameters,
+                          (smtpd_session_rec *scr, char *str,
+                           apr_table_t *rcpt_parameters,
                            smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, vrfy,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           char *str, smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, char *str,
+                           smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, quit,
-                          (smtpd_session_rec *scr, apr_pool_t *p));
+                          (smtpd_session_rec *scr));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, data,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, data_post,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, queue,
-                          (smtpd_session_rec *scr, apr_pool_t *p,
-                           smtpd_return_data **out_data));
+                          (smtpd_session_rec *scr, smtpd_return_data **out_data));
 APR_DECLARE_EXTERNAL_HOOK(smtpd, SMTPD, smtpd_retcode, headers_parsed,
                           (smtpd_session_rec *scr));
 

Modified: httpd/mod_smtpd/trunk/src/smtp_core.c
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/src/smtp_core.c?rev=373411&r1=373410&r2=373411&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/src/smtp_core.c (original)
+++ httpd/mod_smtpd/trunk/src/smtp_core.c Sun Jan 29 17:37:28 2006
@@ -147,6 +147,8 @@
 
     scr->session_config = ap_create_request_config(scr->p);
 
+    apr_pool_create(&(scr->per_command_pool), scr->p);
+
     /* create envelope rec */
     str = apr_pcalloc(scr->p, sizeof(*str));
     
@@ -294,18 +296,17 @@
 /* Implement 'smtpd_run_unrecognized_command'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode,
                                       unrecognized_command,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
-                                       char *command, char *data,
-                                       smtpd_return_data **out_data),
-                                      (scr, p, command, data, out_data),
+                                      (smtpd_session_rec *scr, char *command,
+                                       char *data, smtpd_return_data **out_data),
+                                      (scr, command, data, out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_connect'. */
 /* it is an all hook because multiple plugins
    should be ale to perform actions on connect */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, connect,
-                                    (smtpd_session_rec *scr, apr_pool_t *p,
+                                    (smtpd_session_rec *scr,
                                      smtpd_return_data **out_data),
-                                    (scr, p, out_data),
+                                    (scr, out_data),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_reset_envelope'. */
 /* it is an all hook because multiple plugins
@@ -317,66 +318,65 @@
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_helo'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, helo,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
-                                       char *str, smtpd_return_data **out_data),
-                                      (scr, p, str, out_data),
+                                      (smtpd_session_rec *scr, char *str,
+                                       smtpd_return_data **out_data),
+                                      (scr, str, out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_ehlo'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, ehlo,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
-                                       char *str, smtpd_return_data **out_data),
-                                      (scr, p, str, out_data),
+                                      (smtpd_session_rec *scr, char *str,
+                                       smtpd_return_data **out_data),
+                                      (scr, str, out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_mail'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, mail,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
-                                       char *str, apr_table_t *mail_parameters,
+                                      (smtpd_session_rec *scr, char *str,
+                                       apr_table_t *mail_parameters,
                                        smtpd_return_data **out_data),
-                                      (scr, p, str, mail_parameters,
+                                      (scr, str, mail_parameters,
                                        out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_rcpt'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, rcpt,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
-                                       char *str, apr_table_t *rcpt_parameters,
+                                      (smtpd_session_rec *scr, char *str,
+                                       apr_table_t *rcpt_parameters,
                                        smtpd_return_data **out_data),
-                                      (scr, p, str, rcpt_parameters,
+                                      (scr, str, rcpt_parameters,
                                        out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_vrfy'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, vrfy,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
-                                       char *str, smtpd_return_data **out_data),
-                                      (scr, p, str, out_data),
+                                      (smtpd_session_rec *scr, char *str,
+                                       smtpd_return_data **out_data),
+                                      (scr, str, out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_quit'. */
 /* it is an all hook because multiple plugins
    should be able to perform actions on quit */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, quit,
-                                    (smtpd_session_rec *scr,
-                                     apr_pool_t *p),
-                                    (scr, p),
+                                    (smtpd_session_rec *scr),
+                                    (scr),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_data'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, data,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
+                                      (smtpd_session_rec *scr,
                                        smtpd_return_data **out_data),
-                                      (scr, p, out_data),
+                                      (scr, out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_data_post'. */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode,
                                       data_post,
-                                      (smtpd_session_rec *scr, apr_pool_t *p,
+                                      (smtpd_session_rec *scr,
                                        smtpd_return_data **out_data),
-                                      (scr, p, out_data),
+                                      (scr, out_data),
                                       SMTPD_DECLINED);
 /* Implement 'smtpd_run_queue'. */
 /* it is an all hook because multiple plugins
    should be able to queue */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, queue,
-                                    (smtpd_session_rec *scr, apr_pool_t *p,
+                                    (smtpd_session_rec *scr,
                                      smtpd_return_data **out_data),
-                                    (scr, p, out_data),
+                                    (scr, out_data),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_headers_parsed'. */
 /* it is an all hook because multiple plugins

Modified: httpd/mod_smtpd/trunk/src/smtp_protocol.c
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/src/smtp_protocol.c?rev=373411&r1=373410&r2=373411&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/src/smtp_protocol.c (original)
+++ httpd/mod_smtpd/trunk/src/smtp_protocol.c Sun Jan 29 17:37:28 2006
@@ -46,16 +46,15 @@
 extern ap_regex_t *rcpt_compiled_regex;
 extern ap_regex_t *vrfy_compiled_regex;
 
-static int smtpd_handler_helo(smtpd_session_rec *, apr_pool_t *, char *, int);
-static int smtpd_handler_mail(smtpd_session_rec *, apr_pool_t *, char *);
-static int smtpd_handler_rcpt(smtpd_session_rec *, apr_pool_t *, char *);
-static int smtpd_handler_data(smtpd_session_rec *, apr_pool_t *, char *);
+static int smtpd_handler_helo(smtpd_session_rec *, char *, int);
+static int smtpd_handler_mail(smtpd_session_rec *, char *);
+static int smtpd_handler_rcpt(smtpd_session_rec *, char *);
+static int smtpd_handler_data(smtpd_session_rec *, char *);
 static int smtpd_handler_rset(smtpd_session_rec *, char *);
-static int smtpd_handler_quit(smtpd_session_rec *, apr_pool_t *, char *);
-static int smtpd_handler_vrfy(smtpd_session_rec *, apr_pool_t *, char *);
-static void smtpd_connection_run(smtpd_session_rec *, apr_pool_t *);
-static int smtpd_handle_unrecognized_command(smtpd_session_rec *, apr_pool_t *,
-                                             char *, char *);
+static int smtpd_handler_quit(smtpd_session_rec *, char *);
+static int smtpd_handler_vrfy(smtpd_session_rec *, char *);
+static void smtpd_connection_run(smtpd_session_rec *);
+static int smtpd_handle_unrecognized_command(smtpd_session_rec *, char *, char *);
 
 static void smtpd_respond(smtpd_session_rec *scr, int status,
                           char *default_string, smtpd_return_data *hook_data)
@@ -71,15 +70,12 @@
 void smtpd_process_connection_internal(smtpd_session_rec *scr)
 {
     char buffer[255];
-    apr_pool_t *per_command_pool;
     smtpd_svr_config_rec *pConfig =
       ap_get_module_config(scr->s->module_config,
                            &smtpd_module);
     smtpd_return_data *out_data;
 
-    apr_pool_create(&per_command_pool, scr->p);
-    
-    switch(smtpd_run_connect(scr, per_command_pool, &out_data)) {
+    switch(smtpd_run_connect(scr, &out_data)) {
     case SMTPD_DENY:
         ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, scr->s,
                      "Connection Denied");
@@ -99,7 +95,7 @@
                  pConfig->sId);
         smtpd_respond_oneline(scr, 220, buffer);
     case SMTPD_DONE:
-        smtpd_connection_run(scr, per_command_pool);
+        smtpd_connection_run(scr);
         break;
     }
 
@@ -107,8 +103,7 @@
 }
 
 #define BUFFER_STR_LEN 1024
-static void smtpd_connection_run(smtpd_session_rec *scr,
-                                 apr_pool_t *per_command_pool)
+static void smtpd_connection_run(smtpd_session_rec *scr)
 {
     char cmdbuff[BUFFER_STR_LEN];
     char *buffer = cmdbuff;
@@ -116,7 +111,7 @@
     int disconnect;
 
     while (smtpd_getline(scr, buffer, BUFFER_STR_LEN, NULL) == APR_SUCCESS) {
-        apr_pool_clear(per_command_pool);
+        apr_pool_clear(scr->per_command_pool);
         command = buffer;
         
         buffer = ap_strchr(buffer, ' ');
@@ -128,19 +123,19 @@
         ap_str_tolower(command);
 
         if (ap_strcmp_match("ehlo", command) == 0) {
-            disconnect = smtpd_handler_helo(scr, per_command_pool, buffer, 1);
+            disconnect = smtpd_handler_helo(scr, buffer, 1);
         }
         else if (ap_strcmp_match("helo", command) == 0) {
-            disconnect = smtpd_handler_helo(scr, per_command_pool, buffer, 0);
+            disconnect = smtpd_handler_helo(scr, buffer, 0);
         }
         else if (ap_strcmp_match("mail", command) == 0) {
-            disconnect = smtpd_handler_mail(scr, per_command_pool, buffer);
+            disconnect = smtpd_handler_mail(scr, buffer);
         }
         else if (ap_strcmp_match("rcpt", command) == 0) {
-            disconnect = smtpd_handler_rcpt(scr, per_command_pool, buffer);
+            disconnect = smtpd_handler_rcpt(scr, buffer);
         }
         else if (ap_strcmp_match("data", command) == 0) {
-            disconnect = smtpd_handler_data(scr, per_command_pool, buffer);
+            disconnect = smtpd_handler_data(scr, buffer);
         }
         else if (ap_strcmp_match("rset", command) == 0) {
             disconnect = smtpd_handler_rset(scr, buffer);
@@ -150,15 +145,14 @@
             disconnect = 0;
         }
         else if (ap_strcmp_match("vrfy", command) == 0) {
-            disconnect = smtpd_handler_vrfy(scr, per_command_pool, buffer);
+            disconnect = smtpd_handler_vrfy(scr, buffer);
         }
         else if (ap_strcmp_match("quit", command) == 0) {
-            disconnect = smtpd_handler_quit(scr, per_command_pool, buffer);
+            disconnect = smtpd_handler_quit(scr, buffer);
         }
         else {
             disconnect =
-              smtpd_handle_unrecognized_command(scr, per_command_pool, command,
-                                                buffer);
+              smtpd_handle_unrecognized_command(scr, command, buffer);
         }
         
         if (disconnect)
@@ -171,13 +165,13 @@
 }
 
 static int smtpd_handle_unrecognized_command(smtpd_session_rec *scr,
-                                             apr_pool_t *p, char *command,
+                                             char *command,
                                              char *data)
 {
     int disconnect = 0;
     smtpd_return_data *out_data;
     
-    switch(smtpd_run_unrecognized_command(scr, p, command, data, &out_data)) {
+    switch(smtpd_run_unrecognized_command(scr, command, data, &out_data)) {
     case SMTPD_DENY:
         smtpd_respond(scr, 521, "Command Denied", out_data);
         break;
@@ -194,8 +188,7 @@
     return disconnect;
 }
 
-static int smtpd_default_ehlo(smtpd_session_rec *scr, apr_pool_t *p,
-                              char *buffer)
+static int smtpd_default_ehlo(smtpd_session_rec *scr, char *buffer)
 {
     /* RFC 2821 states that when ehlo or helo is received, reset */
     /* state */
@@ -208,7 +201,7 @@
     if (scr->extensions->nelts) {
         apr_array_header_t *first;
         
-        first = apr_array_make(p, 1, sizeof(char *));
+        first = apr_array_make(scr->per_command_pool, 1, sizeof(char *));
         (*((char **)apr_array_push(first))) = scr->helo;
         apr_array_cat(first, scr->extensions);
         
@@ -221,8 +214,7 @@
     return 0;
 }
 
-static int smtpd_default_helo(smtpd_session_rec *scr, apr_pool_t *p,
-                              char *buffer)
+static int smtpd_default_helo(smtpd_session_rec *scr, char *buffer)
 {
     /* RFC 2821 states that when ehlo or helo is received, reset */
     /* state */
@@ -238,9 +230,7 @@
 }
 
 
-static int smtpd_handler_helo(smtpd_session_rec *scr,
-                              apr_pool_t *per_command_pool, char *buffer,
-                              int esmtp)
+static int smtpd_handler_helo(smtpd_session_rec *scr, char *buffer, int esmtp)
 {
     int error;
     int disconnect = 0;
@@ -261,8 +251,8 @@
     }
     
     switch(esmtp
-           ? smtpd_run_ehlo(scr, per_command_pool, buffer, &out_data)
-           : smtpd_run_helo(scr, per_command_pool, buffer, &out_data)) {
+           ? smtpd_run_ehlo(scr, buffer, &out_data)
+           : smtpd_run_helo(scr, buffer, &out_data)) {
     case SMTPD_DONE:
         break;
     case SMTPD_DONE_DISCONNECT:
@@ -276,8 +266,8 @@
         break;
     default:
         disconnect = esmtp
-          ? smtpd_default_helo(scr, per_command_pool, buffer)
-          : smtpd_default_ehlo(scr, per_command_pool, buffer);
+          ? smtpd_default_helo(scr, buffer)
+          : smtpd_default_ehlo(scr, buffer);
         break;
     }
     return disconnect;
@@ -309,8 +299,8 @@
     }
 }
 
-static int smtpd_default_mail(smtpd_session_rec *scr, apr_pool_t *p,
-                              char *email_address, apr_table_t *mail_parameters)
+static int smtpd_default_mail(smtpd_session_rec *scr, char *email_address,
+                              apr_table_t *mail_parameters)
 {
     smtpd_envelope_rec *str = scr->envelope;
 
@@ -329,8 +319,7 @@
     return 0;
 }   
 
-static int smtpd_handler_mail(smtpd_session_rec *scr,
-                              apr_pool_t *per_command_pool, char *buffer)
+static int smtpd_handler_mail(smtpd_session_rec *scr, char *buffer)
 {
     char *email_address;
     int error;
@@ -362,7 +351,7 @@
        "full from_parameter: %s", loc);  
     */
 
-    mail_parameters = apr_table_make(per_command_pool, 5);
+    mail_parameters = apr_table_make(scr->per_command_pool, 5);
 
     /* parse out reverse-path */
     {
@@ -377,8 +366,7 @@
         }
     }
 
-    switch(smtpd_run_mail(scr, per_command_pool, email_address, mail_parameters,
-                          &out_data)) {
+    switch(smtpd_run_mail(scr, email_address, mail_parameters, &out_data)) {
     case SMTPD_DONE:
         break;
     case SMTPD_DONE_DISCONNECT:
@@ -411,16 +399,15 @@
         disconnect = 1;
         break;
     default:
-        disconnect = smtpd_default_mail(scr, per_command_pool, email_address,
-                                        mail_parameters);
+        disconnect = smtpd_default_mail(scr, email_address, mail_parameters);
         break;
     }
     
     return disconnect;
 }
 
-static int smtpd_default_rcpt(smtpd_session_rec *scr, apr_pool_t *p,
-                              char *email_address, apr_table_t *rcpt_parameters)
+static int smtpd_default_rcpt(smtpd_session_rec *scr, char *email_address,
+                              apr_table_t *rcpt_parameters)
 {
     smtpd_envelope_rec *str = scr->envelope;
 
@@ -436,8 +423,7 @@
     return 0;
 }
 
-static int smtpd_handler_rcpt(smtpd_session_rec *scr,
-                              apr_pool_t *per_command_pool, char *buffer)
+static int smtpd_handler_rcpt(smtpd_session_rec *scr, char *buffer)
 {
     char *email_address;
     int error;
@@ -465,7 +451,7 @@
         return disconnect;
     }
 
-    rcpt_parameters = apr_table_make(per_command_pool, 5);
+    rcpt_parameters = apr_table_make(scr->per_command_pool, 5);
 
     /* parse out reverse-path*/
     {
@@ -480,8 +466,7 @@
         }
     }
 
-    switch(smtpd_run_rcpt(scr, per_command_pool, email_address, rcpt_parameters,
-                          &out_data)) {
+    switch(smtpd_run_rcpt(scr, email_address, rcpt_parameters, &out_data)) {
     case SMTPD_DONE:
         break;
     case SMTPD_DONE_DISCONNECT:
@@ -508,8 +493,7 @@
         disconnect = 1;
         break;
     case SMTPD_OK: /* recipient is okay */
-        disconnect = smtpd_default_rcpt(scr, per_command_pool, email_address,
-                                        rcpt_parameters);
+        disconnect = smtpd_default_rcpt(scr, email_address, rcpt_parameters);
         break;
     default:
         smtpd_respond_oneline(scr, 450,
@@ -521,12 +505,12 @@
 }
 
 
-static int smtpd_queue(smtpd_session_rec *scr, apr_pool_t *p)
+static int smtpd_queue(smtpd_session_rec *scr)
 {
     int disconnect = 0;
     smtpd_return_data *out_data = NULL;
 
-    switch(smtpd_run_queue(scr, p, &out_data)) {
+    switch(smtpd_run_queue(scr, &out_data)) {
     case SMTPD_DONE:
         break;
     case SMTPD_DONE_DISCONNECT:
@@ -609,7 +593,7 @@
     apr_pool_destroy(p);
 }
 
-static int smtpd_default_data(smtpd_session_rec *scr, apr_pool_t *p)
+static int smtpd_default_data(smtpd_session_rec *scr)
 {
     int rv;
     int disconnect = 0;
@@ -622,14 +606,14 @@
         const char *tempdir;
         char *tempfile;
 
-        rv = apr_temp_dir_get(&tempdir, p);
+        rv = apr_temp_dir_get(&tempdir, scr->per_command_pool);
         if (rv) {
             smtpd_respond_oneline(scr, 421, "Error: Internal");
             disconnect = 1;
             return disconnect;
         }
 
-        tempfile = apr_psprintf(p, "%s/tmp.XXXXXX", tempdir);
+        tempfile = apr_psprintf(scr->per_command_pool, "%s/tmp.XXXXXX", tempdir);
         rv = apr_file_mktemp(&tfp, tempfile,
                              APR_CREATE | APR_WRITE | APR_READ |
                              APR_DELONCLOSE, str->p);
@@ -715,7 +699,7 @@
     {
         smtpd_return_data *out_data = NULL;
 
-        switch(smtpd_run_data_post(scr, p, &out_data)) {
+        switch(smtpd_run_data_post(scr, &out_data)) {
         case SMTPD_DONE:
             break;
         case SMTPD_DONE_DISCONNECT:
@@ -730,7 +714,7 @@
             smtpd_reset_envelope(scr);
             break;
         default:
-            disconnect = smtpd_queue(scr, p);
+            disconnect = smtpd_queue(scr);
             smtpd_reset_envelope(scr);
             break;
         }
@@ -740,8 +724,7 @@
     return disconnect;
 }
 
-static int smtpd_handler_data(smtpd_session_rec *scr,
-                              apr_pool_t *per_command_pool, char *buffer)
+static int smtpd_handler_data(smtpd_session_rec *scr, char *buffer)
 {
     int disconnect = 0;
     smtpd_return_data *out_data = NULL;
@@ -759,7 +742,7 @@
         return disconnect;
     }
 
-    switch(smtpd_run_data(scr, per_command_pool, &out_data)) {
+    switch(smtpd_run_data(scr, &out_data)) {
     case SMTPD_DONE:
         break;
     case SMTPD_DONE_DISCONNECT:
@@ -784,7 +767,7 @@
         disconnect = 1;
         break;
     default:
-        disconnect = smtpd_default_data(scr, per_command_pool);
+        disconnect = smtpd_default_data(scr);
         break;
     }
 
@@ -804,23 +787,21 @@
     return 250;
 }
 
-static int smtpd_handler_quit(smtpd_session_rec *scr,
-                              apr_pool_t *per_command_pool, char *buffer)
+static int smtpd_handler_quit(smtpd_session_rec *scr, char *buffer)
 {
     if (buffer != NULL) {
         smtpd_respond_oneline(scr, 501, "Syntax: QUIT");
         return 501;
     }
 
-    if (smtpd_run_quit(scr, per_command_pool) != SMTPD_DONE) {
+    if (smtpd_run_quit(scr) != SMTPD_DONE) {
         smtpd_respond_oneline(scr, 221, "Bye");
     }
 
     return 1;
 }
 
-static int smtpd_handler_vrfy(smtpd_session_rec *scr,
-                              apr_pool_t *per_command_pool, char *buffer)
+static int smtpd_handler_vrfy(smtpd_session_rec *scr, char *buffer)
 {
     int error;
     int disconnect = 0;
@@ -838,7 +819,7 @@
         return disconnect;
     }
 
-    switch(smtpd_run_vrfy(scr, per_command_pool, buffer, &out_data)) {
+    switch(smtpd_run_vrfy(scr, buffer, &out_data)) {
     case SMTPD_DONE:
         break;
     case SMTPD_DONE_DISCONNECT:



Mime
View raw message