On 7/13/06, Bernd Eidenschink <[EMAIL PROTECTED]> wrote:

Hi Vlad,

> Or you can try to replace ReturnCharData in return.c and see if this
> works (i did not test it):

yes, it seems to work:

  HTTP/1.1 200 OK
  MIME-Version: 1.0
  Accept-Ranges: bytes
  Date: Thu, 13 Jul 2006 06:45:55 GMT
  Server: NaviServer/4.99.2
  Content-Type: text/html; charset=iso8859-15
  Transfer-encoding: chunked
  Connection: close
(Length: not specified [text/html])

I think we should somehow solve this and compute a correct Content-Length,
reconsidering also the note from Stephen concerning open bug nr. 1377059.



Yeah, I don't think chunked encoding is the real answer here...

From your explanations of encodings, it sounds like you've got a real
handle on this!  A lot of nice debugging and testing there too.  If
you turn that into some real tests and put them in tests/ecoding.test,
I'll give you a big kiss!

Re the open bug: I'm pretty sure removing the shortcut for utf-8 will
fix it, but I'm having trouble writing tests to prove it!

Attached are some tests I was working on (ouch!) 4 months ago...  Big
kisses all round for anyone who can figure this out.
diff -r 349db05c6655 tests/encoding.test
--- a/tests/encoding.test	Thu Mar 02 14:48:56 2006 -0700
+++ b/tests/encoding.test	Thu Jul 13 23:02:20 2006 +0100
@@ -31,4 +31,49 @@ test encoding-1.1 {IO buffer transcoding
 
 
 
+ns_log warning ---> encoding-2.1
+test encoding-2.1 {utf-8 validation of input when urldecoding} -setup {
+    ns_register_proc GET /encoding {
+        # Use default, NULL encoding to convert query string, but ensure
+        # we write the result as utf-8.
+        set x [ns_queryget x NULL]
+        ns_conn encoding utf-8
+        ns_return 200 text/plain $x
+    }
+} -body {
+    nstest_http -getbody 1 GET /encoding?x=résumé
+} -cleanup {
+    ns_unregister_proc GET /encoding
+} -result {200 résumé}
+
+ns_log warning ---> encoding-2.2
+test encoding-2.2 {utf-8 validation of input when urldecoding} -setup {
+    ns_register_proc GET /encoding {
+        # Explicitly specify utf-8.
+        ns_conn urlencoding utf-8
+        ns_conn encoding utf-8
+        ns_return 200 text/plain [ns_queryget x NULL]
+    }
+} -body {
+    nstest_http -getbody 1 GET /encoding?x=résumé
+} -cleanup {
+    ns_unregister_proc GET /encoding
+} -result {200 résumé}
+
+ns_log warning ---> encoding-2.3
+test encoding-2.3 {utf-8 validation of input when urldecoding} -setup {
+    ns_register_proc GET /encoding {
+        # Explicitly specify utf-8.
+        ns_conn urlencoding iso8859-1
+        ns_conn encoding utf-8
+        ns_return 200 text/plain [ns_queryget x NULL]
+    }
+} -body {
+    nstest_http -getbody 1 GET /encoding?x=résumé
+} -cleanup {
+    ns_unregister_proc GET /encoding
+} -result {200 résumé}
+
+
+
 cleanupTests
diff -r 349db05c6655 tests/test.nscfg
--- a/tests/test.nscfg	Thu Mar 02 14:48:56 2006 -0700
+++ b/tests/test.nscfg	Thu Jul 13 23:02:20 2006 +0100
@@ -43,8 +43,8 @@ ns_param   maxinput        1000001
 ns_param   maxinput        1000001
 ns_param   bufsize         1024
 ns_param   readahead       1025
-#ns_param   sndbuf          9
-#ns_param   rcvbuf          9
+ns_param   sndbuf          3500
+ns_param   rcvbuf          3500
 ns_param   spoolerthreads  3
 ns_param   uploadsize      1026
 ns_param   writerthreads   3

Reply via email to