You are here: Re: sending http requests with curl but closing before reading the response « PHP Programming Language « IT news, forums, messages
Re: sending http requests with curl but closing before reading the response

Posted by yawnmoth on 07/27/06 09:12

Erwin Moller wrote:
> yawnmoth wrote:
>
> <snip>
>
> Hi yawnmoth,
>
> I think the best approach is to leave CURL and normal tcp/ip interaction
> intact. This means: wait for the response.
> In that way you actually know that system that performs the calculations is
> up and running.
>
> You can however make the heavycalc-script return its response immediately,
> and THEN do the calculations.
>
> Maybe someone has a more ellegant solution out there, but this could work:
> 1) use ob_start() at top of script
> 2) send a header telling the browser/CURL to go away:
> header("Location: bla.html");
> where bla.html is a small useless file. Maybe containing only 'doing calc'
> or something.
> 3) flush it to the browser/CURL: ob_flush();
>
> I expect as far as CULR is concerned, the respons ended, but you first
> script can now continue doing your calculations.
>
> Do not produce any output from here. Not sure where it goes if you do. :-)
>
> Not tested. I think I solved that problem once like this. But it is quickly
> tested by you. Please let us know if it works.
>
> just my 2 cent
That's what register_shutdown_function used to do in PHP 4.0.6 and
earlier under Apache. Unforutnately, last time I tried it, it didn't
work with mod_gzip (I had to disable it for that to work).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация