|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-24 13:13 UTC] arekm at pld-linux dot org
Description:
------------
Very long running SOAP query in one tab in web browser halts the same session on the server so nothing can be done in the same app (using the same session) in second tab of the browser.
Reproduce code:
---------------
<?php
session_start();
$cmd = $_GET["cmd"];
if (isset($_SESSION["cnt"]))
$_SESSION["cnt"]++;
else
$_SESSION["cnt"] = 0;
switch ($cmd) {
case "soap":
$client = new SoapClient(NULL, array('location' => "http://www.nask.pl:1000" /* unreachable host */,
'uri' => "blah",
'encoding'=>'ISO-8859-2',
'trace' => true,
'exceptions' => false));
$response = $client->__soapCall("blah", array());
if (is_soap_fault($response))
echo "SOAP fault<br>";
break;
case "disp":
echo "DISPLAY ME " . $_SESSION["cnt"] . "<br>";
break;
}
?>
<a href="a.php?cmd=soap">soap</a>
<a href="a.php?cmd=disp">disp</a>
Expected result:
----------------
DISPLAY ME X where X increases without waiting for SOAP query to finish.
Actual result:
--------------
Browser waits for server reply and gets it only after soap query finishes.
How to reproduce?
1) open http://somwhere/a.php?cmd=disp in two tabs of the same browser (so php session will be shared)
... where a.php is php script above
2) click disp several times, counter should increase
3) in second tab try click on soap (which will issue soap query to unreachable server/port so it will take long time)
4) back in first tab try to click on disp
now at 4) browser will wait for server to reply until soap query finishes
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
Found the solution: session_write_close(); $response = $client->__soapCall("blah", array()); session_start();