httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r794533 - /httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
Date Thu, 16 Jul 2009 05:24:48 GMT
Author: wrowe
Date: Thu Jul 16 05:24:47 2009
New Revision: 794533

URL: http://svn.apache.org/viewvc?rev=794533&view=rev
Log:
Correct messages.  Someone really likes to allocate pool for no purpose :)

Modified:
    httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c?rev=794533&r1=794532&r2=794533&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Thu Jul 16 05:24:47 2009
@@ -316,8 +316,7 @@
         }
 
         if ((cmd->flags & FTP_NEED_LOGIN) && !fc->logged_in) {
-            fc->response_notes = apr_pstrdup(r->pool, "Please log in with"
-                                             " USER and PASS");
+            fc->response_notes = "Please log in with USER and PASS";
             return FTP_REPLY_NOT_LOGGED_IN;
         }
         else {
@@ -358,8 +357,7 @@
     ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     if (!ftp_have_ssl() || (!fc->ssl_input_ctx || !fc->ssl_output_ctx)) {
-        fc->response_notes = apr_pstrdup(r->pool,
-                                         "AUTH mechanism not available");
+        fc->response_notes = "AUTH mechanism not available";
         return FTP_REPLY_COMMAND_NOT_IMPL_PARAM;
     }
 
@@ -385,8 +383,7 @@
         fc->auth = FTP_AUTH_TLS;
     }
     else {
-        fc->response_notes = apr_pstrdup(r->pool,
-                                         "AUTH mechanism not supported");
+        fc->response_notes = "AUTH mechanism not supported";
         return FTP_REPLY_COMMAND_NOT_IMPL_PARAM;
     }
 
@@ -1333,9 +1330,7 @@
         if ((fsc->options & FTP_OPT_CHECKMAXCLIENTS) &&
             ftp_check_maxclients(r)) {
             ap_destroy_sub_req(rr);
-            fc->response_notes = apr_pstrdup(r->pool,
-                                             "Maximum number of concurrent "
-                                   "sessions reached, closing connection.");
+            fc->response_notes = FTP_MSG_SESSIONLIMIT;
             fc->close_connection = 1;
 
             return FTP_REPLY_SERVICE_NOT_AVAILABLE;
@@ -1350,9 +1345,7 @@
                          r->server, "FTP per server login limit hit for %s",
                          fc->user);
 
-            fc->response_notes = apr_pstrdup(r->pool,
-                                             "Maximum number of concurrent "
-                                   "sessions reached, closing connection.");
+            fc->response_notes = FTP_MSG_SESSIONLIMIT;
             fc->close_connection = 1;
             return FTP_REPLY_SERVICE_NOT_AVAILABLE;
 
@@ -1362,9 +1355,7 @@
                          r->server, "FTP per user login limit hit for %s",
                          fc->user);
 
-            fc->response_notes = apr_pstrdup(r->pool,
-                                             "Maximum number of concurrent "
-                                   "sessions reached, closing connection.");
+            fc->response_notes = FTP_MSG_SESSIONLIMIT;
             fc->close_connection = 1;
             return FTP_REPLY_SERVICE_NOT_AVAILABLE;
 
@@ -1374,9 +1365,7 @@
                          r->server, "FTP per IP login limit hit for %s",
                          fc->user);
 
-            fc->response_notes = apr_pstrdup(r->pool,
-                                             "Maximum number of concurrent "
-                                   "sessions reached, closing connection.");
+            fc->response_notes = FTP_MSG_SESSIONLIMIT;
             fc->close_connection = 1;
             return FTP_REPLY_SERVICE_NOT_AVAILABLE;
 
@@ -1443,9 +1432,7 @@
                      r->server, "repeated login failures from %s",
                      c->remote_ip);
 
-        fc->response_notes = apr_pstrdup(r->pool,
-                                         "Maximum login attempts reached, "
-                                         "closing connection.");
+        fc->response_notes = "Maximum login attempts reached, closing connection.";
         fc->close_connection = 1;
 
         return FTP_REPLY_SERVICE_NOT_AVAILABLE;
@@ -1459,8 +1446,7 @@
 
     fc->user = ftp_unknown_username;
     fc->authorization = NULL;
-    fc->response_notes = apr_pstrdup(r->pool,
-                                     "Please log in with USER and PASS");
+    fc->response_notes = "Please log in with USER and PASS";
     return FTP_REPLY_NOT_LOGGED_IN;
 }
 
@@ -1662,9 +1648,8 @@
     }
 
     apr_socket_addr_get(&sa, APR_LOCAL, fc->csock);
-
-    fc->response_notes = apr_psprintf(r->pool,
-                                  "Entering Extended Passive Mode (|||%u|)",
+    fc->response_notes = apr_psprintf(r->pool, 
+                                      "Entering Extended Passive Mode (|||%u|)",
                                       sa->port);
 
     return FTP_REPLY_EXTENDED_PASSIVE_MODE;
@@ -1688,7 +1673,7 @@
     ftp_reset_dataconn(fc);
 
     if (fc->all_epsv) {
-        fc->response_notes = apr_pstrdup(r->pool, "Restricted by EPSV ALL ");
+        fc->response_notes = "Restricted by EPSV ALL";
         return FTP_REPLY_BAD_SEQUENCE;
     }
 
@@ -1780,8 +1765,7 @@
      */
     if (((*arg == '\0') || (*endp != '\0')) || fc->pbsz < 0
         || fc->pbsz == LONG_MAX) {
-        fc->response_notes = apr_pstrdup(r->pool, "Could not parse PBSZ "
-                                         "argument");
+        fc->response_notes = "Could not parse PBSZ argument";
         return FTP_REPLY_SYNTAX_ERROR;
     }
 
@@ -1923,14 +1907,14 @@
     ftp_reset_dataconn(fc);
 
     if (fc->all_epsv) {
-        fc->response_notes = apr_pstrdup(r->pool, "Restricted by EPSV ALL ");
+        fc->response_notes = "Restricted by EPSV ALL";
         return FTP_REPLY_BAD_SEQUENCE;
     }
 
     arg_tok = apr_pstrdup(fc->data_pool, arg);
     if ((res = ftp_eprt_decode(&family, &ip_addr, &port, arg_tok))
         != FTP_REPLY_COMMAND_OK) {
-        fc->response_notes = apr_pstrdup(r->pool, "Invalid EPRT request");
+        fc->response_notes = "Invalid EPRT request";
         return res;
     }
 
@@ -1944,8 +1928,7 @@
 #else
                      1, ip_addr, port);
 #endif
-        fc->response_notes = apr_pstrdup(r->pool,
-                         "Invalid EPRT command, unable to resolve request");
+        fc->response_notes = "Invalid EPRT command, unable to resolve request";
         return FTP_REPLY_SYNTAX_ERROR;
     }
 
@@ -1968,8 +1951,8 @@
                          "(doesn't match the client IP %s and "
                          "not configured to AllowProxyPORT)",
                          test_ip, c->remote_ip);
-            fc->response_notes = apr_pstrdup(r->pool,
-                       "Invalid EPRT command, proxy EPRT is not permitted");
+            fc->response_notes = "Invalid EPRT command, proxy EPRT is"
+                                 " not permitted";
             return FTP_REPLY_SYNTAX_ERROR;
         }
     }
@@ -1991,13 +1974,13 @@
     ftp_reset_dataconn(fc);
 
     if (fc->all_epsv) {
-        fc->response_notes = apr_pstrdup(r->pool, "Restricted by EPSV ALL ");
+        fc->response_notes = "Restricted by EPSV ALL";
         return FTP_REPLY_BAD_SEQUENCE;
     }
 
     if ((res = sscanf(arg, "%d,%d,%d,%d,%d,%d%c", &val[0], &val[1], &val[2],
                       &val[3], &val[4], &val[5], &tc)) != 6) {
-        fc->response_notes = apr_pstrdup(r->pool, "Invalid PORT request");
+        fc->response_notes = "Invalid PORT request";
         return FTP_REPLY_SYNTAX_ERROR;
     }
 
@@ -2020,8 +2003,8 @@
                          "(doesn't match the client IP %s and "
                          "not configured to AllowProxyPORT)",
                          ip_addr, c->remote_ip);
-            fc->response_notes = apr_pstrdup(r->pool,
-                       "Invalid PORT command, proxy PORT is not permitted");
+            fc->response_notes = "Invalid PORT command, proxy PORT is"
+                                 " not permitted";
             return FTP_REPLY_SYNTAX_ERROR;
         }
     }
@@ -2055,8 +2038,7 @@
 
     switch (*arg) {
     case 'C':
-        fc->response_notes = apr_pstrdup(r->pool, "PROT Command OK. "
-                                         "Using clear data channel");
+        fc->response_notes = "PROT Command OK. Using clear data channel";
         fc->prot = FTP_PROT_CLEAR;
         return FTP_REPLY_COMMAND_OK;
     case 'S':
@@ -2064,15 +2046,13 @@
     case 'E':
         return FTP_REPLY_PROT_NOT_SUPPORTED;
     case 'P':
-        fc->response_notes = apr_pstrdup(r->pool, "PROT Command OK. "
-                                         "Using private data channel");
+        fc->response_notes = "PROT Command OK. Using private data channel";
         fc->prot = FTP_PROT_PRIVATE;
         return FTP_REPLY_COMMAND_OK;
     }
 
     /* We don't understand */
-    fc->response_notes = apr_pstrdup(r->pool, "PROT argument not "
-                                     "understood.");
+    fc->response_notes = "PROT argument not understood.";
     return FTP_REPLY_COMMAND_NOT_IMPL_PARAM;
 }
 
@@ -2106,8 +2086,7 @@
     if ((rv != APR_SUCCESS) ||
 #endif
         (*arg == '\0') || (*endp != '\0') || (fc->restart_point < 0)) {
-        fc->response_notes = apr_pstrdup(r->pool, "REST requires a "
-                                         "non-negative integer value");
+        fc->response_notes = "REST requires a non-negative integer value";
         return FTP_REPLY_SYNTAX_ERROR;
     }
 
@@ -2301,8 +2280,7 @@
         response = FTP_REPLY_FILE_NOT_FOUND;
     }
     else if (rr->finfo.filetype != APR_NOFILE) {
-        fc->response_notes = apr_pstrdup(r->pool, "File exists, ready for "
-                                         "destination name");
+        fc->response_notes = "File exists, ready for destination name";
         apr_cpystrn(fc->rename_from, r->filename, APR_PATH_MAX + 1);
         response = FTP_REPLY_PENDING;
     }
@@ -2610,9 +2588,8 @@
     if (!(openflag & (APR_APPEND | APR_TRUNCATE))) {
         apr_off_t restart = fc->restart_point;
         if (apr_file_seek(file, APR_SET, &restart) != APR_SUCCESS) {
-            fc->response_notes = apr_psprintf(r->pool, FTP_MSG_PERM_DENIED,
-                                         "Unable to perform file upload; "
-                                         "failed to skip to restart point");
+            fc->response_notes = "Requested action not taken: invalid REST "
+                                 "parameter; failed to skip to restart point");
 #ifdef HAVE_FCHMOD
             if (fd != -1)
                 fchmod(fd, fixmode);
@@ -2784,11 +2761,11 @@
         switch (toupper(*arg)) {
         case 'A':
             fc->type = TYPE_A;
-            fc->response_notes = apr_pstrdup(r->pool, "Type set to A");
+            fc->response_notes = "Type set to A";
             return FTP_REPLY_COMMAND_OK;
         case 'I':
             fc->type = TYPE_I;
-            fc->response_notes = apr_pstrdup(r->pool, "Type set to I.");
+            fc->response_notes = "Type set to I.";
             return FTP_REPLY_COMMAND_OK;
         }
     }
@@ -2884,9 +2861,7 @@
         fc->authorization = NULL;
         r->server = fc->orig_server = c->base_server;
         r->per_dir_config = r->server->lookup_defaults;
-        fc->response_notes = apr_pstrdup(r->pool,
-                                         "This server requires the use of "
-                                         "SSL");
+        fc->response_notes = "This server requires the use of SSL";
         return FTP_REPLY_NOT_LOGGED_IN;
     }
 
@@ -2895,9 +2870,8 @@
         (strncmp(fc->user, "anonymous@", 10) == 0) ||
         (strcmp(fc->user, "ftp") == 0) ||
         (strncmp(fc->user, "ftp@", 4) == 0)) {
-        fc->response_notes = apr_pstrdup(r->pool,
-                                         "Guest login ok, type your email "
-                                         "address as the password");
+        fc->response_notes = "Guest login ok, type your email address"
+                             " as the password";
         /* force this for limit and access control */
         fc->user = "anonymous";
     }



Mime
View raw message