On Sun, 22 Oct 2000, Bolot Kerimbaev wrote:

> Somehow, I  need to implement a pretty "smart" way of dealing with
> partial returns:  just plain stupid write-till-done method and the
> more robust HTTP/1.1 chunked  (i.e., you send out several portions
> of the response, each with chunk-size - so at the end you know you
> got the whole thing for sure, not some network problem).

Why this? You do not need to give a contents-size upfront. You just
send the the header, then any data as soon as you can, then close the
connection. The browser is well able to tell if the connection was closed
intentionally or by error. This is what almost every cgi script does.

I have an el-cheapo method of this working in my Swikis. Basically, in the
address-block it just writes directly on the request's outStream and tells
it when it's done (stopResponse). Any subsequent writes (produced by
Je77's swiki logic) is ignored. Try an example at
        http://swiki.gsug.org:8888/gsug/search?search=1+2+3+4+5+6+7+8+9
I think I sent the code around some time ago?

But that code is hackish and I'd rather use a standard feature, so I do
not have to hack it again for every version ...

> And yes, Je77 will need to use detente to make me implement this.

Bah, that's a snap for a comanche chieftain :)

-- Bert



Reply via email to