# HG changeset patch # User Henry S. Thompson # Date 1782140402 -3600 # Node ID faad1c51c2893969137d5ef800375ecf41390926 # Parent b9b301fd064d0d2bfba297f2469dd2e22a103b19 part 4 == body for RESP working diff -r b9b301fd064d -r faad1c51c289 lib/python/cc/iwarc.py --- a/lib/python/cc/iwarc.py Mon Jun 22 15:58:51 2026 +0100 +++ b/lib/python/cc/iwarc.py Mon Jun 22 16:00:02 2026 +0100 @@ -117,17 +117,17 @@ eob = bp + length while buf.startswith(b'\r\n', eob - 2): eob -= 2 - # Only output parts (2 = HTTP header, 4 = body) that are wanted - if parts & 2: - if wtype == RESP or wtype == REQ : - # request and response have http headers - eo2 = buf.index(b'\r\n\r\n', start_2) + # Only output parts (2 = CC-info|HTTP header, 4 = HTTP body) if wanted + if wtype == RESP : + # response has body as well as out/in http headers + eo2 = buf.index(b'\r\n\r\n', start_2) + if parts & 2: _out = callback(wtype, bufView[start_2:eo2 + 2], 2) - else: - # rest of the part - _out = callback(wtype, bufView[start_2:eob], 2) - if (wtype == RESP) and parts & 4: - _out = callback(wtype, bufView[eo2 + 4:eob], 4) + if parts & 4: + _out = callback(wtype, bufView[eo2 + 4:eob], 4) + elif parts & 2: + # anything else gets the whole rest of the part + _out = callback(wtype, bufView[start_2:eob], 2) #raise ValueError("Not implemented: body part (4): %s"%parts) #bp += length #if buf[bp] != 13: