diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-10-27 14:33:26 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-10-27 14:33:26 +0000 |
commit | ffd8df879dea5b306b1a1615c2eabe0d463a3a3b (patch) | |
tree | 278ef36a856c2ddc756a1474d69906be7dfbf316 /src/libtipidee/tipidee_response_header_preparebuiltin.c | |
parent | d05b3963381a4cd0329bced938d79a23bb392658 (diff) | |
download | tipidee-ffd8df879dea5b306b1a1615c2eabe0d463a3a3b.tar.xz |
custom-headers revamp, can be removed now
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libtipidee/tipidee_response_header_preparebuiltin.c')
-rw-r--r-- | src/libtipidee/tipidee_response_header_preparebuiltin.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libtipidee/tipidee_response_header_preparebuiltin.c b/src/libtipidee/tipidee_response_header_preparebuiltin.c index a04b666..56978c7 100644 --- a/src/libtipidee/tipidee_response_header_preparebuiltin.c +++ b/src/libtipidee/tipidee_response_header_preparebuiltin.c @@ -18,11 +18,15 @@ int tipidee_response_header_preparebuiltin (tipidee_response_header *tab, uint32 if (pos++ >= len) return 0 ; tab[i].options = (uint8_t)s[pos] ; if (pos++ >= len) return 0 ; - tab[i].value = s + pos ; - next = memchr(s + pos, 0, len - pos) ; - if (!next) return 0 ; - pos = next - s ; - if (pos++ >= len) return 0 ; + if (tab[i].options & 0x80) tab[i].value = 0 ; + else + { + tab[i].value = s + pos ; + next = memchr(s + pos, 0, len - pos) ; + if (!next) return 0 ; + pos = next - s ; + if (pos++ >= len) return 0 ; + } } return pos == len ; } |