PHP Classes

Recursive ReadReplyHeaders ()

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  Recursive ReadReplyHeaders ()  >  (Un) Subscribe thread alerts  
Subject:Recursive ReadReplyHeaders ()
Summary:ReadReplyHeaders () is hanging
Messages:5
Author:Marc Fairbanks
Date:2006-12-14 00:42:01
Update:2006-12-23 20:21:56
 

  1. Recursive ReadReplyHeaders ()   Reply   Report abuse  
Picture of Marc Fairbanks Marc Fairbanks - 2006-12-14 00:42:01
Hello. I am using the HTTP class with the AIM integration class. Seems to be working okay up until it gets into ReadReplyHeaders (). At that point, the response_status is 100 and it calls back to itself, and ends up dieing in a recursive loop. Are there any known problems with this method? Why is it calling back to itself forever?

Thanks for any info.

[email protected]

  2. Re: Recursive ReadReplyHeaders ()   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-12-14 01:19:28 - In reply to message 1 from Marc Fairbanks
Status code 100 means that the server is elaborating a response but it is not yet ready. So you need to wait for more headers until it returns another status code besides 100.

Calling the function recursively is the easy solution. Thinking about it, if your server returns a long series of 100 status code response, it may crash the PHP script.

I think I can rewrite the function a bit to avoid recursion. I just would like to be able to test this in a real server that returns a long series of 100 codes. Can you provide a short script that accesses a server like that?

  3. Re: Recursive ReadReplyHeaders ()   Reply   Report abuse  
Picture of Kewl Fire Kewl Fire - 2006-12-16 21:19:06 - In reply to message 2 from Manuel Lemos
I tried 'login' into youtube.com using the HTTP client but it keeps going to the signup page.
If I use the same URL (GET) on the browser it works fine.
Am I missing something?

  4. Re: Recursive ReadReplyHeaders ()   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-12-19 20:47:28 - In reply to message 3 from Kewl Fire
Kewl, are you talking of the same problem?

If not, please start a new thread in the package discussion forum and post a sample of the code you are using so I can reproduce your problem.

  5. Re: Recursive ReadReplyHeaders ()   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-12-23 20:21:56 - In reply to message 1 from Marc Fairbanks
I have fixed the class to avoid recursion. I have just uploaded the new version.

It seems to be working correctly, despite I was not able to test it in a site that returns that kind of response, nor I have an authorize.net merchant account to try.

Just try the new version yourself and let me know if it works for you now.