On 04.05.2010, at 18:58, Stephen Deasey wrote:
>
> What is being buffered that you're trying to flush?
The headers! It is just a kind-of 304-type of response or
a response containing just the headers, no data.
In the "previous life" I used SetRequiredHeaders
and then FlushHeaders. Now I need to set each thing
per line and then call Ns_ConnWrite with NULL buffer:
was:
Ns_ConnSetRequiredHeaders(conn, mime, size);
result = Ns_ConnFlushHeaders(conn, 200);
is:
Ns_ConnSetTypeHeader(conn, mime);
Ns_ConnSetLengthHeader(conn, size);
Ns_ConnSetResponseStatus(conn, 200);
if (Ns_ConnWriteData(conn, NULL, 0, 0) != NS_OK) {
result = 0;
} else {
result = size;
}
So the 2 liner becomes 8 liner. It is not that I really
care about that, but what I find obscure is the ConnWriteData.
Something like this would be more "readable"
Ns_ConnSetTypeHeader(conn, mime);
Ns_ConnSetLengthHeader(conn, size);
Ns_ConnSetResponseStatus(conn, 200);
result = Ns_ConnFlush(conn);
So the hypothetical Ns_ConnFlush would write all that it can
and return the number of bytes written. Or something like that.
Is there some other means of achieving the above that I am not
aware of?
Cheers
Zoran
------------------------------------------------------------------------------
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel