cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Dealing with Server Push

From: Juergen Schreck <lists_at_innernine.com>
Date: Mon, 10 Mar 2003 14:14:18 -0600

Hi,

I've come across a problem with curl/php I can't solve by myself. I hope
it's possible to solve with libcurl or curl:

I've written a PHP app that serves as a proxy to another web-driven system.
All of the remote communication is handled via CURL. For file-downloads I
have to call a cgi which return data using this content type:

Content-Type: multipart/x-mixed-replace; boundary="something"

The use this to report progress. The remote system 'packages' multiple files
into a single archives. The last part of the multipart content is the actual
archive.

With smaller archives there is no problem because the remote system creates
it so fast that the file comes down in the first call to the cgi. But with
bigger archives, libcurl just waits for everything to come in which causes
browser timeouts on the frontend.

So what are my options?

Can I start streaming results back to the browser more immediately rather
than caching them first into a string or file on my system? How do I do
that, including streaming out the headers?

I thought I could build my own queueing system and rather than using
libcurl, exec curl in the background. I haven't gotten very far with that,
because as opposed to libcurl I can't make CURL honor the multipart message
Meaning that CURL will grab the first part of the message and then stop
again.

So - I'm kinda stuck. Have any of you dealt with this or a similar problem?
What's the best way to solve this puzzle?

Thanks,
Juergen

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-03-10