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 2011/01/05 02:38:06 UTC

svn commit: r1055262 - /httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c

Author: wrowe
Date: Wed Jan  5 01:38:06 2011
New Revision: 1055262

URL: http://svn.apache.org/viewvc?rev=1055262&view=rev
Log:
Revert my local work on apr TOS options miscommitted in r1055260

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

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=1055262&r1=1055261&r2=1055262&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c Wed Jan  5 01:38:06 2011
@@ -30,44 +30,6 @@
 #ifdef HAVE_NETINET_IP_H
 #include <netinet/ip.h>
 #endif
-#ifdef WIN32
-#endif
-
-#ifdef APR_IP_TOS
-
-/* Supported by APR */
-#define new_socket_opt_set apr_socket_opt_set
-
-#else
-
-static apr_status_t new_socket_opt_set(apr_socket_t *sock,
-                                       apr_int32_t opt, apr_int32_t on)
-{
-#ifdef HAVE_NETINET_IP_H
-    apr_status_t rv;
-    int sd;
-    if ((rv = apr_os_sock_get(&sd, sock)) != APR_SUCCESS)
-         return rv;
-
-#ifdef HAVE_SOL_IP
-    if (setsockopt(sd, SOL_IP, IP_TOS, &on, sizeof(sopt)) < 0)
-#else
-    if (setsockopt(sd, IPPROTO_IP, IP_TOS, &on, sizeof(sopt)) < 0)
-#endif
-        return apr_get_netos_error();
-    return APR_SUCCESS;
-
-#else
-    return APR_ENOTIMPL;
-#endif
-
-}
-
-/* Ignored/placeholder until apr_socket_opt_set supports this flag */
-#define APR_IP_TOS 0
-#endif
-
-
 
 /*
  * ftp_reset_dataconn: Close any data channel listen/connect socket and
@@ -104,7 +66,7 @@ static apr_status_t ftp_open_datasock(re
     apr_socket_t *s;
     apr_status_t rv, res;
     int n;
-#ifdef HAVE_NETINET_IP_H
+#ifdef HAVE_SOL_IP_H
     int sd, sopt;
 #endif
 
@@ -210,11 +172,16 @@ static apr_status_t ftp_open_datasock(re
         fc->passive_created = -1;
     }
 
-#ifdef IPTOS_THROUGHPUT
-    rv = new_socket_opt_set(fc->datasock, APR_IP_TOS, IPTOS_THROUGHPUT);
-    if (rv != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, r->server,
-                     "Couldn't set APR_IP_TOS socket option");
+#ifdef HAVE_SOL_IP_H
+    sopt = IPTOS_THROUGHPUT;
+    if (((apr_os_sock_get(&sd, fc->datasock)) == APR_SUCCESS) &&
+#ifdef HAVE_SOL_IP
+         (setsockopt(sd, SOL_IP, IP_TOS, &sopt, sizeof(sopt)) < 0)) {
+#else
+         (setsockopt(sd, IPPROTO_IP, IP_TOS, &sopt, sizeof(sopt)) < 0)) {
+#endif
+        ap_log_error(APLOG_MARK, APLOG_ERR, errno, r->server,
+                     "Failed to set TOS priority");
     }
 #endif