From: Jonathan Dieter Date: Sat, 1 May 2021 16:56:16 +0000 (+0100) Subject: Handle certain rare web servers that don't start with \r\n X-Git-Tag: archive/raspbian/1.2.1+ds1-1+rpi1^2~7^2~7^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=276acf58954705cdd260494a17249c2686d60425;p=zchunk.git Handle certain rare web servers that don't start with \r\n After testing the server in https://github.com/zchunk/zchunk/issues/40, I found that it doesn't start with "\r\n", so let's make that part optional Signed-off-by: Jonathan Dieter --- diff --git a/src/lib/dl/multipart.c b/src/lib/dl/multipart.c index 683213a..f8c11df 100644 --- a/src/lib/dl/multipart.c +++ b/src/lib/dl/multipart.c @@ -74,7 +74,7 @@ static bool gen_regex(zckDL *dl) { /* Response should include content-type, but we only need the range, so * wildcard out the content-type */ - char *next = "\r\n--%s\r\n.*" \ + char *next = "\r?\n?--%s\r\n.*" \ "content-range: *bytes *([0-9]+) *- *([0-9]+) */[0-9]+"; char *end = "\r\n--%s--"; char *regex_n = add_boundary_to_regex(dl->zck, next, dl->boundary);