httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r609380 - in /httpd/mod_ftp/trunk: include/mod_ftp.h modules/ftp/ftp_connection.c modules/ftp/ftp_limitlogin.c modules/ftp/ftp_message.c modules/ftp/ftp_protocol.c
Date Sun, 06 Jan 2008 19:31:14 GMT
Author: wrowe
Date: Sun Jan  6 11:31:13 2008
New Revision: 609380

URL: http://svn.apache.org/viewvc?rev=609380&view=rev
Log:
Further corrections to eliminate c->base_server.

These map to 

  r->server        virtual host, with modified core config (for docroot)
  fc->orig_server  unmodified virtual host (fallback for r->server)
  c->base_server   by-IP host

Modified:
    httpd/mod_ftp/trunk/include/mod_ftp.h
    httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_message.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c

Modified: httpd/mod_ftp/trunk/include/mod_ftp.h
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/include/mod_ftp.h?rev=609380&r1=609379&r2=609380&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/include/mod_ftp.h (original)
+++ httpd/mod_ftp/trunk/include/mod_ftp.h Sun Jan  6 11:31:13 2008
@@ -403,7 +403,7 @@
 apr_status_t ftp_mutexdb_child_init(server_rec *s, apr_pool_t *p);
 apr_status_t ftp_mutexdb_cleanup(void *dummy);
 ftp_loginlimit_t ftp_limitlogin_check(const char *user, request_rec *r);
-int ftp_limitlogin_loggedout(const char *user, conn_rec *c, apr_pool_t *pool);
+int ftp_limitlogin_loggedout(conn_rec *c);
 
 /* FTP utilities
  *

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=609380&r1=609379&r2=609380&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c Sun Jan  6 11:31:13 2008
@@ -72,6 +72,7 @@
  */
 apr_status_t ftp_ssl_init(conn_rec *cdata)
 {
+    ftp_connection *fc = ftp_get_module_config(cdata->conn_config);
     apr_bucket_brigade *bb;
     apr_status_t rv;
     apr_socket_t *client_socket;
@@ -82,10 +83,10 @@
      */
     client_socket = ap_get_module_config(cdata->conn_config,
                                          &core_module);
-    rv = apr_socket_timeout_set(client_socket, cdata->base_server->timeout);
+    rv = apr_socket_timeout_set(client_socket, fc->orig_server->timeout);
 
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, cdata->base_server,
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, fc->orig_server,
                      "Failed to set socket timeout");
     }
 
@@ -95,7 +96,7 @@
     apr_brigade_destroy(bb);
 
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, cdata->base_server,
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, fc->orig_server,
                      "Failed to initialize the ftp ssl data stream");
     }
     
@@ -113,7 +114,7 @@
 {
     conn_rec *c = fc->connection;
     ftp_server_config *fsc = 
-        ftp_get_module_config(c->base_server->module_config);
+        ftp_get_module_config(fc->orig_server->module_config);
     apr_status_t rv;
 
     /* Check if a login message has been configured */
@@ -144,7 +145,7 @@
     rv = ftp_reply(fc, c->output_filters, fc->data_pool,
                    FTP_REPLY_SERVICE_READY, 0,
                    "%s FTP Server (%s) ready.",
-                   c->base_server->server_hostname,
+                   fc->orig_server->server_hostname,
                    ap_get_server_version());
     return rv;
 }
@@ -202,7 +203,7 @@
             /* Error initializing the connection, most likely from a
              * client attempting to connect w/o SSL.  Just drop the 
              * connection */
-            ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_INFO, rv, fc->orig_server,
                          "Error initializing SSL connection.  Client "
                          "connecting without SSL?");
             return OK;
@@ -225,7 +226,7 @@
 
     rv = ftp_send_welcome(fc);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_INFO, rv, fc->orig_server,
                      "Error sending server welcome string");
         return OK;
     }
@@ -238,7 +239,7 @@
     rv = apr_socket_timeout_set(client_socket,
                           fsc->timeout_login * APR_USEC_PER_SEC);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, fc->orig_server,
                      "Couldn't set SO_TIMEOUT socket option");
     }
 
@@ -289,7 +290,7 @@
         }
     }
     if (fc->logged_in) {
-        ftp_limitlogin_loggedout(fc->user, c, c->pool);
+        ftp_limitlogin_loggedout(c);
     }
     return OK;
 }

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c?rev=609380&r1=609379&r2=609380&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c Sun Jan  6 11:31:13 2008
@@ -249,8 +249,9 @@
     return FTP_LIMIT_OK;
 }
 
-int ftp_limitlogin_loggedout(const char *user, conn_rec *c, apr_pool_t *pool)
+int ftp_limitlogin_loggedout(conn_rec *c)
 {
+    ftp_connection *fc = ftp_get_module_config(c->conn_config);
     apr_status_t rv;
     apr_datum_t ukey;
     apr_datum_t ikey;
@@ -262,16 +263,16 @@
     int ival = 0;
     int sval = 0;
     ftp_server_config *fsc =
-        ftp_get_module_config(c->base_server->module_config);
+        ftp_get_module_config(fc->orig_server->module_config);
 
     if (!ftp_lock)
         return 0;
     
     ftp_mutex_on();
     if ((rv = apr_dbm_open(&dbf, fsc->limitdbfile,
-                           APR_DBM_RWCREATE, FTP_DB_FILE_MODE, pool))
+                           APR_DBM_RWCREATE, FTP_DB_FILE_MODE, fc->login_pool))
             != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, fc->orig_server,
                      "Cannot open FTPLimitDBFile file `%s' for logged out update",
                      fsc->limitdbfile);
         ftp_mutex_off();
@@ -279,8 +280,8 @@
     }
     /* This is a safe cast, it's a lookup key
      */
-    ukey.dptr = (char *)user;
-    ukey.dsize = strlen(user);
+    ukey.dptr = (char *)fc->user;
+    ukey.dsize = strlen(fc->user);
     rv = apr_dbm_fetch(dbf, ukey, &val);  /* error for non-existant? */
     if (val.dptr != NULL && val.dsize > 0) {
         apr_cpystrn(temp, val.dptr, MYMIN(sizeof(temp), val.dsize+1));

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_message.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_message.c?rev=609380&r1=609379&r2=609380&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_message.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_message.c Sun Jan  6 11:31:13 2008
@@ -65,7 +65,7 @@
                 break;
               case 'E':
                 apr_snprintf(outptr, outlen, "%s", 
-                             c->base_server->server_admin);
+                             fc->orig_server->server_admin);
                 break;
               case 'a':
                 apr_snprintf(outptr, outlen, "%s", c->local_ip);

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=609380&r1=609379&r2=609380&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c Sun Jan  6 11:31:13 2008
@@ -59,7 +59,7 @@
         pbuf = (char*)pb->base;
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     c->base_server, "FTP frl: empty bb");
+                     fc->orig_server, "FTP frl: empty bb");
 #endif
     }
     else {
@@ -78,7 +78,7 @@
         APR_BUCKET_REMOVE(pe);
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     c->base_server, "FTP frl: using previous bb");
+                     fc->orig_server, "FTP frl: using previous bb");
 #endif
     }
 
@@ -101,7 +101,7 @@
                 APR_BRIGADE_INSERT_HEAD(bb, pe);
 #ifdef FTP_TRACE
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                             c->base_server, "FTP frl: got empty brigade");
+                             fc->orig_server, "FTP frl: got empty brigade");
 #endif
                 return (block == APR_BLOCK_READ) ? APR_EGENERAL 
                                                  : APR_EAGAIN;
@@ -137,12 +137,12 @@
                     apr_socket_t *sock = e_next->data;
                     rv = apr_socket_atmark(sock, &mark);
                     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                        c->base_server, "FTP frl: atmark: %x %d",
+                        fc->orig_server, "FTP frl: atmark: %x %d",
 		        (int) rv, mark);
                     if (rv == APR_SUCCESS && mark) {
                         pe->length = 0;
                         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                            c->base_server, "FTP frl: Saw OOB");
+                            fc->orig_server, "FTP frl: Saw OOB");
                         continue;
                     }
                 }
@@ -246,7 +246,7 @@
                 apr_bucket_destroy(pe);
 #ifdef FTP_TRACE
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                             c->base_server, "FTP frl: got full line");
+                             fc->orig_server, "FTP frl: got full line");
 #endif
                 return APR_SUCCESS;
             }
@@ -255,7 +255,7 @@
     } while (pe->length <= 0);
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 c->base_server, "FTP frl: fall through success");
+                 fc->orig_server, "FTP frl: fall through success");
 #endif
     return APR_SUCCESS;
 }
@@ -316,14 +316,14 @@
 
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 c->base_server, "FTP frar: entering");
+                 fc->orig_server, "FTP frar: entering");
 #endif
 
     /* Review one command, only once */
     if (fc->next_request && *fc->next_request) {
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     c->base_server, "FTP frar: previously read-ahead");
+                     fc->orig_server, "FTP frar: previously read-ahead");
 #endif
         return APR_SUCCESS;
     }
@@ -334,7 +334,7 @@
                                          fc->connection->bucket_alloc);
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     c->base_server, "FTP frar: created next_pool");
+                     fc->orig_server, "FTP frar: created next_pool");
 #endif
     }
 
@@ -345,7 +345,7 @@
     if (APR_STATUS_IS_EAGAIN(rv)) {
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     c->base_server, "FTP frar: not ready - read again");
+                     fc->orig_server, "FTP frar: not ready - read again");
 #endif
         /* We actually like some failures here */
         return APR_SUCCESS;
@@ -362,7 +362,7 @@
 
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 c->base_server, "FTP frar: raw command: %s", ll);
+                 fc->orig_server, "FTP frar: raw command: %s", ll);
 #endif
 
     /*
@@ -388,12 +388,12 @@
 
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 c->base_server, "FTP frar: method: %s", method);
+                 fc->orig_server, "FTP frar: method: %s", method);
 #endif
     /* Can we ignore this command for a while? */
     if (ftp_cmd_abort_data(method)) {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     c->base_server, "FTP frar: I see ABOR");
+                     fc->orig_server, "FTP frar: I see ABOR");
         return APR_ECONNRESET;
     }
 
@@ -424,7 +424,7 @@
 
     r->pool = p;
     r->connection = c;
-    r->server = c->base_server;
+    r->server = fc->orig_server;
 
     r->user = NULL;
     r->ap_auth_type = NULL;



Mime
View raw message