dlarchikov / php-amqplib Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/php-amqplib
License: GNU Lesser General Public License v2.1
Automatically exported from code.google.com/p/php-amqplib
License: GNU Lesser General Public License v2.1
What steps will reproduce the problem?
1. Enable xdebug profiling.
2. Create an AMQPConnection object.
3. Check the number of times AMQPConnection::__construct calls php::fread
What is the expected output? What do you see instead?
A literal reading of the PHP manual's page on stream_set_timeout suggests that
fread will wait
*up to* the timeout before returning, and only return early if data becomes
available. What
actually happens is that fread($this->sock) in AMQPReader::rawread returns ""
(empty string)
immediately on the majority of calls, immediately and without waiting. This in
turn causes an
excessive number of fread syscalls, driving up system time and CPU load.
What version of the product are you using? On what operating system?
amqplib trunk r24, on PHP 5.2.6 (Linux 2.6.18-128.1.6.el5 #1 SMP Wed Apr 1
09:19:18 EDT
2009 i686 i686 i386 GNU/Linux)
Please provide any additional information below.
Calling fread to read single bytes is also pretty lame. :)
Original issue reported on code.google.com by [email protected]
on 8 Sep 2009 at 8:18
What steps will reproduce the problem?
1. When I run a consumer and process some messages the next fails and goes to
the queue again so it fails again when I start the consumer
server, version: 8.0, properties: capabilities=(), copyright=Copyright (C)
2007-2011 VMware, Inc., information=Licensed under the MPL. See
http://www.rabbitmq.com/, platform=Erlang/OTP, product=RabbitMQ, version=2.5.1
0000 01 00 00 00 00 00 78 00 0A 00 0B 00 00 00 38 07 ......x. ......8.
0010 6C 69 62 72 61 72 79 53 00 00 00 13 50 48 50 20 libraryS ....PHP
0020 53 69 6D 70 6C 65 20 41 4D 51 50 20 6C 69 62 0F Simple A MQP lib.
0030 6C 69 62 72 61 72 79 5F 76 65 72 73 69 6F 6E 53 library_ versionS
0040 00 00 00 03 30 2E 31 08 41 4D 51 50 4C 41 49 4E ....0.1. AMQPLAIN
0050 00 00 00 25 05 4C 4F 47 49 4E 53 00 00 00 06 76 ...%.LOG INS....v
0060 6F 63 61 6C 69 08 50 41 53 53 57 4F 52 44 53 00 ocali.PA SSWORDS.
0070 00 00 06 76 6F 63 61 6C 69 05 65 6E 5F 55 53 CE ...vocal i.en_US▒
< 10,11: Connection.start_ok
waiting for 10,20, 10,30
waiting for a new frame
> 10,30: Connection.tune
< [hex]:
0000 01 00 00 00 00 00 0C 00 0A 00 1F FF FF 00 02 00 ........ ...▒▒...
0010 00 00 00 CE ...▒
< 10,31: Connection.tune_ok
< [hex]:
0000 01 00 00 00 00 00 08 00 0A 00 28 01 2F 00 00 CE ........ ..(./..▒
< 10,40: Connection.open
waiting for 10,41, 10,50
waiting for a new frame
> 10,41: Connection.open_ok
Open OK! known_hosts:
using channel_id: 1
< [hex]:
0000 01 00 01 00 00 00 05 00 14 00 0A 00 CE ........ ....▒
< 20,10: Channel.open
waiting for 20,11
waiting for a new frame
> 20,11: Channel.open_ok
Channel open
< [hex]:
0000 01 00 01 00 00 00 23 00 28 00 0A 00 00 10 70 72 ......#. (.....pr
0010 6F 63 65 73 73 2D 77 61 76 2D 66 69 6C 65 06 64 ocess-wa v-file.d
0020 69 72 65 63 74 02 00 00 00 00 CE irect... ..▒
< 40,10: Channel.exchange_declare
waiting for 40,11
waiting for a new frame
> 40,11: Channel.exchange_declare_ok
< [hex]:
0000 01 00 01 00 00 00 1C 00 32 00 0A 00 00 10 70 72 ........ 2.....pr
0010 6F 63 65 73 73 2D 77 61 76 2D 66 69 6C 65 02 00 ocess-wa v-file..
0020 00 00 00 CE ...▒
< 50,10: Channel.queue_declare
waiting for 50,11
waiting for a new frame
> 50,11: Channel.queue_declare_ok
< [hex]:
0000 01 00 01 00 00 00 2E 00 32 00 14 00 00 10 70 72 ........ 2.....pr
0010 6F 63 65 73 73 2D 77 61 76 2D 66 69 6C 65 10 70 ocess-wa v-file.p
0020 72 6F 63 65 73 73 2D 77 61 76 2D 66 69 6C 65 00 rocess-w av-file.
0030 00 00 00 00 00 CE .....▒
< 50,20: Channel.queue_bind
waiting for 50,21
waiting for a new frame
> 50,21: Channel.queue_bind_ok
< [hex]:
0000 01 00 01 00 00 00 3E 00 3C 00 14 00 00 10 70 72 ......>. <.....pr
0010 6F 63 65 73 73 2D 77 61 76 2D 66 69 6C 65 25 50 ocess-wa v-file%P
0020 48 50 50 52 4F 43 45 53 53 5F 6F 74 69 6C 69 6F HPPROCES S_otilio
0030 2E 6E 65 6F 73 69 73 74 65 63 2E 64 6F 6D 5F 31 .neosist ec.dom_1
0040 38 38 32 39 00 CE 8829.▒
< 60,20: Channel.basic_consume
waiting for 60,21
waiting for a new frame
> 60,21: Channel.basic_consume_ok
waiting for any method
waiting for a new frame
> 60,60: Channel.basic_deliver
waiting for a new frame
waiting for a new frame
New msg: {"id":65}
using channel_id: 2
< [hex]:
0000 01 00 02 00 00 00 05 00 14 00 0A 00 CE ........ ....▒
< 20,10: Channel.open
waiting for 20,11
waiting for a new frame
> 20,11: Channel.open_ok
Channel open
< [hex]:
0000 01 00 02 00 00 00 2B 00 28 00 0A 00 00 18 70 72 ......+. (.....pr
0010 6F 63 65 73 73 2D 74 72 61 6E 73 6C 61 74 69 6F ocess-tr anslatio
0020 6E 2D 74 65 78 74 06 64 69 72 65 63 74 02 00 00 n-text.d irect...
0030 00 00 CE ..▒
< 40,10: Channel.exchange_declare
waiting for 40,11
waiting for a new frame
> 40,11: Channel.exchange_declare_ok
< [hex]:
0000 01 00 02 00 00 00 21 00 3C 00 28 00 00 18 70 72 ......!. <.(...pr
0010 6F 63 65 73 73 2D 74 72 61 6E 73 6C 61 74 69 6F ocess-tr anslatio
0020 6E 2D 74 65 78 74 00 00 CE n-text.. ▒
< 60,40: Channel.basic_publish
< [hex]:
0000 02 00 02 00 00 00 1A 00 3C 00 00 00 00 00 00 00 ........ <.......
0010 00 00 09 90 00 0A 74 65 78 74 2F 70 6C 61 69 6E ...▒..te xt/plain
0020 02 CE .▒
< [hex]:
0000 03 00 02 00 00 00 09 7B 22 69 64 22 3A 36 35 7D .......{ "id":65}
0010 CE ▒
< [hex]:
0000 01 00 01 00 00 00 0D 00 3C 00 50 00 00 00 00 00 ........ <.P.....
0010 00 00 01 00 CE ....▒
< 60,80: Channel.basic_ack
waiting for any method
waiting for a new frame
[Exception]
Expecting AMQP method, received frame type: 3
Original issue reported on code.google.com by [email protected]
on 18 Oct 2011 at 9:37
I was getting floating point answers from bcdiv in this code, debian
unstable, PHP Version 5.2.11-2.
Fixed it for me, to add the scale argument, i.e.:
$x=bcdiv($x,'256', 0);
Original issue reported on code.google.com by [email protected]
on 7 Jan 2010 at 1:17
Global variables are bad because anybody can overwrite them. Use function
instead. It also simplifies the code.
Original issue reported on code.google.com by [email protected]
on 29 Aug 2012 at 1:51
Attachments:
Hi,
There's a bug in the AMQPDecimal::asBCvalue() as per the following:
class AMQPDecimal
{
public function __construct($n, $e)
{
if($e < 0)
throw new Exception("Decimal exponent value must be unsigned!");
$this->n = $n;
$this->e = $e;
}
public function asBCvalue()
{
// Should be return bcdiv($this->n, bcpow(10,$this->e));
return bcdiv($n, bcpow(10,$e));
}
}
Thanks,
--Robin
Original issue reported on code.google.com by [email protected]
on 14 Nov 2010 at 4:28
It should be
} else if($ftype=='F')
not
} else if($ftype='F')
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 23 Apr 2011 at 1:10
PHP Notice: Undefined variable: METHOD_NAME_MAP in .../php-amqplib/amqp.inc on
line 239
Solution: Add the line shown below.
unset($this->method_queue[$qk]);
+ global $METHOD_NAME_MAP;
debug_msg("Executing queued method: $method_sig: " .
$METHOD_NAME_MAP[methodSig($method_sig)]);
Original issue reported on code.google.com by quasikeith
on 1 Nov 2010 at 11:47
What steps will reproduce the problem?
1. Send a durable message using amqp_publisher.php script
2. Receive message using amqp_consumer.php script
3. list queues i operating exchange:
rabbitmqctl list_queues -p /test
(or restart the consumer - the same message will be received again)
What is the expected output? What do you see instead?
Listing queues ...
test_queue 1
done.
instead of:
Listing queues ...
test_queue 0
done.
What version of the product are you using? On what operating system?
latest / linux
Please provide any additional information below.
I'm not sure where it should be fixed.
Messages are not being ACKed correctly because $msg->delivery_tag does not
return a delivery_tag.
The delivery_tag can be fetched from $msg->delivery_info['delivery_tag']
or $msg->delivery_tag should also return a proper delivery_tag
A quick fix solution will be:
--- amqp_consumer.php.orig 2009-08-20 11:08:43.000000000 +0100
+++ amqp_consumer.php 2009-08-20 10:40:38.000000000 +0100
@@ -38,7 +38,7 @@
echo $msg->delivery_info['delivery_tag'];
echo "\n--------\n";
- $ch->basic_ack($msg->delivery_tag);
+ $ch->basic_ack($msg->delivery_info['delivery_tag']);
// Cancel callback
if ($msg->body === 'quit') {
Original issue reported on code.google.com by [email protected]
on 20 Aug 2009 at 10:15
While learning how to use the client and debugging some issues, I started
documenting the functions arguments and also forcing certain type of objects
in the function using phpDoc style documentation.
Its incomplete but I think its a step in the right direction.
Original issue reported on code.google.com by [email protected]
on 14 Sep 2009 at 3:49
Attachments:
What steps will reproduce the problem?
1. Run the demo
2. See "Accessing static property AMQPConnection::$METHOD_MAP as non static"
error and a message about attempting feof on an object not a socket resource
What is the expected output? What do you see instead?
No errors or notices
What version of the product are you using? On what operating system?
PHP 5.3.2 / php-amqplib r28
Please provide any additional information below.
Patch to fix this is as follows. Note, this also permits the HOST to be
specified as an array when calling AMQPConnection, so that failover between
multiple rabbit servers is possible.
=== modified file 'amqp.inc'
--- amqp.inc 2010-11-19 15:37:30 +0000
+++ amqp.inc 2010-11-19 15:42:14 +0000
@@ -295,7 +295,7 @@
"library_version" => array('S', "0.1")
);
- protected static $METHOD_MAP = array(
+ protected $METHOD_MAP = array(
"10,10" => "start",
"10,20" => "secure",
"10,30" => "tune",
@@ -314,8 +314,6 @@
$connection_timeout = 10,
$read_write_timeout = 3)
{
- $this->METHOD_MAP = AMQPConnection::$METHOD_MAP;
-
if($user && $password)
{
$login_response = new AMQPWriter();
@@ -338,10 +336,12 @@
$errstr = $errno = NULL;
$this->sock = NULL;
- if (!($this->sock =
fsockopen($host,$port,$errno,$errstr,$connection_timeout)))
+ if(!is_array($host)) $host = array($host);
+ foreach ($host as $possiblehost)
{
- throw new Exception ("Error Connecting to server($errno):
$errstr ");
- }
+ if ($this->sock =
fsockopen($possiblehost,$port,$errno,$errstr,$connection_timeout)) break;
+ }
+ if (!$this->sock) throw new Exception ("Error unable to connect to
any hosts. Most recently: ($errno): $errstr ");
stream_set_timeout($this->sock,$read_write_timeout);
stream_set_blocking($this->sock, 1);
$this->input = new AMQPReader(null, $this->sock);
@@ -727,7 +727,7 @@
class AMQPChannel extends AbstractChannel
{
- protected static $METHOD_MAP = array(
+ protected $METHOD_MAP = array(
"20,11" => "open_ok",
"20,20" => "flow",
"20,21" => "flow_ok",
@@ -763,8 +763,6 @@
debug_msg("using channel_id: " . $channel_id);
parent::__construct($connection, $channel_id);
-
- $this->METHOD_MAP = AMQPChannel::$METHOD_MAP;
$this->default_ticket = 0;
$this->is_open = false;
=== modified file 'amqp_wire.inc'
--- amqp_wire.inc 2010-11-19 15:37:30 +0000
+++ amqp_wire.inc 2010-11-19 15:42:10 +0000
@@ -299,8 +299,9 @@
$read = 0;
$start = time();
- while($read < $n && !feof($this->sock) &&
- (false !== ($buf = fread($this->sock, $n - $read))))
+
+ while($read < $n && !feof($this->sock->sock) &&
+ (false !== ($buf = fread($this->sock->sock, $n - $read))))
{
if ($buf == '')
{
-bash-3.1$
Original issue reported on code.google.com by [email protected]
on 19 Nov 2010 at 3:46
What steps will reproduce the problem?
1. Run the demo amqp_consumer.php
2. Wait 5 seconds.
3. The program crashes.
What is the expected output? What do you see instead?
I expect the consumer to idle indefinitely and output the data from the
message queue should amqp_publisher send something.
Intead I get the following error after 5 seconds:
PHP Fatal error: Uncaught exception 'Exception' with message 'Error
reading data. Recevived 0 instead of expected 1 bytes' in
/usr/share/php/amqp_wire.inc:316
Stack trace:
#0 /usr/share/php/amqp_wire.inc(347): AMQPReader->rawread(1)
#1 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(493):
AMQPReader->read_octet()
#2 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(513):
AMQPConnection->wait_frame()
#3 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(166):
AMQPConnection->wait_channel(1)
#4 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(250):
AbstractChannel->next_frame()
#5 /share/userdir/daharon/php-amqplib-read-only/demo/amqp_consumer.php(48):
AbstractChannel->wait()
#6 {main}
thrown in /usr/share/php/amqp_wire.inc on line 316
What version of the product are you using? On what operating system?
SVN downloaded on 4-23-2010
Please provide any additional information below.
If I quickly run the amqp_producer, the consumer will successfully get the
messages and output them.
It only fails if the producer hasn't sent anything for 5 seconds.
Original issue reported on code.google.com by [email protected]
on 28 Apr 2010 at 7:08
What steps will reproduce the problem?
1. Send an AMQPMessage to an exchange using basic_publish(), with the
message body consisting of the number 0.
2. Close the channel after publish.
3. The program will crash.
What is the expected output? What do you see instead?
Sending response (0) to verify_email exchange...done.
Closing response channel...done.
Instead, I get the following:
Sending response (0) to verify_email exchange...done.
Closing response channel...PHP Fatal error: Uncaught exception
'AMQPConnectionException' in
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPConnection.php:29
9
Stack trace:
#0 [internal function]: AMQPConnection->_close(Object(AMQPReader))
#1
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPAbstractChannel.p
hp(33):
call_user_func(Array, Object(AMQPReader))
#2
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPAbstractChannel.p
hp(140):
AMQPAbstractChannel->dispatch('10,60', Object(AMQPReader), NULL)
#3
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPConnection.php(23
4):
AMQPAbstractChannel->wait()
#4
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPAbstractChannel.p
hp(42):
AMQPConnection->wait_channel(2)
#5
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPAbstractChannel.p
hp(117):
AMQPAbstractChannel->next_frame()
#6
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPChannel.php(101):
AMQPAbstractChannel->wait(Array)
#7 /share/userdir/daharon/verify_email_test in
/share/userdir/daharon/php-amqplib-framework/framework.php/AMQPConnection.php
on line 299
What version of the product are you using? On what operating system?
0.6.1, Fedora 10, php-5.2.9
Please provide any additional information below.
Some of the line numbers will not match up because I had to pull the lib
apart so that it would work with our php class auto-loader.
Original issue reported on code.google.com by [email protected]
on 6 May 2010 at 4:44
amqp.inc at around ln 390
if(false == ($written = fwrite($this->sock, $data)))
should be
if(false === ($written = fwrite($this->sock, $data)))
If you're sending a large packet, fwrite may sit around (not sending data),
waiting for room to appear in the buffer. In the mean time, fwrite is
returning 0, even though there isn't an error.
(return value should be strictly false if there is an error, not 0)
Original issue reported on code.google.com by [email protected]
on 12 Dec 2009 at 4:01
< [hex]:
0000 41 4D 51 50 01 01 09 01 AMQP....
waiting for 10,10
waiting for a new frame
PHP Warning: feof() expects parameter 1 to be resource, object given in
/home/erlang/gosea-server/php-amqplib/amqp_wire.inc on line 302
PHP Warning: fread() expects parameter 1 to be resource, object given in
/home/erlang/gosea-server/php-amqplib/amqp_wire.inc on line 303
PHP Fatal error: Uncaught exception 'Exception' with message 'Error reading
data. Recevived 0 instead of expected 1 bytes' in
/home/erlang/gosea-server/php-amqplib/amqp_wire.inc:317
Stack trace:
#0 /home/erlang/gosea-server/php-amqplib/amqp_wire.inc(348):
AMQPReader->rawread(1)
#1 /home/erlang/gosea-server/php-amqplib/amqp.inc(494): AMQPReader->read_octet()
#2 /home/erlang/gosea-server/php-amqplib/amqp.inc(514):
AMQPConnection->wait_frame()
#3 /home/erlang/gosea-server/php-amqplib/amqp.inc(166):
AMQPConnection->wait_channel(0)
#4 /home/erlang/gosea-server/php-amqplib/amqp.inc(251):
AbstractChannel->next_frame()
#5 /home/erlang/gosea-server/php-amqplib/amqp.inc(350):
AbstractChannel->wait(Array)
#6 /home/erlang/gosea-server/php-amqplib/demo/amqp_publisher.php(19):
AMQPConnection->__construct('localhost', 5672, 'guest', 'guest')
#7 {main}
thrown in /home/erlang/gosea-server/php-amqplib/amqp_wire.inc on line 317
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Mar 2011 at 9:45
php-amqplib revision 24
php-5.3.0
qpid-0.5.829175
$ php amqp_test.php
Creating connection
PHP Notice: Undefined variable: rw_timeout in /php-amqplib/amqp.inc on
line 344
< [hex]:
0000 41 4D 51 50 01 01 09 01 AMQP....
waiting for 10,10
waiting for a new frame
PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried
to allocate 1342243073 bytes) in /php-amqplib/amqp_wire.inc on line 293
$ php all_tests.php
PHP-AMQP tests (32bit)
OK
Test cases run: 1/1, Passes: 8, Failures: 0, Exceptions: 0
Original issue reported on code.google.com by [email protected]
on 20 Nov 2009 at 2:23
Please add the following method to your amqp.inc source file (line numbers may
be slightly off). Doing this allowed me to support transactions with RabbitMQ.
I based it on the Python implementation of the same method.
@@ -1372,6 +1377,15 @@
$msg = $this->wait();
}
+
+ public function tx_commit()
+ {
+ $this->send_method_frame(array(90, 20));
+ return $this->wait(array(
+ "90,21" //Channel.tx_commit_ok
+ ));
+ }
+
Original issue reported on code.google.com by quasikeith
on 1 Nov 2010 at 11:49
try authenticating with bad credentials, and you'll get a hang until php
times out. This is because amqp does not specify how to handle a failed
authentication, and servers tend to just close the connection. php-amqplib
doesn't consider that possibility. A patch to fix is attached. You don't
get an error that indicates auth failure (well, how can you really?) but at
least you don't have the php process hang until the 30 second timeout is hit.
Original issue reported on code.google.com by [email protected]
on 29 Oct 2009 at 10:56
Attachments:
I wrote some basic demo scripts to help people get an easier start.
Original issue reported on code.google.com by [email protected]
on 28 Feb 2009 at 10:29
Attachments:
1. Close connection manually.
And destruction try to make this second time.
Write function throw exception. And we have PHP fatal.
Simple AMQP client library for AMQP for protocol version 0.8
Original issue reported on code.google.com by [email protected]
on 11 Jul 2012 at 3:27
What steps will reproduce the problem?
1. Open a channel as a consumer
What is the expected output?
No errors
What do you see instead?
an error in the error log when a table of type F is processed by dump table.
The break statement appears to be missing. Execution falls through to the code
for a date (type T) table and trows a warning which can be found in "error_log"
What version of the product are you using?
0.8
On what operating system?
centos
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 15 Aug 2011 at 11:22
I was getting a fatal error when trying to read from a queue. Also,
AbstractChannel->wait() was protected when it should be public.
A patch that fixes this is attached.
Original issue reported on code.google.com by [email protected]
on 28 Feb 2009 at 9:51
Attachments:
What steps will reproduce the problem?
1. start an amqp server
2. start a process which polls the amqp server for messages in a queue
3. shut down the amqp server
What is the expected output? What do you see instead?
I expect to see the "throw new Exception("Error sending data")" get executed,
but in php 5.3.8 (cli) I get a repeating error which quickly fills up my
log/disk with this:
Notice: fwrite(): send of 12 bytes failed with errno=32 Broken pipe in
/var/www/sites/oxygen/library/Lava/Amqp/php-amqplib/amqp.inc on line 481
PHP Notice: fwrite(): send of 12 bytes failed with errno=32 Broken pipe in
/var/www/sites/oxygen/library/Lava/Amqp/php-amqplib/amqp.inc on line 481
Notice: fwrite(): send of 12 bytes failed with errno=32 Broken pipe in
/var/www/sites/oxygen/library/Lava/Amqp/php-amqplib/amqp.inc on line 481
PHP Notice: fwrite(): send of 12 bytes failed with errno=32 Broken pipe in
/var/www/sites/oxygen/library/Lava/Amqp/php-amqplib/amqp.inc on line 481
Notice: fwrite(): send of 12 bytes failed with errno=32 Broken pipe in
/var/www/sites/oxygen/library/Lava/Amqp/php-amqplib/amqp.inc on line 481
PHP Notice: fwrite(): send of 12 bytes failed with errno=32 Broken pipe in
/var/www/sites/oxygen/library/Lava/Amqp/php-amqplib/amqp.inc on line 481
What version of the product are you using? On what operating system?
I'm using centos 5.5, php 5.3.8 (cli) and php-amqplib 0.8
Please provide any additional information below.
Here is a diff that I made so that when fwrite returns 0 bytes written an
exception is thrown and we don't get stuck in the loop.
Index: php-amqplib/amqp.inc
===================================================================
--- php-amqplib/amqp.inc (revision 13432)
+++ php-amqplib/amqp.inc (working copy)
@@ -482,6 +482,10 @@
{
throw new Exception ("Error sending data");
}
+ if($written === 0 ) {
+ throw new Exception("Error sending data");
+ }
$len = $len - $written;
if($len>0)
$data=substr($data,0-$len);
Original issue reported on code.google.com by [email protected]
on 7 Mar 2012 at 11:10
From amqp_wire.inc:AMQPReader -
while ($read < $n && (false !== ($buf = fread($this->sock, $n - $read))))
While this correctly detects errors, premature (unexpected) EOFs cause fread to
return "", not false.
The loop can be corrected:
while ($read < $n && !feof($this->sock) && (false !== ($buf = fread($this->sock, $n -
$read))))
Original issue reported on code.google.com by [email protected]
on 6 Jan 2010 at 6:32
I am running rabbitmq-server_2.2.0-1_all.deb on Ubuntu Server Lucid 64 bit and
get the following error when running amqp_test.php
Creating connection
< [hex]:
0000 41 4D 51 50 01 01 09 01 AMQP....
waiting for 10,10
waiting for a new frame
PHP Warning: feof() expects parameter 1 to be resource, object given in
/usr/src/rabbit/php-amqplib-read-only/amqp_wire.inc on line 302
PHP Warning: fread() expects parameter 1 to be resource, object given in
/usr/src/rabbit/php-amqplib-read-only/amqp_wire.inc on line 303
Caught exception: Error reading data. Recevived 0 instead of expected 1 bytes
Trace:
#0 /usr/src/rabbit/php-amqplib-read-only/amqp_wire.inc(348):
AMQPReader->rawread(1)
#1 /usr/src/rabbit/php-amqplib-read-only/amqp.inc(494): AMQPReader->read_octet()
#2 /usr/src/rabbit/php-amqplib-read-only/amqp.inc(514):
AMQPConnection->wait_frame()
#3 /usr/src/rabbit/php-amqplib-read-only/amqp.inc(166):
AMQPConnection->wait_channel(0)
#4 /usr/src/rabbit/php-amqplib-read-only/amqp.inc(251):
AbstractChannel->next_frame()
#5 /usr/src/rabbit/php-amqplib-read-only/amqp.inc(350):
AbstractChannel->wait(Array)
#6 /usr/src/rabbit/php-amqplib-read-only/amqp_test.php(21):
AMQPConnection->__construct('localhost', 5672, 'guest', '123456')
#7 {main}< [hex]:
0000 01 00 00 00 00 00 0B 00 0A 00 3C 00 00 00 00 00 ........ ..<.....
0010 00 00 CE ..Î
< 10,60: Connection.close
waiting for 10,61
waiting for a new frame
PHP Warning: feof() expects parameter 1 to be resource, object given in
/usr/src/rabbit/php-amqplib-read-only/amqp_wire.inc on line 302
PHP Warning: fread() expects parameter 1 to be resource, object given in
/usr/src/rabbit/php-amqplib-read-only/amqp_wire.inc on line 303
PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0
Original issue reported on code.google.com by [email protected]
on 28 Jan 2011 at 12:12
What steps will reproduce the problem?
1. Publish a message into queue
2.
3.
What is the expected output? What do you see instead?
Expected nothing bad, but an error occurs.
What version of the product are you using? On what operating system?
trunk: Commit:284a578dbd332debc905994e97f45027fd4ab5f0
Please provide any additional information below.
This problem occurs after $this->input->close(); (which is BufferedInput with
same socket) and then fclose($this->sock);
Here is a patch too
Original issue reported on code.google.com by [email protected]
on 30 May 2011 at 7:56
Attachments:
I did a little profiling and optimization of the code, particularly for
writing messages. In my usage I was able to yield approximately a 280%
increase in speed with these changes.
I hope to look into this more, but here are some ideas for further
optimization...
I noticed AMQPConnection->write() appears to be called approximately 3
times for every message that is written. Is this necessary, or could we
reduce this to a 1:1 ratio and write one batch request for each message?
AMQPWriter::chrbytesplit() is still slow. Is it possible to pack() a 64-bit
integer instead of using this function?
Original issue reported on code.google.com by [email protected]
on 3 Mar 2009 at 3:58
Attachments:
What steps will reproduce the problem?
1. test with "php amqp_test.php"
What is the expected output? What do you see instead?
Creating connection
< [hex]:
0000 41 4D 51 50 01 01 09 01 AMQP....
waiting for 10,10
waiting for a new frame
Caught exception: Error reading data. Recevived 1 instead of expected
1342243072 bytes
Trace:
#0 /home/emanus/testing/php-amqplib-read-only/amqp_wire.inc(286):
AMQPReader->rawread('1342243072')
#1 /home/emanus/testing/php-amqplib-read-only/amqp.inc(496):
AMQPReader->read('1342243072')
#2 /home/emanus/testing/php-amqplib-read-only/amqp.inc(513):
AMQPConnection->wait_frame()
#3 /home/emanus/testing/php-amqplib-read-only/amqp.inc(166):
AMQPConnection->wait_channel(0)
#4 /home/emanus/testing/php-amqplib-read-only/amqp.inc(250):
AbstractChannel->next_frame()
#5 /home/emanus/testing/php-amqplib-read-only/amqp.inc(349):
AbstractChannel->wait(Array)
#6 /home/emanus/testing/php-amqplib-read-only/amqp_test.php(21):
AMQPConnection->__construct('localhost', 5672, 'guest', 'guest')
#7 {main}< [hex]:
0000 01 00 00 00 00 00 0B 00 0A 00 3C 00 00 00 00 00 ........ ..<.....
0010 00 00 CE ..�
< 10,60: Connection.close
waiting for 10,61
waiting for a new frame
Fatal error: Exception thrown without a stack frame in Unknown on line 0
What version of the product are you using? On what operating system?
library Revision: 25 - Linux 2.6.26-2-amd64 with PHP 5.2.6-1
Please provide any additional information below.
i have tried 64bit.path and performance.path but without result
Original issue reported on code.google.com by carbeman
on 28 Jan 2010 at 3:12
What steps will reproduce the problem?
1A. Call the get method of AMQPMessage to retrieve a property other than
content_type
What is the expected output? What do you see instead?
The messages properties
What version of the product are you using? On what operating system?
Subversion Revision 20
Please provide any additional information below.
1) php syntax error,
2) missing brackets, code not translated properly from python
Original issue reported on code.google.com by [email protected]
on 30 Apr 2009 at 6:38
Attachments:
How can i set heartbeat to keep connection alive?
i got the tune() method in AMQPConnection class but from nowhere it is called.
Original issue reported on code.google.com by [email protected]
on 27 Mar 2014 at 12:32
What steps will reproduce the problem?
1. run amqp on an installation without bcmath installed.
What is the expected output?
"bc math extention to pho is not installed but is required by php amqp"
What do you see instead?
"bcmod is an undedfined function"
What version of the product are you using? 0.8 On what operating system? centos
Please provide any additional information below.
I recommend moving the test to the top of the -wire file, where it can't be
missed, if the test fails, issue a message and exit. No point in throwing an
exception. Just tell user why and stop.
Original issue reported on code.google.com by [email protected]
on 15 Aug 2011 at 11:28
What steps will reproduce the problem?
1. Use a 32-bit PHP
2. See that it follows the 64-bit codepath
What is the expected output? What do you see instead?
Actual:
$ ../../php/php-5.2.10-32/sapi/cli/php all_tests.php
PHP-AMQP tests (64bit)
OK
Test cases run: 1/1, Passes: 8, Failures: 0, Exceptions: 0
$ ../../php/php-5.2.10-64/sapi/cli/php all_tests.php
PHP-AMQP tests (64bit)
OK
Test cases run: 1/1, Passes: 8, Failures: 0, Exceptions: 0
Expected:
$ ../../php/php-5.2.10-32/sapi/cli/php all_tests.php
PHP-AMQP tests (32bit)
OK
Test cases run: 1/1, Passes: 8, Failures: 0, Exceptions: 0
$ ../../php/php-5.2.10-64/sapi/cli/php all_tests.php
PHP-AMQP tests (64bit)
OK
Test cases run: 1/1, Passes: 8, Failures: 0, Exceptions: 0
What version of the product are you using? On what operating system?
OSX 10.5.8 on Core2Duo, self-compiled PHP 5.2.10 32-bit and 64-bit.
Please provide any additional information below.
There's code in amqp_wire.inc to detect negative return values from
AMQPReader::read_php_int(), so read_php_int() doesn't have to work hard on
its own. As you can see from the testing below, casting the string
"3735928559" to an int on 32-bit results in 2**31-1 (clamped), which is not
correct or detectable. The attached patch removes useless arch checking,
removes unhelpful sprintf()ing, and corrects the check in the test runner
(it's good to know what you're testing!). The best answer to see if you're
on 32-bit or 64-bit seems to be to check PHP_INT_SIZE. :)
$ uname -mrsv
Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009;
root:xnu-1228.15.4~1/RELEASE_I386 i386
$ cat numtests.php
<?
var_dump("Casting 4294967296 to int", (int)4294967296);
var_dump("PHP_INT_SIZE", PHP_INT_SIZE);
list(,$a) = unpack("N", "\xDE\xAD\xBE\xEF");
$b = sprintf("%u",$a);
$c = (int)$b;
var_dump("Using unpack()", $a, $b, $c);
$ for x in *-32 *-64; do file $x/sapi/cli/php; $x/sapi/cli/php
numtests.php; done
php-5.2.10-32/sapi/cli/php: Mach-O executable i386
string(25) "Casting 4294967296 to int"
int(-1)
string(12) "PHP_INT_SIZE"
int(4)
string(14) "Using unpack()"
int(-559038737)
string(10) "3735928559"
int(2147483647)
php-5.2.10-64/sapi/cli/php: Mach-O 64-bit executable x86_64
string(25) "Casting 4294967296 to int"
int(4294967296)
string(12) "PHP_INT_SIZE"
int(8)
string(14) "Using unpack()"
int(3735928559)
string(10) "3735928559"
int(3735928559)
Original issue reported on code.google.com by taavi.burns
on 8 Sep 2009 at 9:21
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.