downloadaszip

Questions related to developing on the Tonido Platform
spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 12:11 pm

Something is clearly amiss - likely my understanding...

initial request response:

Code: Select all

httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 116
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:25:37 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>startzip</type>
    <result>1</result>
    <message>135424023379842620</message>
  </command>
</commands>


later, zipstatus response:

Code: Select all

httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 328
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:27:26 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>zipstatus</type>
    <result>1</result>
    <message>blah, blah, blah</message>
  </command>
</commands>


elapsed: 01:49

then, after extracting the downloaded zip, repeat:

Code: Select all

httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 116
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:36:28 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>startzip</type>
    <result>1</result>
    <message>135424029885699910</message>
  </command>
</commands>


zipstatus response:

Code: Select all

httpResponseStatus 200
   [ Cache-Control ] = private, no-cache, no-store, proxy-revalidate
   [ Connection ] = Close
   [ Content-Length ] = 99
   [ Content-Type ] = text/xml; charset=utf-8
   [ Date ] = Mon, 05 Dec 2011 18:37:04 GMT
   [ Pragma ] = no-cache
<commands>
  <command>
    <type>zipstatus</type>
    <result>1</result>
    <message/>
  </command>
</commands>


elapsed: 0:36

downloadaszip fails because zip is still in progress, and Tonido_Zip_<id>.zip file left in the directory.

I'm not sure how ladybug helps, though I did use Charles to view the browser's api calls...

Am I perhaps, missing some RequestHeader?

Regards,

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8617
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: downloadaszip

Postby madhan » Mon Dec 05, 2011 12:36 pm

The Tonido_zip will remain in the directory for a while.
The download as zip actually downloads that zip file.

spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 1:18 pm

yes, but why am I getting a result=1 when the zip is NOT ready?

seems like the response is cached somewhere...

Regards,

spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 2:19 pm

No, not sending the time... I noticed it on all the calls, but it is not documented in any API docs, so omitted it... how is it calculated.

I don't think the local cache is a problem, since I tried explicitly turning it off in the request (and anyway, its not the same request...)

Also, since I am still running Jaunty, the clock on the plug is messed up. I did create a cron job to reset it every 12 hours or so...

Regards,

spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 4:15 pm

Added time(stamp) - no change

log output:

Code: Select all

15:07:49:117 [1577] [TCPServerConnection (default[#1555])]:T: HTTP Request [192.168.2.133] [GET] [/core/startzip?path=%2Fmedia%2Fusb0%2FMy%20Music%2FiTunes%2FiTunes%20Music%2FThe%20Eagles%2FOne%20Of%20These%20Nights&time=1323118642]
15:07:49:120 [1582] [default[#1560]]:T: CompressActivity Starting.... /media/usb0/My Music/iTunes/iTunes Music/The Eagles/One Of These Nights file Tonido_Zip_135424120691202650.zip
15:07:51:001 [1580] [TCPServerConnection (default[#1558])]:T: HTTP Request [192.168.2.133] [GET] [/core/zipstatus?id=135424120691202660&time=1323118644]
15:08:21:707 [1577] [TCPServerConnection (default[#1555])]:T: HTTP Request [192.168.2.133] [GET] [/core/downloadaszip?id=135424120691202660]


The first zipstatus after startzip returns 1!

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8617
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: downloadaszip

Postby madhan » Mon Dec 05, 2011 5:02 pm

Are you doing multiple download as zip calls?

spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 5:44 pm

yes, my download manager stacks them up until one is ready, then loads it...

Regards,

spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 6:44 pm

Actually, I startZip when I push them on the queue. Looks like it can only support a single startZip request at a time, so I will need to redo the state machine for zip.

Question for Madhan: does downloadAsZip honor Range request headers?

Thanks for taking the time to help...

Regards,

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8617
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: downloadaszip

Postby madhan » Mon Dec 05, 2011 6:45 pm

downloadaszip doesn't honor range requests.

spartacus
Super Tonidoid
Super Tonidoid
Posts: 34
Joined: Wed Oct 20, 2010 1:39 pm

Re: downloadaszip

Postby spartacus » Mon Dec 05, 2011 11:10 pm

ok, allowing only 1 startZip at a time:

still finding that zipStatus returns 1 IF ANY ACTIVE zip - e.g. failed, but not abandoned.

why bother with ID if the zipStatus result is not even correlated with the passed ID???

Regards,


Return to “Tonido Platform Development”

Who is online

Users browsing this forum: No registered users and 3 guests