Thank you very much for answering.

The examples with wget are done on the same url. Nothing is missing.
It's just that sometimes content-length is set and sometimes is not
and when that happens i noticed that phone can't fetch xml. Xml is
always the same in this case. And in the log of apache.log this looks
this(the same content):

192.168.1.247 - - [02/Feb/2010:18:26:47 +0100] "GET /pb.xml?peer=298
HTTP/1.0" 200 535 "-" "Wget/1.11.4"
192.168.1.247 - - [02/Feb/2010:18:26:48 +0100] "GET /pb.xml?peer=298
HTTP/1.0" 200 535 "-" "Wget/1.11.4"
192.168.1.247 - - [02/Feb/2010:18:26:48 +0100] "GET /pb.xml?peer=298
HTTP/1.0" 200 514 "-" "Wget/1.11.4"

I will try with middleware, if I can, then report back.


On Feb 2, 3:50 pm, Brett Parker <idu...@sommitrealweird.co.uk> wrote:
> On 02 Feb 06:30, urosh wrote:
>
>
>
> > Hello.
>
> > I have a problem with content-length heater in HTTP-message. I am
> > writing application for voip phone, which is not always specified,
> > then the phone can't download xml file correctly (stupid, I gess).
>
> > How can I correct this behaviour?
> > I tested this with wget tool. Here are results.
>
> > Connecting to 192.168.1.248:80... connected.
> > [12] 18882
> > HTTP request sent, awaiting response... [9]   Done
> > wgethttp://192.168.1.248/pb.xml?peer=298
> > [10]   Done                    p=1
> > u...@user-laptop:/tmp$ 200 OK
> > Length: 360 [text/xml]
> > Saving to: `pb.xml?peer=298.32'
>
> > 100%
> > [===================================================================================================>]
> > 360         --.-K/s   in 0s
>
> > 2010-02-02 15:28:56 (20.6 MB/s) - `pb.xml?peer=298.32' saved [360/36
>
> > HTTP request sent, awaiting response... [50] 18962
> > [47]   Done                    wgethttp://192.168.1.248/pb.xml?peer=298
> > [48]   Done                    p=1
> > u...@user-laptop:/tmp$ 200 OK
> > Length: unspecified [text/xml]
> > Saving to: `pb.xml?peer=298.51'
>
> > [ <=>                                                                       
> >                          ]
> > 360         --.-K/s   in 0s
>
> > 2010-02-02 15:29:35 (25.6 MB/s) - `pb.xml?peer=298.51' saved [360]
>
> Erm, looks like you're missing a bit to the wget, is there (perchance)
> an &p=1... because that's what it looks like it should have so try:
>     wget "http://192.168.1.248/pb.xml?peer=298&p=1";
>
> Note the "s... otherwise you end up running a wget and "p=1", which
> probably isn't what you wanted it to do.
>
> Are you saying that the phone can't read unless Content-length is set?
> You might be able to do that with some middleware, infact, it appears
> that you can just use the ConditionalGetMiddleware to add the
> Content-length header.
>
> http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.mi...
>
> Hope that helps,
> --
> Brett Parker

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to