You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2009/05/29 17:19:17 UTC

svn commit: r780013 - /httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c

Author: wrowe
Date: Fri May 29 15:19:17 2009
New Revision: 780013

URL: http://svn.apache.org/viewvc?rev=780013&view=rev
Log:
httpd-2.0 compatibility; for what it's worth.

Remove the .pid suffix feature (as consistent with mod_cgid) and don't attempt
to close the listeners (also consistent with mod_cgid, in 2.0 branch).



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

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c?rev=780013&r1=780012&r2=780013&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c Fri May 29 15:19:17 2009
@@ -251,7 +251,9 @@
     sockinfo.os_sock = (int *)CMSG_DATA(cmsg);
     sockinfo.family = sa->sa.sin.sin_family;
     sockinfo.type = SOCK_STREAM;
+#if APR_MAJOR_VERSION > 0
     sockinfo.protocol = IPPROTO_TCP;
+#endif
     sockinfo.local = (struct sockaddr *)&sa->sa;
 
     stat = apr_os_sock_make(sock, &sockinfo, p); 
@@ -284,8 +286,10 @@
     apr_signal(SIGCHLD, SIG_IGN);
     apr_signal(SIGHUP, daemon_signal_handler);
 
+#if AP_SERVER_MAJORVERSION_NUMBER > 2 || AP_SERVER_MINORVERSION_NUMBER > 0
     /* Close our copy of the listening sockets */
     ap_close_listeners();
+#endif
 
     if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
         ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
@@ -304,8 +308,13 @@
     }
 
     /* Not all flavors of unix use the current umask for AF_UNIX perms */
+#if APR_MAJOR_VERSION > 0
     rv = apr_file_perms_set(sockname, APR_FPROT_UREAD|APR_FPROT_UWRITE
                                                      |APR_FPROT_UEXECUTE);
+#else
+    rv = apr_file_perms_set(sockname, APR_UREAD|APR_UWRITE
+                                               |APR_UEXECUTE);
+#endif
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, main_server,
                      "Couldn't set permissions on unix domain socket %s",
@@ -542,7 +551,9 @@
 
 int lowportd_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 {
+#if AP_SERVER_MAJORVERSION_NUMBER > 2 || AP_SERVER_MINORVERSION_NUMBER > 0
     sockname = ap_append_pid(pconf, DEFAULT_SOCKET, ".");
+#endif
     return OK;
 }
 
@@ -593,8 +604,10 @@
     }
 
     /* Make sure the pid is appended to the sockname */
-    sockname = ap_append_pid(cmd->pool, arg, ".");
-    sockname = ap_server_root_relative(cmd->pool, sockname);
+#if AP_SERVER_MAJORVERSION_NUMBER > 2 || AP_SERVER_MINORVERSION_NUMBER > 0
+    arg = ap_append_pid(cmd->pool, arg, ".");
+#endif
+    sockname = ap_server_root_relative(cmd->pool, arg);
 
     if (!sockname) {
         return apr_pstrcat(cmd->pool, "Invalid FTPLowPortSock path",