httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r609882 - in /httpd/mod_ftp/trunk/modules/ftp: ftp_connection.c ftp_protocol.c
Date Tue, 08 Jan 2008 06:09:50 GMT
Author: wrowe
Date: Mon Jan  7 22:09:49 2008
New Revision: 609882

URL: http://svn.apache.org/viewvc?rev=609882&view=rev
Log:
A few final scope changes; let's ensure the socket is set up once
and only once, at the time of creation, and used from there on out.

Modified:
    httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c
    httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c

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=609882&r1=609881&r2=609882&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_connection.c Mon Jan  7 22:09:49 2008
@@ -83,8 +83,7 @@
      * ignores the timeout for the purpose of AP_MODE_INIT.
      * Fix a timeout so the core read filter will behave.
      */
-    client_socket = ap_get_module_config(cdata->conn_config,
-                                         &core_module);
+    client_socket = ap_get_module_config(cdata->conn_config, &core_module);
     rv = apr_socket_timeout_set(client_socket, fc->orig_server->timeout);
 
     if (rv != APR_SUCCESS) {
@@ -168,10 +167,6 @@
     int idle_timeout_set = 0;
     extern ap_filter_rec_t *ftp_ssl_input_filter_handle;
     extern ap_filter_rec_t *ftp_ssl_output_filter_handle;
-    
-    apr_socket_t *client_socket = ap_get_module_config(c->conn_config,
-                                                       &core_module);
-
     ftp_server_config *fsc =
         ftp_get_module_config(c->base_server->module_config);
 
@@ -238,7 +233,7 @@
      */
 
     /* Set initial login timeout value */
-    rv = apr_socket_timeout_set(client_socket,
+    rv = apr_socket_timeout_set(fc->cntlsock,
                           fsc->timeout_login * APR_USEC_PER_SEC);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, fc->orig_server,
@@ -256,7 +251,7 @@
          * be setting the socket timeout on every single request.
          */
         if (!idle_timeout_set) {
-            rv = apr_socket_timeout_set(client_socket,
+            rv = apr_socket_timeout_set(fc->cntlsock,
                                   fsc->timeout_idle * APR_USEC_PER_SEC);
             if (rv != APR_SUCCESS) {
                 ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, r->server,

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=609882&r1=609881&r2=609882&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_protocol.c Mon Jan  7 22:09:49 2008
@@ -517,8 +517,6 @@
         apr_time_t timeout;
         apr_bucket_brigade *bb;
         apr_bucket *b;
-        apr_socket_t *client_socket = ap_get_module_config(c->conn_config,
-                                                           &core_module);
         char *err;
         apr_size_t len;
 
@@ -532,7 +530,7 @@
              * will return with an error.  Here we send the client a 
              * friendly error message, and close the connection.
              */
-            apr_socket_timeout_get(client_socket, &timeout);
+            apr_socket_timeout_get(fc->cntlsock, &timeout);
 
             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, 
                          r->server,



Mime
View raw message