Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 15101 Details for
Bug 25385
memcached's php client can run in an infinite loop
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch with fix for _set() robustness problem
diff.txt (text/plain), 1.25 KB, created by
Stuart Herbert (RETIRED)
on 2003-07-27 14:18:11 UTC
(
hide
)
Description:
Patch with fix for _set() robustness problem
Filename:
MIME Type:
Creator:
Stuart Herbert (RETIRED)
Created:
2003-07-27 14:18:11 UTC
Size:
1.25 KB
patch
obsolete
>--- MemCachedClient.inc.php 2003-07-27 22:12:15.000000000 +0100 >+++ MemCachedClient.inc.php3 2003-07-27 22:08:31.000000000 +0100 >@@ -267,10 +267,11 @@ > $host = $this->buckets[$hv % $this->bucketcount]; > $sock = $this->sock_to_host($host); > >- if($sock) >+ if(is_resource($sock)) > return $sock; > > $hv += $this->_hashfunc($tries); >+ $tries++; > } > > return null; >@@ -298,9 +299,12 @@ > } > > $len = strlen($val); >+ if (!is_int($exptime)) >+ $exptime = 0; > > // send off the request > $cmd = "$cmdname $key $flags $exptime $len\r\n$val\r\n"; >+# echo "<br>Command is: $cmd<br>\n"; > $cmd_len = strlen($cmd); > $offset = 0; > >@@ -308,7 +312,8 @@ > $offset += socket_write($sock, substr($cmd, $offset, MC_BUFFER_SZ), MC_BUFFER_SZ); > > // now read the server's response >- if(socket_read($sock, 6, PHP_NORMAL_READ) == "STORED") >+ $l_szResponse = socket_read($sock, 6, PHP_NORMAL_READ); >+ if($l_szResponse == "STORED") > { > if($this->debug) > print "MemCache: $cmdname $key = $raw_val\n"; >@@ -318,7 +323,7 @@ > else > { > if($this->debug) >- print "_set(): Did not receive STORED as the server response!\r\n"; >+ print "_set(): Did not receive STORED as the server response!\r\n; received $l_szResponse instead"; > } > > return 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25385
:
15096
|
15101
|
15113
|
101892
|
101893