* 20201214.3 (2.5.1-dev) Move ap_ssl_* into new http_ssl.h header file
* 20201214.4 (2.5.1-dev) Add ap_ssl_ocsp* hooks and functions to http_ssl.h.
* 20210420.0 (2.5.1-dev) Removed `ap_bytes_t` again from httpd.h and usage in ap_ssl_ocsp*()
+ * 20210506.0 (2.5.1-dev) Add ap_proxy_tunnel_conn_get_read() and
+ * ap_proxy_tunnel_conn_get_transferred() change
+ * ap_proxy_transfer_between_connections() sent to apr_off_t *.
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20210420
+#define MODULE_MAGIC_NUMBER_MAJOR 20210506
#endif
#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
apr_bucket_brigade *bb_i,
apr_bucket_brigade *bb_o,
const char *name,
- int *sent,
+ apr_off_t *sent,
apr_off_t bsize,
int flags);
+/*
+ * returns number of bytes read from the back end tunnel
+ * @param ptunnel proxy_tunnel_rec use during the tunnelling.
+ * @return apr_off_t number of bytes read.
+ */
+PROXY_DECLARE (apr_off_t) ap_proxy_tunnel_conn_get_read(
+ proxy_tunnel_rec *ptunnel);
+/*
+ * returns number of bytes sent to the back end tunnel
+ * @param ptunnel proxy_tunnel_rec use during the tunnelling.
+ * @return apr_off_t number of bytes sent.
+ */
+PROXY_DECLARE (apr_off_t) ap_proxy_tunnel_conn_get_transferred(
+ proxy_tunnel_rec *ptunnel);
+
extern module PROXY_DECLARE_DATA proxy_module;
#endif /*MOD_PROXY_H*/
apr_bucket_brigade *bb_i,
apr_bucket_brigade *bb_o,
const char *name,
- int *sent,
+ apr_off_t *sent,
apr_off_t bsize,
int flags)
{
apr_status_t rv;
int flush_each = 0;
unsigned int num_reads = 0;
-#ifdef DEBUGGING
apr_off_t len;
-#endif
/*
* Compat: since FLUSH_EACH is default (and zero) for legacy reasons, we
if (APR_BRIGADE_EMPTY(bb_i)) {
break;
}
-#ifdef DEBUGGING
len = -1;
apr_brigade_length(bb_i, 0, &len);
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03306)
"ap_proxy_transfer_between_connections: "
"read %" APR_OFF_T_FMT
" bytes from %s", len, name);
-#endif
- if (sent) {
- *sent = 1;
+ if (sent && len > 0) {
+ *sent = *sent + len;
}
ap_proxy_buckets_lifetime_transform(r, bb_i, bb_o);
if (flush_each) {
unsigned int down_in:1,
down_out:1;
+ apr_off_t exchanged;
};
+PROXY_DECLARE(apr_off_t) ap_proxy_tunnel_conn_get_read(proxy_tunnel_rec *ptunnel)
+{
+ return ptunnel->origin->exchanged;
+}
+PROXY_DECLARE(apr_off_t) ap_proxy_tunnel_conn_get_transferred(proxy_tunnel_rec *ptunnel)
+{
+ return ptunnel->client->exchanged;
+}
+
PROXY_DECLARE(apr_status_t) ap_proxy_tunnel_create(proxy_tunnel_rec **ptunnel,
request_rec *r, conn_rec *c_o,
const char *scheme)
{
struct proxy_tunnel_conn *out = in->other;
apr_status_t rv;
- int sent = 0;
+ apr_off_t sent = 0;
ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, tunnel->r,
"proxy: %s: %s input ready",
if (sent && out == tunnel->client) {
tunnel->replied = 1;
}
+
+ in->exchanged = in->exchanged + sent;
+
if (rv != APR_SUCCESS) {
if (APR_STATUS_IS_INCOMPLETE(rv)) {
/* Pause POLLIN while waiting for POLLOUT on the other