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

(-)modules/fcgid/fcgid_proc_win.c.orig (-5 / +14 lines)
Lines 380-398 Link Here
380
    apr_bucket *bucket_request;
380
    apr_bucket *bucket_request;
381
    apr_status_t rv;
381
    apr_status_t rv;
382
    DWORD transferred;
382
    DWORD transferred;
383
    apr_bucket_brigade* tmpbb = apr_brigade_create(birgade_send->p, 
384
                                                   birgade_send->bucket_alloc);
383
385
384
    handle_info = (fcgid_namedpipe_handle *) ipc_handle->ipc_handle_info;
386
    handle_info = (fcgid_namedpipe_handle *) ipc_handle->ipc_handle_info;
385
387
386
    for (bucket_request = APR_BRIGADE_FIRST(birgade_send);
388
    while (!APR_BRIGADE_EMPTY(birgade_send)) {
387
         bucket_request != APR_BRIGADE_SENTINEL(birgade_send);
388
         bucket_request = APR_BUCKET_NEXT(bucket_request))
389
    {
390
        const char *write_buf;
389
        const char *write_buf;
391
        apr_size_t write_buf_len;
390
        apr_size_t write_buf_len;
392
        apr_size_t has_write;
391
        apr_size_t has_write;
393
392
394
        if (APR_BUCKET_IS_METADATA(bucket_request))
393
        bucket_request = APR_BRIGADE_FIRST(birgade_send);
394
395
        if (APR_BUCKET_IS_METADATA(bucket_request)) {
396
            apr_bucket_delete(bucket_request);
395
            continue;
397
            continue;
398
        }
396
399
397
        if ((rv = apr_bucket_read(bucket_request, &write_buf, &write_buf_len,
400
        if ((rv = apr_bucket_read(bucket_request, &write_buf, &write_buf_len,
398
                                  APR_BLOCK_READ)) != APR_SUCCESS) {
401
                                  APR_BLOCK_READ)) != APR_SUCCESS) {
Lines 401-406 Link Here
401
            return rv;
404
            return rv;
402
        }
405
        }
403
406
407
        APR_BUCKET_REMOVE(bucket_request);
408
        APR_BRIGADE_INSERT_TAIL(tmpbb, bucket_request);
409
404
        /* Write the buffer to fastcgi server */
410
        /* Write the buffer to fastcgi server */
405
        has_write = 0;
411
        has_write = 0;
406
        while (has_write < write_buf_len) {
412
        while (has_write < write_buf_len) {
Lines 411-416 Link Here
411
                          write_buf_len - has_write,
417
                          write_buf_len - has_write,
412
                          &byteswrite, &handle_info->overlap_write)) {
418
                          &byteswrite, &handle_info->overlap_write)) {
413
                has_write += byteswrite;
419
                has_write += byteswrite;
420
                apr_brigade_cleanup(tmpbb);
414
                continue;
421
                continue;
415
            } else if ((rv = GetLastError()) != ERROR_IO_PENDING) {
422
            } else if ((rv = GetLastError()) != ERROR_IO_PENDING) {
416
                ap_log_rerror(APLOG_MARK, APLOG_WARNING,
423
                ap_log_rerror(APLOG_MARK, APLOG_WARNING,
Lines 437-442 Link Here
437
                        return APR_ESPIPE;
444
                        return APR_ESPIPE;
438
                    }
445
                    }
439
                    has_write += transferred;
446
                    has_write += transferred;
447
                    apr_brigade_cleanup(tmpbb);
440
                    continue;
448
                    continue;
441
                } else {
449
                } else {
442
                    ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0,
450
                    ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0,
Lines 448-453 Link Here
448
        }
456
        }
449
    }
457
    }
450
458
459
    apr_brigade_destroy(tmpbb);
451
    return APR_SUCCESS;
460
    return APR_SUCCESS;
452
}
461
}
453
462
(-)modules/fcgid/fcgid_proc_unix.c.orig (-3 / +10 lines)
Lines 762-775 Link Here
762
    struct iovec vec[FCGID_VEC_COUNT];
762
    struct iovec vec[FCGID_VEC_COUNT];
763
    int nvec = 0;
763
    int nvec = 0;
764
    apr_bucket *e;
764
    apr_bucket *e;
765
    apr_bucket_brigade* tmpbb = apr_brigade_create(output_brigade->p,output_brigade->bucket_alloc);
766
767
    while (!APR_BRIGADE_EMPTY(output_brigade)) {
768
        e = APR_BRIGADE_FIRST(output_brigade);
765
769
766
    for (e = APR_BRIGADE_FIRST(output_brigade);
767
         e != APR_BRIGADE_SENTINEL(output_brigade);
768
         e = APR_BUCKET_NEXT(e)) {
769
        apr_size_t len;
770
        apr_size_t len;
770
        const char* base;
771
        const char* base;
771
772
772
        if (APR_BUCKET_IS_METADATA(e)) {
773
        if (APR_BUCKET_IS_METADATA(e)) {
774
            apr_bucket_delete(e);
773
            continue;
775
            continue;
774
        }
776
        }
775
777
Lines 780-785 Link Here
780
            return rv;
782
            return rv;
781
        }
783
        }
782
784
785
        APR_BUCKET_REMOVE(e);
786
        APR_BRIGADE_INSERT_TAIL(tmpbb, e);
787
783
        vec[nvec].iov_len = len;
788
        vec[nvec].iov_len = len;
784
        vec[nvec].iov_base = (char*) base;
789
        vec[nvec].iov_base = (char*) base;
785
        if (nvec == (FCGID_VEC_COUNT - 1)) {
790
        if (nvec == (FCGID_VEC_COUNT - 1)) {
Lines 789-794 Link Here
789
                               FCGID_VEC_COUNT)) != APR_SUCCESS)
794
                               FCGID_VEC_COUNT)) != APR_SUCCESS)
790
                return rv;
795
                return rv;
791
            nvec = 0;
796
            nvec = 0;
797
            apr_brigade_cleanup(tmpbb);
792
        }
798
        }
793
        else
799
        else
794
            nvec++;
800
            nvec++;
Lines 800-805 Link Here
800
            return rv;
806
            return rv;
801
    }
807
    }
802
808
809
    apr_brigade_destroy(tmpbb);
803
    return APR_SUCCESS;
810
    return APR_SUCCESS;
804
}
811
}
805
812

Return to bug 51747