|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Description: ------------ Client hangs while server gets an exception. It does not hand indefinitely though - think its 30s. The issue is related to the code not generating a dbus error messsage response on error, but rather just aborting on server side by throwing an error when the function call fails. Tracing the issue: PHP_METHOD(Dbus, waitLoop) ... php_dbus_accept_incoming_method_call(dbus, msg, &return_value TSRMLS_CC); ... php_dbus_do_method_call(dbus, msg, class, member TSRMLS_CC); ... call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) { Need to change error handling around call_user_function_ex() and respond with an error message. I tried but failed. Test script: --------------- Server: <?php $d = new Dbus(Dbus::BUS_SESSION, true); $d->requestName('nl.derickrethans.test'); $d->registerObject('/nl/derickrethans/test', 'nl.derickrethans.test', 'testClass'); class testClass { static function echoOne($a) { return $a; } } while (true) { try { $s = $d->waitLoop(1000); echo "Woke up.\n"; } catch(Exception $e) { echo "Exception:" . get_class($e) . " " . $e->getMessage() . "\n"; } } ?> Client: <?php $dbus = new Dbus( Dbus::BUS_SESSION, true ); $o = $dbus->createProxy('nl.derickrethans.test', '/nl/derickrethans/test', 'nl.derickrethans.test'); var_dump($o); while(1) { print "Loop Start\n"; //Hangs try { echo "Calling echoOne() not enough args\n"; $retval = $o->echoOne(); echo "Got reply: $retval\n"; } catch(Exception $e) { echo "Exception:" . get_class($e) . " " . $e->getMessage() . "\n"; } sleep(1); } ?> Expected result: ---------------- Client throws an exception straight away. Actual result: -------------- Client hangs for ~30 seconds then throws a "NoReply" exception.