Fixed issue that lead HttpSocket to choke on big files (> 100kb)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5942 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
the_undefined 2007-11-04 02:29:42 +00:00
parent 7e57a4d28b
commit 73d873acaa

View file

@ -322,9 +322,10 @@ class HttpSocket extends CakeSocket {
}
$response = $responseTemplate;
if (preg_match("/(.+\r\n)(.*)(?<=\r\n)\r\n(.+)\$/DUs", $message, $match)) {
list($response['raw']['response'], $response['raw']['status-line'], $response['raw']['header'], $response['raw']['body']) = $match;
if (preg_match("/^(.+\r\n)(.*)(?<=\r\n)\r\n/Us", $message, $match)) {
list(, $response['raw']['status-line'], $response['raw']['header']) = $match;
$response['raw']['response'] = $message;
$response['raw']['body'] = substr($message, strlen($match[0]));
if (preg_match("/(.+) ([0-9]{3}) (.+)\r\n/DU", $response['raw']['status-line'], $match)) {
$response['status']['http-version'] = $match[1];