httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r609007 - in /httpd/mod_ftp/trunk/modules/ftp: ftp_commands.c ftp_connection.c ftp_data_connection.c ftp_limitlogin.c ftp_protocol.c ftp_protocol.h
Date Fri, 04 Jan 2008 21:11:52 GMT
Author: wrowe
Date: Fri Jan  4 13:11:51 2008
New Revision: 609007

URL: http://svn.apache.org/viewvc?rev=609007&view=rev
Log:
Where we have a valid request_rec, use r->server consistently.

Where we must use fc->connection-> multiple times, simplify
this down to a c-> for those functions.

Modified:
    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_limitlogin.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h

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=609007&r1=609006&r2=609007&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Fri Jan  4 13:11:51 2008
@@ -566,7 +566,7 @@
         ap_pass_brigade(c->output_filters, bb);
 
         fc->response_notes = apr_psprintf(r->pool, FTP_MSG_HELP,
-                                          c->base_server->server_admin);
+                                          r->server->server_admin);
         return FTP_REPLY_HELP_MESSAGE;
     }
 }
@@ -578,7 +578,7 @@
     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);
+        ftp_get_module_config(r->server->module_config);
     conn_rec *cdata;
     request_rec *rr;
     apr_bucket_brigade *bb;
@@ -875,7 +875,7 @@
     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);
+        ftp_get_module_config(r->server->module_config);
     conn_rec *cdata;
     request_rec *rr;
     int res;
@@ -1010,7 +1010,7 @@
     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);
+        ftp_get_module_config(r->server->module_config);
     core_server_config *ftpcore = NULL;
     char *userdir = NULL;
     ftp_dir_config *dconf;
@@ -1028,6 +1028,7 @@
      * with each attempt to finish logging in.
      */
     c->base_server = fc->orig_server;
+    r->server = fc->orig_server;
     apr_cpystrn(fc->cwd, "/", APR_PATH_MAX + 1);
 
     /* By this point we have already extracted the arguments, so rewrite
@@ -1050,7 +1051,7 @@
         module *modp;
 
         ftpserver = apr_pcalloc(fc->login_pool, sizeof(*ftpserver));
-        memcpy(ftpserver, c->base_server, sizeof(*ftpserver));
+        memcpy(ftpserver, r->server, sizeof(*ftpserver));
 
         /* We need to count the number of modules in order to know
          * how big an array to allocate.  There is a variable in
@@ -1077,15 +1078,13 @@
 
                 ftpcore = apr_pcalloc(fc->login_pool, sizeof(*ftpcore));
                 core = 
-                     ap_get_module_config(c->base_server->module_config,
-                                          modp);
+                     ap_get_module_config(r->server->module_config, modp);
                 *ftpcore = *core;
                 ap_set_module_config(conf_vector, modp, ftpcore);
             }
             else {
                 ap_set_module_config(conf_vector, modp, 
-                     ap_get_module_config(c->base_server->module_config,
-                                          modp));
+                     ap_get_module_config(r->server->module_config, modp));
             }
         }
         ftpserver->module_config = (ap_conf_vector_t *)conf_vector;
@@ -1158,7 +1157,7 @@
 
                         if (rv != APR_SUCCESS) {
                             ap_log_error(APLOG_MARK, APLOG_ERR, rv,
-                                         c->base_server, "Couldn't "
+                                         r->server, "Couldn't "
                                          "create home directory (%s) for "
                                          "user %s",
                                          rr->filename, fc->user);
@@ -1168,13 +1167,13 @@
                             tmppath = apr_pstrcat(r->pool, userdir, "/", NULL);
                             apr_cpystrn(fc->cwd, tmppath, APR_PATH_MAX + 1);
                             ap_log_error(APLOG_MARK, APLOG_INFO|APLOG_NOERRNO,
-                                         0, c->base_server, "Created home "
+                                         0, r->server, "Created home "
                                          "directory (%s) for user %s",
                                          rr->filename, fc->user);
                         }
                     } else {
                         ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 
-                                     0, c->base_server, 
+                                     0, r->server, 
                                      "Home directory for user %s not "
                                      "found.  Using \"/\"", fc->user); 
                 
@@ -1182,14 +1181,14 @@
                 }
                 else {
                     ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0,
-                                 c->base_server, "Home directory for "
+                                 r->server, "Home directory for "
                                  "user %s not found.  Using \"/\"", 
                                  fc->user);
                 }
             } else {
                 
                 ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0,
-                             c->base_server, "Permission denied entering"
+                             r->server, "Permission denied entering"
                              " home directory for user %s.  Using \"/\"", 
                              fc->user);
             }
@@ -1254,7 +1253,7 @@
             case FTP_LIMIT_HIT_PERSERVER:
                 ap_destroy_sub_req(rr);
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,
-                             c->base_server, "FTP per server login limit hit for %s",
+                             r->server, "FTP per server login limit hit for %s",
                              fc->user);
 
                 fc->response_notes = apr_pstrdup(r->pool,
@@ -1266,7 +1265,7 @@
             case FTP_LIMIT_HIT_PERUSER:
                 ap_destroy_sub_req(rr);
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,
-                             c->base_server, "FTP per user login limit hit for %s",
+                             r->server, "FTP per user login limit hit for %s",
                              fc->user);
 
                 fc->response_notes = apr_pstrdup(r->pool,
@@ -1278,7 +1277,7 @@
             case FTP_LIMIT_HIT_PERIP:
                 ap_destroy_sub_req(rr);
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,
-                             c->base_server, "FTP per IP login limit hit for %s",
+                             r->server, "FTP per IP login limit hit for %s",
                              fc->user);
                 
                 fc->response_notes = apr_pstrdup(r->pool,
@@ -1289,7 +1288,7 @@
                 
             case FTP_LIMIT_ERROR:
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,
-                             c->base_server, "Error accessing DB for user %s; no login
limit in effect",
+                             r->server, "Error accessing DB for user %s; no login limit
in effect",
                              fc->user);
                 break;
 
@@ -1299,7 +1298,7 @@
         }
 
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,
-                     c->base_server, "FTP LOGIN FROM %s as %s",
+                     r->server, "FTP LOGIN FROM %s as %s",
                      c->remote_ip, fc->user);
 
         if (dconf->readme) {
@@ -1335,19 +1334,19 @@
     if ((strcmp(fc->user, "anonymous") == 0) || 
         strcmp(fc->user, "guest") == 0) {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0,
-                     c->base_server, 
+                     r->server, 
                      "ANONYMOUS FTP LOGIN REFUSED FROM %s",
                      c->remote_ip);
     }
     else {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0,
-                     c->base_server, "FTP LOGIN REFUSED FROM %s, %s", 
+                     r->server, "FTP LOGIN REFUSED FROM %s, %s", 
                      c->remote_ip, fc->user);
     }
 pass_try_again:
     if (++fc->login_attempts == fsc->max_login_attempts) {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, 
-                     c->base_server, "repeated login failures from %s",
+                     r->server, "repeated login failures from %s",
                      c->remote_ip);
         
         fc->response_notes = apr_pstrdup(r->pool,
@@ -1373,7 +1372,7 @@
     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);
+        ftp_get_module_config(r->server->module_config);
     apr_sockaddr_t *sa;
     apr_socket_t *s;
     apr_status_t rv;
@@ -1398,7 +1397,7 @@
                            APR_PROTO_TCP, fc->data_pool);
 #endif
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't create passive socket");
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
     }
@@ -1406,7 +1405,7 @@
     rv = apr_socket_opt_set(s, APR_SO_LINGER,
                             APR_MAX_SECS_TO_LINGER);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't set APR_SO_LINGER socket option");
         apr_socket_close(s);
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
@@ -1414,7 +1413,7 @@
 
     rv = apr_socket_opt_set(s, APR_SO_REUSEADDR, 1);
     if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't set APR_SO_REUSEADDR socket option");
         apr_socket_close(s);
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
@@ -1435,7 +1434,7 @@
         }
 
         if (rv != FTP_APR_EADDRINUSE || tries >= FTP_MAX_TRIES) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                          "Couldn't bind to passive socket");
             apr_socket_close(s);
             return FTP_REPLY_CANNOT_OPEN_DATACONN;
@@ -1460,7 +1459,7 @@
          * our acceptable port range
          */
         ++tries;
-        ap_log_error(APLOG_MARK, APLOG_INFO, 0, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
                      "Couldn't find port within range for passive "
                      "connection.  Restarting at %d (retry %d)", port, tries);
         apr_sleep(tries * APR_USEC_PER_SEC);
@@ -1468,7 +1467,7 @@
 
     rv = apr_socket_listen(s, 1);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't listen on passive socket");
         apr_socket_close(s);
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
@@ -1485,7 +1484,7 @@
     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);
+        ftp_get_module_config(r->server->module_config);
     int res;
     apr_sockaddr_t *sa;
     const char *addr;
@@ -1582,7 +1581,7 @@
     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);
+        ftp_get_module_config(r->server->module_config);
     int res;
     apr_sockaddr_t *sa;
     apr_socket_t *s;
@@ -1743,7 +1742,7 @@
 #endif
 
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't create socket");
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
     }
@@ -1778,7 +1777,7 @@
                           "Couldn't bind to low numbered port (<1024)");
         else
 #endif
-            ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                          "Couldn't bind to socket");
         apr_socket_close(s);
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
@@ -1787,7 +1786,7 @@
     rv = apr_sockaddr_info_get(&fc->clientsa, ip_addr, family,
                                port, 0, fc->data_pool);
     if (!fc->clientsa || rv) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Unable to resolve EPRT address of |%d|%s|%d|",
 #if APR_HAVE_IPV6
                      (family == APR_INET6) ? 2 : 1, ip_addr, port);
@@ -1813,7 +1812,7 @@
         char *test_ip = "(unknown)";
         if (apr_sockaddr_ip_get(&test_ip, fc->clientsa) != APR_SUCCESS
                 || (strcasecmp(test_ip, c->remote_ip) != 0)) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                          "Rejected EPRT data connection request to %s "
                          "(doesn't match the client IP %s and "
                          "not configured to AllowProxyPORT)",
@@ -1868,7 +1867,7 @@
      */
     if (!(fsc->options & FTP_OPT_ALLOWPROXYPORT)) {
         if (strcasecmp(ip_addr, c->remote_ip) != 0) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                          "Rejected PORT data connection request to %s "
                          "(doesn't match the client IP %s and "
                          "not configured to AllowProxyPORT)",
@@ -1899,7 +1898,7 @@
 #endif
 
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't create socket");
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
     }
@@ -1948,7 +1947,7 @@
                           "Couldn't bind to low numbered port (<1024)");
         else
 #endif
-            ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                          "Couldn't bind to socket");
         apr_socket_close(s);
         return FTP_REPLY_CANNOT_OPEN_DATACONN;
@@ -2060,7 +2059,7 @@
     ftp_server_config *fsc;
     int res;
 
-    fsc = ftp_get_module_config(c->base_server->module_config);
+    fsc = ftp_get_module_config(r->server->module_config);
     rfile = arg;
 
     /* Put a note in the env table for logging */
@@ -2599,7 +2598,7 @@
             char *err = apr_strerror(rv, error_str, sizeof(error_str));
             fc->response_notes = apr_pstrdup(r->pool, err);
 
-            ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                          "Error writing uploaded file");
 
             status = FTP_REPLY_LOCAL_ERROR;
@@ -2638,25 +2637,25 @@
         apr_off_t totsize = 0;
         apr_off_t restart = 0;
         if ((rv = apr_file_seek(file, APR_CUR, &restart)) != APR_SUCCESS) {
-            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
                          "STOR resume: failed to determine current position for truncation");
         }
         else if ((rv = apr_file_seek(file, APR_END, &totsize)) != APR_SUCCESS) {
-            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
                          "STOR resume: failed to determine current file size for truncation");
         }
         else if (totsize <= restart) {
             ; /* noop - nothing to truncate */
         }
         else if ((rv = apr_file_trunc(file, restart)) != APR_SUCCESS) {
-            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
                          "STOR resume: failed to truncate remaining file contents");
         }
     }
 
     rv = apr_file_close(file);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_WARNING, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
                      "STOR/APPE: failed to close file");
     }
 

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=609007&r1=609006&r2=609007&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c Fri Jan  4 13:11:51 2008
@@ -256,7 +256,7 @@
             rv = apr_socket_timeout_set(client_socket,
                                   fsc->timeout_idle * 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, r->server,
                              "Couldn't set socket timeout");
             }
             idle_timeout_set = 1;

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=609007&r1=609006&r2=609007&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 13:11:51 2008
@@ -59,12 +59,12 @@
     apr_status_t rv, res;
     int n;
 
-    fsc = ftp_get_module_config(c->base_server->module_config);
+    fsc = ftp_get_module_config(r->server->module_config);
 
     /* handle err condition when the creation of the socket had failed,
      * this will occur if a PORT command has failed */
     if (!fc->csock) {
-       ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, c->base_server,
+       ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r->server,
                     "Nonexistant connection");
        return APR_EGENERAL;
     }
@@ -92,7 +92,7 @@
                  * a single read ahead operation, no use in looping here
                  * if the command is not an ABOR.  bail out and let
                  * command processing occur as normal. */
-                ap_log_error(APLOG_MARK, APLOG_ERR, res, c->base_server,
+                ap_log_error(APLOG_MARK, APLOG_ERR, res, r->server,
                              "Activity on control channel while waiting "
                              "for client connect, processing command");
                 
@@ -118,7 +118,7 @@
 
         /* check csock closure first */
         if (res != APR_SUCCESS) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, res, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_ERR, res, r->server,
                          "Couldn't close passive connection");
         }
         
@@ -137,7 +137,7 @@
                     break;
                 }
                 if (!APR_STATUS_IS_EAGAIN(rv) || tries > FTP_MAX_TRIES) {
-                    ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+                    ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                                  "Couldn't connect to client");
                     apr_socket_close(fc->csock);
                     fc->csock = NULL;
@@ -158,12 +158,12 @@
     rv = apr_socket_opt_set(fc->datasock, APR_SO_LINGER,
                             APR_MAX_SECS_TO_LINGER);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't set APR_SO_LINGER socket option");
     }
     rv = apr_socket_opt_set(fc->datasock, APR_SO_REUSEADDR, 1);
     if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't set APR_SO_REUSEADDR socket option");
     }
     
@@ -171,7 +171,7 @@
     rv = apr_socket_timeout_set(fc->datasock,
                           fsc->timeout_data * APR_USEC_PER_SEC);
     if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Couldn't set socket timeout");
     }
 
@@ -214,11 +214,11 @@
     if (fc->clientsa == NULL) { /* Only check PASV, never PORT connections */ 
         if (!(fsc->options & FTP_OPT_ALLOWPROXYPASV)) {
             if (strcmp(fc->connection->remote_ip, cdata->remote_ip) != 0) {
-                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, fc->connection->base_server,
+                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                              "PASV data connection attempt from %s "
                              "doesn't match the client IP %s",
                              cdata->remote_ip, fc->connection->remote_ip);
-                ap_log_error(APLOG_MARK, APLOG_ERR, 0, fc->connection->base_server,
+                ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
                              "PASV data connection attempt denied, "
                              "not configured to AllowProxyPASV");
                 apr_socket_close(fc->datasock);

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=609007&r1=609006&r2=609007&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_limitlogin.c Fri Jan  4 13:11:51 2008
@@ -160,7 +160,7 @@
     int ival = 0;
     int sval = 0;
     ftp_server_config *fsc =
-        ftp_get_module_config(r->connection->base_server->module_config);
+        ftp_get_module_config(r->server->module_config);
 
     if (!ftp_lock)
         return FTP_LIMIT_OK;
@@ -168,7 +168,7 @@
     ftp_mutex_on();
     if ((rv = apr_dbm_open(&dbf, fsc->limitdbfile,
                            APR_DBM_RWCREATE, FTP_DB_FILE_MODE, r->pool)) != APR_SUCCESS)
{
-        ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                      "Cannot open FTPLimitDBFile file `%s' for login check",
                      fsc->limitdbfile);
         ftp_mutex_off();

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=609007&r1=609006&r2=609007&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c Fri Jan  4 13:11:51 2008
@@ -37,6 +37,7 @@
                                   ap_filter_t *input_filters,
                                   int block, ftp_connection *fc)
 {
+    conn_rec *c = fc->connection;
     char *last_char = NULL;
     apr_status_t rv;
     apr_bucket_pool *pb;
@@ -58,7 +59,7 @@
         pbuf = (char*)pb->base;
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frl: empty bb");
+                     c->base_server, "FTP frl: empty bb");
 #endif
     }
     else {
@@ -77,7 +78,7 @@
         APR_BUCKET_REMOVE(pe);
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frl: using previous bb");
+                     c->base_server, "FTP frl: using previous bb");
 #endif
     }
 
@@ -100,7 +101,7 @@
                 APR_BRIGADE_INSERT_HEAD(bb, pe);
 #ifdef FTP_TRACE
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                             fc->connection->base_server, "FTP frl: got empty brigade");
+                             c->base_server, "FTP frl: got empty brigade");
 #endif
                 return (block == APR_BLOCK_READ) ? APR_EGENERAL 
                                                  : APR_EAGAIN;
@@ -136,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, 
-                        fc->connection->base_server, "FTP frl: atmark: %x %d",
+                        c->base_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, 
-                            fc->connection->base_server, "FTP frl: Saw OOB");
+                            c->base_server, "FTP frl: Saw OOB");
                         continue;
                     }
                 }
@@ -245,7 +246,7 @@
                 apr_bucket_destroy(pe);
 #ifdef FTP_TRACE
                 ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                             fc->connection->base_server, "FTP frl: got full line");
+                             c->base_server, "FTP frl: got full line");
 #endif
                 return APR_SUCCESS;
             }
@@ -254,7 +255,7 @@
     } while (pe->length <= 0);
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 fc->connection->base_server, "FTP frl: fall through success");
+                 c->base_server, "FTP frl: fall through success");
 #endif
     return APR_SUCCESS;
 }
@@ -283,7 +284,7 @@
         fc->next_reqsize = 0;
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frrl: using read-ahead request");
+                     r->server, "FTP frrl: using read-ahead request");
 #endif
     }
     else if ((rv = ftp_read_line(&r->the_request, &bytes_read,
@@ -297,7 +298,7 @@
     ll = r->the_request;
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 fc->connection->base_server, "FTP frrl: raw command: %s", ll);
+                 r->server, "FTP frrl: raw command: %s", ll);
 #endif
     r->method = ftp_toupper(r->pool, ap_getword_white(r->pool, &ll));
     r->method = ftp_get_cmd_alias(r->method);    
@@ -308,20 +309,21 @@
 
 apr_status_t ftp_read_ahead_request(ftp_connection *fc) 
 {
+    conn_rec *c = fc->connection;
     apr_status_t rv;
     const char *ll;
     const char *method;
 
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 fc->connection->base_server, "FTP frar: entering");
+                 c->base_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, 
-                     fc->connection->base_server, "FTP frar: previously read-ahead");
+                     c->base_server, "FTP frar: previously read-ahead");
 #endif
         return APR_SUCCESS;
     }
@@ -332,7 +334,7 @@
                                          fc->connection->bucket_alloc);
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frar: created next_pool");
+                     c->base_server, "FTP frar: created next_pool");
 #endif
     }
 
@@ -343,7 +345,7 @@
     if (APR_STATUS_IS_EAGAIN(rv)) {
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frar: not ready - read again");
+                     c->base_server, "FTP frar: not ready - read again");
 #endif
         /* We actually like some failures here */
         return APR_SUCCESS;
@@ -360,7 +362,7 @@
 
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 fc->connection->base_server, "FTP frar: raw command: %s", ll);
+                 c->base_server, "FTP frar: raw command: %s", ll);
 #endif
 
     /*
@@ -386,12 +388,12 @@
 
 #ifdef FTP_TRACE
     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                 fc->connection->base_server, "FTP frar: method: %s", method);
+                 c->base_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, 
-                     fc->connection->base_server, "FTP frar: I see ABOR");
+                     c->base_server, "FTP frar: I see ABOR");
         return APR_ECONNRESET;
     }
 
@@ -499,13 +501,13 @@
         tmp_bb = fc->next_bb;
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frr: using next_bb");
+                     r->server, "FTP frr: using next_bb");
 #endif
     } else {
         tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frr: using tmp_bb");
+                     r->server, "FTP frr: using tmp_bb");
 #endif
     }
     if ((rv = ftp_read_request_line(fc, r, tmp_bb)) != APR_SUCCESS)
@@ -531,7 +533,7 @@
             apr_socket_timeout_get(client_socket, &timeout);
 
             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, 
-                         c->base_server,
+                         r->server,
                          "User %s timed out after %d seconds", fc->user,
                          (int) (timeout / APR_USEC_PER_SEC));
 
@@ -558,7 +560,7 @@
              * an error since the client is long gone.  Just log the error.
              */
             ap_log_error(APLOG_MARK, APLOG_INFO, rv, 
-                         c->base_server, "User %s disconnected", fc->user);
+                         r->server, "User %s disconnected", fc->user);
         }
         /* Return NULL to the connection handler, causing the connection
          * to be dropped.
@@ -579,7 +581,7 @@
         fc->next_pool = NULL;
 #ifdef FTP_TRACE
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, 
-                     fc->connection->base_server, "FTP frr: clearing next_pool");
+                     r->server, "FTP frr: clearing next_pool");
 #endif
     }
 
@@ -588,7 +590,7 @@
     if ((access_status = ap_run_post_read_request(r))) {
 
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,
-                     c->base_server, "Post read request failed, dropping "
+                     r->server, "Post read request failed, dropping "
                      "client connection.");
         return NULL;
     }
@@ -731,7 +733,7 @@
                               ap_get_server_version(), "\"", NULL));
         break;
     case FTP_REPLY_CONTROL_CLOSE:
-        fsc = ftp_get_module_config(c->base_server->module_config);
+        fsc = ftp_get_module_config(r->server->module_config);
         if (fsc->exit_message) {
             if (fsc->exit_message_isfile) {
                 ftp_show_file(c->output_filters, r->pool,

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=609007&r1=609006&r2=609007&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.h Fri Jan  4 13:11:51 2008
@@ -6,7 +6,7 @@
  * another gmake (or a make ftp_protocol.h)
  *
  * Generated from ../.. on 
- * Fri Jan  4 17:28:26 2008
+ * Fri Jan  4 21:10:17 2008
  */
 
 



Mime
View raw message