|
From: <php...@li...> - 2010-02-08 16:25:29
|
On Mon, 2010-02-08 at 00:34 +0700, php...@li... wrote: > I found an approach that worked...mostly. Yes, "mostly", indeed. The code you have posted doesn't work on any operating system or HTTP server. > But it caused PHP to crash It certainly doesn't cause a crash. It causes PHP to hang for the reasons outlined in the previous post. > under JavaBridge and Tomcat. An experienced Java programmer saw the logs > and said it was due to a class error. Please re-read the error log. The hanging PHP instance has been killed during the tomcat shutdown sequence... Anyway, I don't think we need to discuss this issue any further, Peter has already posted code which works (except that I would read the terminating \r\n, too, but that's a matter of style). Just nuke your code and use his code instead. Please re-read the HTTP/1.1 spec for details why your code is completely wrong and causes PHP to hang sometimes. Regards, Jost Bökemeier |