--- native/common/jk_ajp_common.c (revision 1585987) +++ native/common/jk_ajp_common.c (working copy) @@ -1482,7 +1482,7 @@ if ((r->is_chunked && len == 0) || len < 0 || len > maxlen) { len = maxlen; } - if ((jk_uint64_t)len > ae->left_bytes_to_send) { + if (ae->left_bytes_to_send > 0 && (jk_uint64_t)len > ae->left_bytes_to_send) { len = (int)ae->left_bytes_to_send; }