httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soc-r...@apache.org
Subject svn commit: r373616 - /httpd/mod_smtpd/trunk/src/smtp_protocol.c
Date Mon, 30 Jan 2006 22:38:06 GMT
Author: soc-rian
Date: Mon Jan 30 14:38:04 2006
New Revision: 373616

URL: http://svn.apache.org/viewcvs?rev=373616&view=rev
Log:
handle the "NOOP" command with a function again.


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

Modified: httpd/mod_smtpd/trunk/src/smtp_protocol.c
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/src/smtp_protocol.c?rev=373616&r1=373615&r2=373616&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/src/smtp_protocol.c (original)
+++ httpd/mod_smtpd/trunk/src/smtp_protocol.c Mon Jan 30 14:38:04 2006
@@ -51,9 +51,11 @@
 static smtpd_bool smtpd_handler_rcpt(smtpd_session_rec *, char *);
 static smtpd_bool smtpd_handler_data(smtpd_session_rec *, char *);
 static smtpd_bool smtpd_handler_rset(smtpd_session_rec *, char *);
+static smtpd_bool smtpd_handler_noop(smtpd_session_rec *, char *);
 static smtpd_bool smtpd_handler_quit(smtpd_session_rec *, char *);
 static smtpd_bool smtpd_handler_vrfy(smtpd_session_rec *, char *);
-static smtpd_bool smtpd_handle_unrecognized_command(smtpd_session_rec *, char *, char *);
+static smtpd_bool smtpd_handle_unrecognized_command(smtpd_session_rec *,
+                                                    char *, char *);
 
 static void smtpd_respond_msgs(smtpd_session_rec *scr, int status,
                                char *default_string, apr_array_header_t *msgs)
@@ -135,8 +137,7 @@
             disconnect = smtpd_handler_rset(scr, buffer);
         }
         else if (ap_strcmp_match("noop", command) == 0) {
-            smtpd_respond_oneline(scr, 250, "Ok");
-            disconnect = SMTPD_FALSE;
+            disconnect = smtpd_handler_noop(scr, buffer);
         }
         else if (ap_strcmp_match("vrfy", command) == 0) {
             disconnect = smtpd_handler_vrfy(scr, buffer);
@@ -745,13 +746,30 @@
 
 static smtpd_bool smtpd_handler_rset(smtpd_session_rec *scr, char *buffer)
 {
-    if (buffer != NULL) {
+    if (scr->should_disconnect == SMTPD_TRUE) {
+        smtpd_respond_oneline(scr, 503, "Please disconnect using the "
+                              " QUIT command");
+    }
+    else if (buffer != NULL) {
         smtpd_respond_oneline(scr, 501, "Syntax: RSET");
     }
     else {
         smtpd_reset_envelope(scr);
         smtpd_respond_oneline(scr, 250, "Ok");
     }
+    
+    return SMTPD_FALSE;
+}
+
+static smtpd_bool smtpd_handler_noop(smtpd_session_rec *scr, char *buffer)
+{
+   if (scr->should_disconnect == SMTPD_TRUE) {
+       smtpd_respond_oneline(scr, 503, "Please disconnect using the "
+                             " QUIT command");
+   }
+   else {
+       smtpd_respond_oneline(scr, 250, "Ok");
+   }
     
     return SMTPD_FALSE;
 }



Mime
View raw message