httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r608945 - in /httpd/mod_ftp/trunk: ./ modules/ftp/
Date Fri, 04 Jan 2008 18:00:06 GMT
Author: wrowe
Date: Fri Jan  4 09:59:58 2008
New Revision: 608945

URL: http://svn.apache.org/viewvc?rev=608945&view=rev
Log:
Major Change (of a major-MMN bump scope) to move ftp_connection
configuration entry from r->request_config to c->conn_config, because
these members have a connection lifetime scope.


Modified:
    httpd/mod_ftp/trunk/CHANGES-FTP
    httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_log.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h
    httpd/mod_ftp/trunk/modules/ftp/ftp_request.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_util.c
    httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c
    httpd/mod_ftp/trunk/modules/ftp/mod_ftp_cmd_pwd.c

Modified: httpd/mod_ftp/trunk/CHANGES-FTP
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/CHANGES-FTP?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/CHANGES-FTP (original)
+++ httpd/mod_ftp/trunk/CHANGES-FTP Fri Jan  4 09:59:58 2008
@@ -1,5 +1,12 @@
 Changes in 0.9.2:
 
+  *) Move the ftp_connection from r->request_config, where it never belonged,
+     into the c->conn_config where its scope matches the lifetime of the conn.
+     [William Rowe]
+
+  *) Resolve httpd-2.0 load failure due to missing apr_strtoff in apr-0.
+     [William Rowe]
+
   *) Ensure that USER must preceed PASS, and that USER failing the
      FTPOptions RequireSSL test won't permit a PASS to succeed.
      [William Rowe]

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=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Fri Jan  4 09:59:58 2008
@@ -102,7 +102,7 @@
 static int ftp_run_handler(request_rec *r, struct ftp_cmd_entry *cmd, 
                            const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     request_rec *rr;
     int res;
 
@@ -195,7 +195,7 @@
 
 int ftp_run_cmd(request_rec *r, const char *key)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     ftp_cmd_entry *cmd;
     char *method, *arg = NULL;
     int res;
@@ -257,7 +257,7 @@
 
 static int ftp_cmd_auth(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    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,
@@ -299,7 +299,7 @@
  */
 static int ftp_change_dir(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     ftp_dir_config *dconf;
     request_rec *rr;
     conn_rec *c = r->connection;
@@ -423,7 +423,7 @@
 
 static int ftp_cmd_dele(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     request_rec *rr;
     apr_status_t rv;
     int res, response;
@@ -491,7 +491,7 @@
 
 static int ftp_cmd_help(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_cmd_entry *cmd;
     int i;
@@ -575,7 +575,7 @@
 
 static int ftp_cmd_list(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);
@@ -790,7 +790,7 @@
 
 static int ftp_cmd_mdtm(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     int res;
     request_rec *rr;
     apr_time_exp_t t;
@@ -819,7 +819,7 @@
 
 static int ftp_cmd_mkd(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     apr_status_t rv;
     int res;
     request_rec *rr;
@@ -872,7 +872,7 @@
 
 static int ftp_cmd_nlst(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);
@@ -999,7 +999,7 @@
 
 static int ftp_cmd_noop(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     fc->response_notes = apr_psprintf(r->pool, FTP_MSG_SUCCESS, r->method);
     return FTP_REPLY_COMMAND_OK;
@@ -1007,7 +1007,7 @@
 
 static int ftp_cmd_pass(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);
@@ -1370,7 +1370,7 @@
 static int init_pasv_socket(request_rec *r, int bindfamily,
                             const char *bindaddr)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);
@@ -1482,7 +1482,7 @@
 
 static int ftp_cmd_epsv(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);
@@ -1579,7 +1579,7 @@
 
 static int ftp_cmd_pasv(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);
@@ -1667,7 +1667,7 @@
 
 static int ftp_cmd_pbsz(request_rec *r, const char *arg)
 { 
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     char *endp;
 
     /*
@@ -1699,7 +1699,7 @@
 static int ftp_cmd_eprt(request_rec *r, const char *arg)
 {
     ftp_server_config *fsc = ftp_get_module_config(r->server->module_config);
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     apr_sockaddr_t *sa;
     apr_socket_t *s;
@@ -1833,7 +1833,7 @@
 static int ftp_cmd_port(request_rec *r, const char *arg)
 {
     ftp_server_config *fsc = ftp_get_module_config(r->server->module_config);
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     apr_sockaddr_t *sa;
     apr_socket_t *s;
@@ -1972,7 +1972,7 @@
 
 static int ftp_cmd_prot(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     /* Return 503 if the user has not done a AUTH command yet.
      * Although RFC2228 and RFC4217 are very explicit that PBSZ must
@@ -2008,7 +2008,7 @@
 
 static int ftp_cmd_pwd(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     fc->response_notes = apr_psprintf(r->pool, FTP_MSG_DIR_CUR, fc->cwd);
     return FTP_REPLY_PATH_CREATED;
@@ -2016,7 +2016,7 @@
 
 static int ftp_cmd_quit(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     fc->close_connection = 1;
     return FTP_REPLY_CONTROL_CLOSE;
@@ -2024,7 +2024,7 @@
 
 static int ftp_cmd_rest(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     char *endp;
     apr_status_t rv;
 
@@ -2051,7 +2051,7 @@
     
 static int ftp_cmd_retr(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     request_rec *rr;
     conn_rec *c = r->connection;
     conn_rec *cdata;
@@ -2212,7 +2212,7 @@
 
 static int ftp_cmd_rnfr(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     request_rec *rr;
     apr_status_t res;
     int response;
@@ -2247,7 +2247,7 @@
 
 static int ftp_cmd_rnto(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     apr_status_t rv;
     int response, res;
     request_rec *rr;
@@ -2288,7 +2288,7 @@
 
 static int ftp_cmd_rmd(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     apr_status_t rv, res;
     request_rec *rr;
 
@@ -2321,7 +2321,7 @@
 
 static int ftp_cmd_size(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     int res, response;
     request_rec *rr;
 
@@ -2417,7 +2417,7 @@
  */
 static int ftp_cmd_stor(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     conn_rec *cdata;
     ftp_dir_config *dconf;
@@ -2673,7 +2673,7 @@
 
 static int ftp_cmd_type(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     if (*arg && !arg[1]){
         switch (*arg) {
@@ -2698,7 +2698,7 @@
 
 static int ftp_cmd_user(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
         ftp_get_module_config(c->base_server->module_config);

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c Fri Jan  4 09:59:58 2008
@@ -56,9 +56,12 @@
     fc->rename_from      = apr_palloc(c->pool, APR_PATH_MAX + 1);
     fc->rename_from[0]   = '\0';
 
-    fc->cntlsock  = ap_get_module_config(c->conn_config, &core_module);
     apr_pool_create(&fc->login_pool, c->pool);
     apr_pool_create(&fc->data_pool, c->pool);
+
+    fc->cntlsock  = ap_get_module_config(c->conn_config, &core_module);
+
+    ftp_set_module_config(c->conn_config, fc);
 }
 
 /* ftp_ssl_init: Fakes a read on the SSL filters to force initialization.

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c Fri Jan  4 09:59:58 2008
@@ -50,7 +50,7 @@
  */
 static apr_status_t ftp_open_datasock(request_rec *r)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc;
     apr_interval_time_t timeout;
@@ -190,7 +190,7 @@
 conn_rec *ftp_open_dataconn(request_rec *r, int write_not_read)
 {
     ftp_server_config *fsc = ftp_get_module_config(r->server->module_config);
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *cdata;
     ap_filter_t *f; 
 
@@ -201,6 +201,8 @@
     cdata = ap_run_create_connection(r->pool, r->server, fc->datasock, 
                                      r->connection->id, r->connection->sbh, 
                                      r->connection->bucket_alloc);
+
+    ftp_set_module_config(cdata->conn_config, fc);
 
     ap_run_pre_connection(cdata, fc->datasock);
 

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_log.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_log.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_log.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_log.c Fri Jan  4 09:59:58 2008
@@ -53,7 +53,7 @@
 
 const char *ftp_log_transfer_mode(request_rec *r, char *a)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     if (fc->type == TYPE_A) {
         return "a";
     }

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c Fri Jan  4 09:59:58 2008
@@ -467,8 +467,6 @@
         }
     }
 
-    ftp_set_module_config(r->request_config, fc);
-
     r->per_dir_config = r->server->lookup_defaults;
 
     r->sent_bodyct     = 0;                      /* bytect isn't for body */
@@ -700,7 +698,7 @@
  */
 void ftp_send_response(request_rec *r, int status)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     ftp_server_config *fsc;
     conn_rec *c = r->connection;
 

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h Fri Jan  4 09:59:58 2008
@@ -6,7 +6,7 @@
  * another gmake (or a make ftp_protocol.h)
  *
  * Generated from ../.. on 
- * Thu Jan  3 03:23:23 2008
+ * Fri Jan  4 17:28:26 2008
  */
 
 

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_request.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_request.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_request.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_request.c Fri Jan  4 09:59:58 2008
@@ -40,7 +40,7 @@
  */
 void ftp_process_request(request_rec *r)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     ftp_server_config *fsc =
         ftp_get_module_config(r->server->module_config);
 

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_util.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_util.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_util.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_util.c Fri Jan  4 09:59:58 2008
@@ -416,7 +416,7 @@
 
 void ftp_set_authorization(request_rec *r)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     r->user = apr_pstrdup(r->pool, fc->user);
     apr_table_setn(r->headers_in, "Authorization", fc->authorization);
 }
@@ -432,7 +432,7 @@
  */
 int ftp_set_uri(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     apr_status_t res;
 
     if (arg[0] == '/') {

Modified: httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c Fri Jan  4 09:59:58 2008
@@ -255,21 +255,7 @@
 
 static void ftp_insert_filter(request_rec *r)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
-
-    /* XXX: mod_negotiation does not run the create_request hook, so
-     *      we must dig deeper looking for our request_config.  Look
-     *      at this later.
-     */
-    if (!fc) {
-        if (r->main) {
-            fc = ftp_get_module_config(r->main->request_config);
-        }
-
-        if (!fc) {
-            return;
-        }
-    }
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     if (fc->datasock && (fc->filter_mask & FTP_NEED_DATA_OUT)) {
         ap_add_output_filter_handle(ftp_data_out_filter_handle, fc, r,
@@ -289,14 +275,12 @@
 
 /*
  * The create request hook.  Used when Apache does an internal redirect
+ *
+ * XXX: because we are connection-oriented, perhaps this can go away?
+ *      left in place until we finish any request_rec refactoring
  */
 static int ftp_create_request(request_rec *r)
 {
-    if (r->main) {
-        ftp_set_module_config(r->request_config,
-                              ftp_get_module_config(r->main->request_config));
-    }
-
     return OK;
 }
 

Modified: httpd/mod_ftp/trunk/modules/ftp/mod_ftp_cmd_pwd.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/mod_ftp_cmd_pwd.c?rev=608945&r1=608944&r2=608945&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/mod_ftp_cmd_pwd.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/mod_ftp_cmd_pwd.c Fri Jan  4 09:59:58 2008
@@ -35,7 +35,7 @@
 
 static int mod_ftp_cmd_pwd2(request_rec *r, const char *arg)
 {
-    ftp_connection *fc = ftp_get_module_config(r->request_config);
+    ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
 
     fc->response_notes = apr_psprintf(r->pool,
                                       "PWD command has been overridden by "



Mime
View raw message