From 037f3ac849914e4e698e47114481a8e6c99d3cfa Mon Sep 17 00:00:00 2001 From: ketmar Date: Tue, 20 Nov 2012 04:25:37 +0000 Subject: [PATCH] HTTP reply headers parser relaxed a little FossilOrigin-Name: 3aafc5fd775acaf0b821f5a178bd8bc12f12979e479912681e12132341386e05 --- src/sylib/syren_hdrs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sylib/syren_hdrs.c b/src/sylib/syren_hdrs.c index 1e52354..a9f1c45 100644 --- a/src/sylib/syren_hdrs.c +++ b/src/sylib/syren_hdrs.c @@ -216,11 +216,16 @@ TSyResult SyHdrAddLine (TSyHdrs *hdr, const char *line) { if (hdr->type == SY_HDR_REPLY) { /* parse reply code; bad code is error! */ /* hack for brain-damaged 'bandit' server */ +#if 0 while (*s) { s = strstr(s, "HTTP/"); if (!s) break; s += 5; if (isdigit(*s) && s[1] == '.' && isdigit(s[2])) { s += 3; break; } } +#else + /* i don't care about first word now, just skip it and be happy */ + while (*s && (unsigned char)(*s) > ' ') ++s; +#endif if (!s) return SY_ERROR; while (*s && (unsigned char)(*s) > ' ') s++; while (*s && (unsigned char)(*s) <= ' ') s++; -- 2.11.4.GIT