Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 15113 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]
Latest diff for improved robustness
diff.txt (text/plain), 1.93 KB, created by
Stuart Herbert (RETIRED)
on 2003-07-28 01:21:09 UTC
(
hide
)
Description:
Latest diff for improved robustness
Filename:
MIME Type:
Creator:
Stuart Herbert (RETIRED)
Created:
2003-07-28 01:21:09 UTC
Size:
1.93 KB
patch
obsolete
>--- MemCachedClient.inc.php1 2003-07-27 22:18:14.000000000 +0100 >+++ MemCachedClient.inc.php 2003-07-28 09:15:36.000000000 +0100 >@@ -76,7 +76,7 @@ > > $sock = $this->get_sock($key); > >- if(!$sock) >+ if(! is_resource($sock)) > return 0; > > if(is_array($key)) >@@ -134,6 +134,8 @@ > // like get() but takes an array of keys > function get_multi($keys) > { >+ $socks = array(); >+ > if(!$this->active) > return null; > >@@ -147,7 +149,7 @@ > { > $sock = $this->get_sock($k); > >- if($sock) >+ if(is_resource($sock)) > { > $k = is_array($k) ? $k[1] : $k; > >@@ -267,7 +269,7 @@ > $host = $this->buckets[$hv % $this->bucketcount]; > $sock = $this->sock_to_host($host); > >- if($sock) >+ if(is_resource($sock)) > return $sock; > > $hv += $this->_hashfunc($tries); >@@ -284,7 +286,7 @@ > return 0; > > $sock = $this->get_sock($key); >- if(!$sock) >+ if(!is_resource($sock)) > return 0; > > $flags = 0; >@@ -298,9 +300,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 +313,9 @@ > $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, 30, PHP_NORMAL_READ); >+# echo $l_szResponse . "<br>\n"; >+ if($l_szResponse == "STORED") > { > if($this->debug) > print "MemCache: $cmdname $key = $raw_val\n"; >@@ -318,7 +325,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; >@@ -344,6 +351,7 @@ > > $cmd .="\r\n"; > $cmd_len = strlen($cmd); >+ > $offset = 0; > > while($offset < $cmd_len)
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