~ubuntu-branches/ubuntu/trusty/apache2/trusty

« back to all changes in this revision

Viewing changes to modules/proxy/mod_proxy_ajp.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Fritsch, Stefan Fritsch, Peter Samuelson
  • Date: 2007-07-01 19:57:51 UTC
  • mfrom: (0.8.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070701195751-kcags6dpm5up3li5
Tags: 2.2.4-1
[ Stefan Fritsch ]
* Urgency medium for security fix
* Fix CVE-2007-1863: DoS in mod_cache
* New upstream version (Closes: #427050)
  - Fixes "proxy: error reading status line from remote server"
    (Closes: #410331)
* Fix CVE-2007-1862: mod_mem_cache DoS (introduced in 2.2.4)
* Change logrotate script to use reload instead of restart.
  (Closes: #298689)
* chmod o-rx /var/log/apache2 (Closes: #291841)
* chmod o-x suexec (Closes: #431048)
* Update patch for truncated mod_cgi 500 responses from upstream SVN
  (Closes: #412580)
* Don't use AddDefaultCharset for our docs (Closes: #414429)
* fix options syntax in sites-available/default (Closes: #419539)
* Move conf.d include to the end of apache2.conf (Closes: #305933)
* Remove log, cache, and lock files on purge (Closes: #428887)
* Ship /usr/lib/cgi-bin (Closes: #415698)
* Add note to README.Debian how to read docs (Closes: #350822)
* Document pid file name (Closes: #350286)
* Update Standards-Version (no changes needed)
* Fix some lintian warnings, add some overrides
* Start apache when doing a "restart" even if it was not running
  (Closes: #384682)
* reload config in apache2-doc postinst (Closes: #289289)
* don't fail in prerm if apache is not running (Closes: #418536)
* Suggest apache2-doc and www-browser (Closes: #399056)
* Make init script always display a warning if NO_START=1 since
  VERBOSE=yes is not the default anymore (Closes: #430116)
* Replace apache2(8) man page with a more current version
* Add httxt2dbm(8) man page
* Show -X option in help message (Closes: #391817)
* remove sick-hack-to-update-modules
* don't depend on procps on hurd (Closes: #431125)

[ Peter Samuelson ]
* Add shlibs:Depends to apache2.2-common.

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
                                AJP13_MAX_SEND_BODY_SZ);
176
176
 
177
177
        if (status != APR_SUCCESS) {
 
178
            /* We had a failure: Close connection to backend */
 
179
            conn->close++;
178
180
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
179
181
                         "proxy: ap_get_brigade failed");
180
182
            apr_brigade_destroy(input_brigade);
313
315
                /* AJP13_SEND_BODY_CHUNK: piece of data */
314
316
                status = ajp_parse_data(r, conn->data, &size, &buff);
315
317
                if (status == APR_SUCCESS) {
316
 
                    e = apr_bucket_transient_create(buff, size,
 
318
                    if (size == 0) {
 
319
                        /* AJP13_SEND_BODY_CHUNK with zero length
 
320
                         * is explicit flush message
 
321
                         */
 
322
                        e = apr_bucket_flush_create(r->connection->bucket_alloc);
 
323
                        APR_BRIGADE_INSERT_TAIL(output_brigade, e);
 
324
                    }
 
325
                    else {
 
326
                        e = apr_bucket_transient_create(buff, size,
317
327
                                                    r->connection->bucket_alloc);
318
 
                    APR_BRIGADE_INSERT_TAIL(output_brigade, e);
 
328
                        APR_BRIGADE_INSERT_TAIL(output_brigade, e);
319
329
 
320
 
                    if ( (conn->worker->flush_packets == flush_on) ||
321
 
                         ( (conn->worker->flush_packets == flush_auto) &&
322
 
                           (apr_poll(conn_poll, 1, &conn_poll_fd,
323
 
                                     conn->worker->flush_wait)
324
 
                             == APR_TIMEUP) ) ) {
325
 
                        e = apr_bucket_flush_create(r->connection->bucket_alloc);
326
 
                        APR_BRIGADE_INSERT_TAIL(output_brigade, e);
 
330
                        if ((conn->worker->flush_packets == flush_on) ||
 
331
                            ((conn->worker->flush_packets == flush_auto) &&
 
332
                            (apr_poll(conn_poll, 1, &conn_poll_fd,
 
333
                                      conn->worker->flush_wait)
 
334
                                        == APR_TIMEUP) ) ) {
 
335
                            e = apr_bucket_flush_create(r->connection->bucket_alloc);
 
336
                            APR_BRIGADE_INSERT_TAIL(output_brigade, e);
 
337
                        }
 
338
                        apr_brigade_length(output_brigade, 0, &bb_len);
 
339
                        if (bb_len != -1)
 
340
                            conn->worker->s->read += bb_len;
327
341
                    }
328
 
                    apr_brigade_length(output_brigade, 0, &bb_len);
329
 
                    if (bb_len != -1)
330
 
                        conn->worker->s->read += bb_len;
331
342
                    if (ap_pass_brigade(r->output_filters,
332
343
                                        output_brigade) != APR_SUCCESS) {
333
344
                        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
530
541
        goto cleanup;
531
542
    }
532
543
 
 
544
    /* Handle CPING/CPONG */
 
545
    if (worker->ping_timeout_set) {
 
546
        status = ajp_handle_cping_cpong(backend->sock, r,
 
547
                                        worker->ping_timeout);
 
548
        if (status != APR_SUCCESS) {
 
549
            backend->close++;
 
550
            ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server,
 
551
                         "proxy: AJP: cping/cpong failed to %pI (%s)",
 
552
                         worker->cp->addr,
 
553
                         worker->hostname);
 
554
            status = HTTP_SERVICE_UNAVAILABLE;
 
555
            goto cleanup;
 
556
        }
 
557
    }
533
558
    /* Step Three: Process the Request */
534
559
    status = ap_proxy_ajp_request(p, r, backend, origin, dconf, uri, url,
535
560
                                  server_portstr);