summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_response_header_preparebuiltin.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-10-27 14:33:26 +0000
committerLaurent Bercot <ska@appnovation.com>2023-10-27 14:33:26 +0000
commitffd8df879dea5b306b1a1615c2eabe0d463a3a3b (patch)
tree278ef36a856c2ddc756a1474d69906be7dfbf316 /src/libtipidee/tipidee_response_header_preparebuiltin.c
parentd05b3963381a4cd0329bced938d79a23bb392658 (diff)
downloadtipidee-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.c14
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 ;
}