View | Details | Raw Unified | Return to bug 48361
Collapse All | Expand All

(-)httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c.orig (-12 / +3 lines)
Lines 66-74 static apr_status_t ftp_open_datasock(re Link Here
66
    apr_socket_t *s;
66
    apr_socket_t *s;
67
    apr_status_t rv, res;
67
    apr_status_t rv, res;
68
    int n;
68
    int n;
69
#ifdef HAVE_SOL_IP_H
69
    const int sopt = IPTOS_THROUGHPUT;
70
    int sd, sopt;
71
#endif
72
70
73
    /*
71
    /*
74
     * handle err condition when the creation of the socket had failed, this
72
     * handle err condition when the creation of the socket had failed, this
Lines 172-189 static apr_status_t ftp_open_datasock(re Link Here
172
        fc->passive_created = -1;
170
        fc->passive_created = -1;
173
    }
171
    }
174
172
175
#ifdef HAVE_SOL_IP_H
173
    rv = apr_socket_set_opt(fc->datasock, APR_SO_IPTOS, sopt);
176
    sopt = IPTOS_THROUGHPUT;
174
    if (rv != APR_SUCCESS && rv != APR_NOTIMPL) {
177
    if (((apr_os_sock_get(&sd, fc->datasock)) == APR_SUCCESS) &&
178
#ifdef HAVE_SOL_IP
179
         (setsockopt(sd, SOL_IP, IP_TOS, &sopt, sizeof(sopt)) < 0)) {
180
#else
181
         (setsockopt(sd, IPPROTO_IP, IP_TOS, &sopt, sizeof(sopt)) < 0)) {
182
#endif
183
        ap_log_error(APLOG_MARK, APLOG_ERR, errno, r->server,
175
        ap_log_error(APLOG_MARK, APLOG_ERR, errno, r->server,
184
                     "Failed to set TOS priority");
176
                     "Failed to set TOS priority");
185
    }
177
    }
186
#endif
187
178
188
    rv = apr_socket_opt_set(fc->datasock, APR_SO_LINGER,
179
    rv = apr_socket_opt_set(fc->datasock, APR_SO_LINGER,
189
                            APR_MAX_SECS_TO_LINGER);
180
                            APR_MAX_SECS_TO_LINGER);

Return to bug 48361