I think the only solution here will be to use Chunked-Encoding to output encoded content, in this case Content-Length should be removed fromthe headers.

Ns_ConnWriteVChars handles that, so it shoudl be chnaged i guess.

Bernd Eidenschink wrote:
Am Mittwoch, 12. Juli 2006 15:23 schrieb Bernd Eidenschink:
it looks like the mechanism of changing the encoding works as expected, but
the computation of the correct contentlength not.

ok. I think this is going on:

1. NsTclReturnObjCmd
If ns_return is called _without_ -binary switch, Ns_ConnReturnCharData is called. The length is computed from the UTF-8 representation.

2. Ns_ConnReturnCharData
calls

3. ReturnCharData
Knows what output encoding to use. If not UTF-8, it will call
Ns_WriteCharConn

...BUT BEFORE...

4.
Ns_ConnSetRequiredHeaders
calls Ns_ConnSetLengthHeader
(Set the Content-Length output header)

for

5.
Ns_ConnQueueHeaders
calls NS_ConnConstructHeaders
where
"Update the response length value directly from the header to be sent, i.e., don't trust programmers"

So the content-length is set.

NOW:

7. Ns_WriteCharConn is called, calls
Ns_ConnWriteChars
that with the help of Ns_ConnWriteVChars encodes
with the help of "Tcl_UtfToExternal" to the final encoding.

I can be fundamentally wrong, but it seems to me like the whatever-it-will-become final encoding length should be computed earlier...

What do you think?

Bernd.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel



--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/

Reply via email to