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

(-)server/core_filters.c (-5 / +15 lines)
Lines 33-39 Link Here
33
#include "apr_want.h"
33
#include "apr_want.h"
34
34
35
#define CORE_PRIVATE
35
#define CORE_PRIVATE
36
#include "ap_config.h"
37
#include "httpd.h"
36
#include "httpd.h"
38
#include "http_config.h"
37
#include "http_config.h"
39
#include "http_core.h"
38
#include "http_core.h"
Lines 343-348 Link Here
343
 */
342
 */
344
extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
343
extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
345
344
345
AP_DECLARE_HOOK(int,add_bytes_out,(conn_rec *c, apr_off_t bytes))
346
347
/*APR_HOOK_STRUCT(
348
    APR_HOOK_LINK(add_bytes_out)
349
)*/
350
351
AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(int,add_bytes_out,(conn_rec *c, apr_off_t bytes), (c, bytes), OK, DECLINED)
352
346
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *new_bb)
353
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *new_bb)
347
{
354
{
348
    conn_rec *c = f->c;
355
    conn_rec *c = f->c;
Lines 721-729 Link Here
721
            break;
728
            break;
722
        }
729
        }
723
    }
730
    }
724
    if ((logio_add_bytes_out != NULL) && (bytes_written > 0)) {
731
    if (bytes_written > 0) {
725
        logio_add_bytes_out(c, bytes_written);
732
    	if (logio_add_bytes_out != NULL) logio_add_bytes_out(c, bytes_written);
733
    	ap_run_add_bytes_out(c, bytes_written);
726
    }
734
    }
735
    
727
    *cumulative_bytes_written += bytes_written;
736
    *cumulative_bytes_written += bytes_written;
728
737
729
    arv = apr_socket_timeout_set(s, old_timeout);
738
    arv = apr_socket_timeout_set(s, old_timeout);
Lines 783-790 Link Here
783
            rv = arv;
792
            rv = arv;
784
        }
793
        }
785
    }
794
    }
786
    if ((logio_add_bytes_out != NULL) && (bytes_written > 0)) {
795
    if (bytes_written > 0) {
787
        logio_add_bytes_out(c, bytes_written);
796
    	if (logio_add_bytes_out != NULL) logio_add_bytes_out(c, bytes_written);
797
    	ap_run_add_bytes_out(c, bytes_written);
788
    }
798
    }
789
    *cumulative_bytes_written += bytes_written;
799
    *cumulative_bytes_written += bytes_written;
790
    if ((bytes_written < file_length) && (bytes_written > 0)) {
800
    if ((bytes_written < file_length) && (bytes_written > 0)) {
(-)include/http_core.h (+12 lines)
Lines 28-33 Link Here
28
28
29
#include "apr.h"
29
#include "apr.h"
30
#include "apr_hash.h"
30
#include "apr_hash.h"
31
#include "ap_config.h"
31
#include "apr_optional.h"
32
#include "apr_optional.h"
32
#include "util_filter.h"
33
#include "util_filter.h"
33
34
Lines 658-663 Link Here
658
APR_DECLARE_OPTIONAL_FN(void, ap_logio_add_bytes_out,
659
APR_DECLARE_OPTIONAL_FN(void, ap_logio_add_bytes_out,
659
                        (conn_rec *c, apr_off_t bytes));
660
                        (conn_rec *c, apr_off_t bytes));
660
661
662
/**
663
 * This hook provides a way for modules to track how many bytes of data is
664
 * ACTUALLY sent out verses the total size of the generated/static content
665
 * 
666
 * @param c A Connection Record handle
667
 * @param bytes the number of bytes sent out
668
 * 
669
 * @ingroup hooks
670
 */
671
//AP_DECLARE_HOOK(int,add_bytes_out,(conn_rec *c, apr_off_t bytes))
672
661
/* ----------------------------------------------------------------------
673
/* ----------------------------------------------------------------------
662
 *
674
 *
663
 * ident lookups with mod_ident
675
 * ident lookups with mod_ident
(-)modules/loggers/mod_logio.c (-1 / +1 lines)
Lines 59-68 Link Here
59
 * Optional function for the core to add to bytes_out
59
 * Optional function for the core to add to bytes_out
60
 */
60
 */
61
61
62
static void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes){
62
static int logio_add_bytes_out(conn_rec *c, apr_off_t bytes){
63
    logio_config_t *cf =
63
    logio_config_t *cf =

Return to bug 42699