| 759 | } |
| 760 | |
| 761 | static apr_status_t gset_encode_next(gset_encoder *encoder, apr_uint64_t pval) |
| 762 | { |
| 763 | apr_uint64_t delta, flex_bits; |
| 764 | apr_status_t status = APR_SUCCESS; |
| 765 | int i; |
| 766 | |
| 767 | delta = pval - encoder->last; |
| 768 | encoder->last = pval; |
| 769 | flex_bits = (delta >> encoder->fixed_bits); |
| 770 | /* Intentional no APLOGNO */ |
| 771 | ap_log_perror(APLOG_MARK, GCSLOG_LEVEL, 0, encoder->pool, |
| 772 | "h2_push_diary_enc: val=%"APR_UINT64_T_HEX_FMT", delta=%" |
| 773 | APR_UINT64_T_HEX_FMT" flex_bits=%"APR_UINT64_T_FMT", " |
| 774 | ", fixed_bits=%d, fixed_val=%"APR_UINT64_T_HEX_FMT, |
| 775 | pval, delta, flex_bits, encoder->fixed_bits, delta&encoder->fixed_mask); |
| 776 | for (; flex_bits != 0; --flex_bits) { |
| 777 | status = gset_encode_bit(encoder, 1); |
| 778 | if (status != APR_SUCCESS) { |
| 779 | return status; |
| 780 | } |
| 781 | } |
| 782 | status = gset_encode_bit(encoder, 0); |
| 783 | if (status != APR_SUCCESS) { |
| 784 | return status; |
| 785 | } |
| 786 | |
| 787 | for (i = encoder->fixed_bits-1; i >= 0; --i) { |
| 788 | status = gset_encode_bit(encoder, (delta >> i) & 1); |
| 789 | if (status != APR_SUCCESS) { |
| 790 | return status; |
| 791 | } |
| 792 | } |
| 793 | return APR_SUCCESS; |
| 794 | } |
| 795 | |
| 796 | /** |
| 797 | * Get a cache digest as described in |
no test coverage detected