httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soc-r...@apache.org
Subject svn commit: r369167 - in /httpd/mod_smtpd/trunk/src: smtp_core.c smtp_protocol.c
Date Sun, 15 Jan 2006 02:44:03 GMT
Author: soc-rian
Date: Sat Jan 14 18:44:01 2006
New Revision: 369167

URL: http://svn.apache.org/viewcvs?rev=369167&view=rev
Log:
Established which hooks should be RUN_FIRST and RUN_ALL. Plugins should
not have to worry about the effect of return SMTPD_OK.

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

Modified: httpd/mod_smtpd/trunk/src/smtp_core.c
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/src/smtp_core.c?rev=369167&r1=369166&r2=369167&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/src/smtp_core.c (original)
+++ httpd/mod_smtpd/trunk/src/smtp_core.c Sat Jan 14 18:44:01 2006
@@ -285,83 +285,93 @@
                 )
 
 /* Implement 'smtpd_run_unrecognized_command'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode,
-                                    unrecognized_command,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in,
-                                     char *command, char *data),
-                                    (scr, in, command, data),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode,
+                                      unrecognized_command,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in,
+                                       char *command, char *data),
+                                      (scr, in, command, 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_conn_rec *scr,
                                      smtpd_return_data *in),
                                     (scr, in),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_reset_transaction'. */
+/* it is an all hook because multiple plugins
+   should be able to perform actions on rset */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode,
                                     reset_transaction,
                                     (smtpd_conn_rec *scr),
                                     (scr),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_helo'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, helo,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in, char *str),
-                                    (scr, in, str),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, helo,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in, char *str),
+                                      (scr, in, str),
+                                      SMTPD_DECLINED);
 /* Implement 'smtpd_run_ehlo'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, ehlo,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in, char *str),
-                                    (scr, in, str),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, ehlo,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in, char *str),
+                                      (scr, in, str),
+                                      SMTPD_DECLINED);
 /* Implement 'smtpd_run_mail'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, mail,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in, char *str,
-                                     apr_table_t *mail_parameters),
-                                    (scr, in, str, mail_parameters),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, mail,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in, char *str,
+                                       apr_table_t *mail_parameters),
+                                      (scr, in, str, mail_parameters),
+                                      SMTPD_DECLINED);
 /* Implement 'smtpd_run_rcpt'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, rcpt,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in, char *str,
-                                     apr_table_t *rcpt_parameters),
-                                    (scr, in, str, rcpt_parameters),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, rcpt,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in, char *str,
+                                       apr_table_t *rcpt_parameters),
+                                      (scr, in, str, rcpt_parameters),
+                                      SMTPD_DECLINED);
 /* Implement 'smtpd_run_vrfy'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, vrfy,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in, char *str),
-                                    (scr, in, str),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, vrfy,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in, char *str),
+                                      (scr, in, str),
+                                      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_conn_rec *scr,
                                      smtpd_return_data *in),
                                     (scr, in),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_data'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode, data,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in),
-                                    (scr, in),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode, data,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in),
+                                      (scr, in),
+                                      SMTPD_DECLINED);
 /* Implement 'smtpd_run_data_post'. */
-APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode,
-                                    data_post,
-                                    (smtpd_conn_rec *scr,
-                                     smtpd_return_data *in),
-                                    (scr, in),
-                                    SMTPD_OK, SMTPD_DECLINED);
+APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(smtpd, SMTPD, smtpd_retcode,
+                                      data_post,
+                                      (smtpd_conn_rec *scr,
+                                       smtpd_return_data *in),
+                                      (scr, in),
+                                      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_conn_rec *scr,
                                      smtpd_return_data *in),
                                     (scr, in),
                                     SMTPD_OK, SMTPD_DECLINED);
 /* Implement 'smtpd_run_headers_parsed'. */
+/* it is an all hook because multiple plugins
+   should be able to perform actions */
 APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(smtpd, SMTPD, smtpd_retcode,
                                     headers_parsed,
                                     (smtpd_conn_rec *scr),

Modified: httpd/mod_smtpd/trunk/src/smtp_protocol.c
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/src/smtp_protocol.c?rev=369167&r1=369166&r2=369167&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/src/smtp_protocol.c (original)
+++ httpd/mod_smtpd/trunk/src/smtp_protocol.c Sat Jan 14 18:44:01 2006
@@ -156,11 +156,10 @@
         else if (ap_strcmp_match("vrfy", command) == 0) {
             return_code = smtpd_handler_vrfy(scr, buffer, &out_data);
         }
-      
         else if (ap_strcmp_match("quit", command) == 0) {
             return_code = smtpd_handler_quit(scr, buffer, &out_data);
-
-        } else {
+        }
+        else {
             return_code =
               smtpd_handle_unrecognized_command(scr, &out_data, command,
                                                 buffer);



Mime
View raw message