Help: unwanted extra characters in output
am 22.09.2010 06:44:39 von Nico Coetzee
Hi - I have a problem which I can't seem to solve.
I am busy implementing a webdav solution in mod_perl and as you may
know, the output is XML based.
The problem is that the output generated by mod_perl contains
additional characters before and after the XML which the webdav
clients don't seem to like.
If I convert this script to a CGI, it works 100% and the extra
characters is not present.
Any ideas?
Here is the example trace (check the "20d" and "0" before and after the XML):
PROPFIND /webdav/ HTTP/1.1
Host: test:81
User-Agent: cadaver/0.22.3 neon/0.25.5
Connection: TE
TE: trailers
Depth: 0
Content-Length: 297
Content-Type: application/xml
Authorization: Basic dGVzdHVzZXIxOnBhc3N3b3Jk
HTTP/1.1 200 OK
Date: Wed, 22 Sep 2010 04:25:57 GMT
Server: Apache/2.2.3 (CentOS)
Cache-Control: max-age=0
Expires: Wed, 22 Sep 2010 04:25:57 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/xtml; charset="utf-8"
20d
xmlns:lp2="http://apache.org/dav/props/">
2010-09-14T05:09:29Z
F
4096
HTTP/1.1 200 OK
0
Re: Help: unwanted extra characters in output
am 22.09.2010 09:14:18 von Hendrik Schumacher
Hi,
your problem has nothing to do with the mod_perl output. The 20d and 0 are
length descriptors for chunked encoding, check out the response header:
Transfer-Encoding: chunked
This SHOULD be supported by a HTTP 1.1 client. In fact, I would be
surprised if cadaver/neon couldnt handle this.
Whats the exact error message / unexpected behaviour you get?
Hendrik
Am Mi, 22.09.2010, 06:44, schrieb Nico Coetzee:
> Hi - I have a problem which I can't seem to solve.
>
> I am busy implementing a webdav solution in mod_perl and as you may
> know, the output is XML based.
>
> The problem is that the output generated by mod_perl contains
> additional characters before and after the XML which the webdav
> clients don't seem to like.
>
> If I convert this script to a CGI, it works 100% and the extra
> characters is not present.
>
> Any ideas?
>
> Here is the example trace (check the "20d" and "0" before and after the
> XML):
>
> PROPFIND /webdav/ HTTP/1.1
> Host: test:81
> User-Agent: cadaver/0.22.3 neon/0.25.5
> Connection: TE
> TE: trailers
> Depth: 0
> Content-Length: 297
> Content-Type: application/xml
> Authorization: Basic dGVzdHVzZXIxOnBhc3N3b3Jk
>
>
>
>
>
>
>
>
>
>
>
> HTTP/1.1 200 OK
> Date: Wed, 22 Sep 2010 04:25:57 GMT
> Server: Apache/2.2.3 (CentOS)
> Cache-Control: max-age=0
> Expires: Wed, 22 Sep 2010 04:25:57 GMT
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/xtml; charset="utf-8"
>
> 20d
>
>
> xmlns:lp2="http://apache.org/dav/props/">
>
>
> 2010-09-14T05:09:29Z
> F
> 4096
>
>
>
>
> HTTP/1.1 200 OK
>
>
>
> 0
>
Re: Help: unwanted extra characters in output
am 22.09.2010 09:30:16 von Hendrik Schumacher
Btw, if you simply want to disable chunked encoding, buffer your output in
your mod_perl handler, set the Content-Length response header once your
output is complete and only after that print your output.
Apache only activates chunked encoding if no Content-Length header is
present when output is sent.
Hendrik
Am Mi, 22.09.2010, 06:44, schrieb Nico Coetzee:
> Hi - I have a problem which I can't seem to solve.
>
> I am busy implementing a webdav solution in mod_perl and as you may
> know, the output is XML based.
>
> The problem is that the output generated by mod_perl contains
> additional characters before and after the XML which the webdav
> clients don't seem to like.
>
> If I convert this script to a CGI, it works 100% and the extra
> characters is not present.
>
> Any ideas?
>
> Here is the example trace (check the "20d" and "0" before and after the
> XML):
>
> PROPFIND /webdav/ HTTP/1.1
> Host: test:81
> User-Agent: cadaver/0.22.3 neon/0.25.5
> Connection: TE
> TE: trailers
> Depth: 0
> Content-Length: 297
> Content-Type: application/xml
> Authorization: Basic dGVzdHVzZXIxOnBhc3N3b3Jk
>
>
>
>
>
>
>
>
>
>
>
> HTTP/1.1 200 OK
> Date: Wed, 22 Sep 2010 04:25:57 GMT
> Server: Apache/2.2.3 (CentOS)
> Cache-Control: max-age=0
> Expires: Wed, 22 Sep 2010 04:25:57 GMT
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/xtml; charset="utf-8"
>
> 20d
>
>
> xmlns:lp2="http://apache.org/dav/props/">
>
>
> 2010-09-14T05:09:29Z
> F
> 4096
>
>
>
>
> HTTP/1.1 200 OK
>
>
>
> 0
>