1017a1018
> 	$is_chunked = preg_match('/^Transfer-Encoding: chunked$/im', $headers);
1019c1020,1029
< 		$line = fgets($fp, 1024);
---
> 		$line = fgets($fp, 4096);
> 		if (! trim($line)) {
> 			continue;
> 		} elseif ($is_chunked) {
> 			$length = hexdec($line);
> 			if ($length <= 0) {
> 				return false;
> 			}
> 			$line = fread($fp, $length);
> 		}
