| 737 | }; |
| 738 | |
| 739 | static apr_status_t gset_encode_bit(gset_encoder *encoder, int bit) |
| 740 | { |
| 741 | if (++encoder->bit >= 8) { |
| 742 | if (++encoder->offset >= encoder->datalen) { |
| 743 | apr_size_t nlen = encoder->datalen*2; |
| 744 | unsigned char *ndata = apr_pcalloc(encoder->pool, nlen); |
| 745 | if (!ndata) { |
| 746 | return APR_ENOMEM; |
| 747 | } |
| 748 | memcpy(ndata, encoder->data, encoder->datalen); |
| 749 | encoder->data = ndata; |
| 750 | encoder->datalen = nlen; |
| 751 | } |
| 752 | encoder->bit = 0; |
| 753 | encoder->data[encoder->offset] = 0xffu; |
| 754 | } |
| 755 | if (!bit) { |
| 756 | encoder->data[encoder->offset] &= ~cbit_mask[encoder->bit]; |
| 757 | } |
| 758 | return APR_SUCCESS; |
| 759 | } |
| 760 | |
| 761 | static apr_status_t gset_encode_next(gset_encoder *encoder, apr_uint64_t pval) |
| 762 | { |