note 48525 added to ref.memcache

From: Date: Tue, 28 Dec 2004 10:52:16 +0000
Subject: note 48525 added to ref.memcache
Groups: php.notes 
Request: Send a blank email to php-notes+get-82398@lists.php.net to get a copy of this message
Error in MemCachedClient.inc.php Release 1.0.10 The script fall down in case of data end sign ( /r/nEND/r/n ) be at edge of 2 block. But the following condition must be meeted: last /n is only symbol of last block ($line="\n"). In this case next expression donn`t allow perform end sign checking: // skip over the extra return or newline if($line == "\r" || $line == "\n") continue; $bytes_read += strlen($line); $buf .= $line; // we read the all of the data, take in account // for the /r/nEND/r/n if($bytes_read == ($len + 7)) { $end = substr($buf, $len+2, 3); ................................................... Example of code, that result fall down: require_once('system/MemCachedClient.inc.php'); $options["servers"] = array("127.0.0.1:11212"); $options["debug"] = false; $options["compress"] = 0; $memc = new MemCachedClient($options); $str = str_repeat('1', 994); $memc->set('key', $str); echo $memc->get('key'); // here script fall ---- Manual Page -- http://www.php.net/manual/en/ref.memcache.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48525 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48525&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48525&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48525&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48525&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48525&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48525&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48525&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82398) next »