Hi Henrik, > Alex, you mentioned on IRC how to handle/read chunked content and of > course I forgot to save the buffer. Would you care to go through it > again please?
This is fairly easy, when you use the functions 'ht:Out' and 'ht:In': (ht:Out T .. do printing ..) does chunked output, and (ht:In T .. do reading ..) the corresponding input. The first argument (here 'T') controls if there is any chunking at all. You could take the code in "lib/http.l", "lib/xhtml" and "lib/form.l" as an example. The global '*Chunked' is set in '_htHead' depending on the value of '*Http1', which in turn is zero or one, depending on the match of the first header line. For example, ((match '("P" "O" "S" "T" " " "/" @U " " "H" "T" "T" "P" "/" "1" "." @H) L) will set '@H' -> '*Http1' accordingly. Then further operation calls (ht:Out *Chunked ...). Besides this, you could also inhibit chunking simply by pretending to be a HTTP/1.0 server. Look in the 'http1' function in "lib/http.l". It outputs the response header depending on that global '*Http1', which could also be set by the program (independent of what the client sent) to zero before starting the response. Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe