Re: Prevent curl to trigger progressbar on 302 redirections

2013-01-11 Thread Alexandre Filgueira
Sorry, I have an error on my writting:
to now trigger I ment to say to not trigger

2013/1/11 Alexandre Filgueira alexfilgue...@cinnarch.com

 Content-Length: 369
 My guess this is the difference. The one redirect has a body, and the
 other doesn't:


 I see... so, if I want to bypass that to just show one progressbar, could
 I check if it is a redirection first, and knowing that tell curl to now
 trigger the progressbar when content-length  0?

 2013/1/11 Dan Fandrich d...@coneharvesters.com

 On Fri, Jan 11, 2013 at 01:18:36AM +0100, Alexandre Filgueira wrote:
  I'm curious about this. The thing is that I'm using a redirector on my
 server
  (using Mirrorbrain) and when curl download a file from there it trigger
 the
  progressbar twice, downloading just bytes (I assume that it is the
 redirection)
  in the first one, and the proper file in the second one.
 
  My headers are big, because Mirrorbrain puts a lot of stuff there:
 
 
  [faidoc@Delorean ~]$ curl -sD- -o/dev/null
 http://mirrors.cinnarch.com/
  cinnarch-core/x86_64/cinnarch-keyring-20120717-3-any.pkg.tar.xz
  HTTP/1.1 302 Found
  Date: Fri, 11 Jan 2013 00:14:12 GMT
  Server: Apache/2.2.16 (Debian)
  X-MirrorBrain-Mirror: softlibre.unizar.es
 [...]
  Content-Length: 369

 My guess this is the difference. The one redirect has a body, and the
 other doesn't:

  [faidoc@Delorean ~]$ curl -sD- -o/dev/null
 https://www.archlinux.org/
  packages/extra/i686/aalib/download/
  HTTP/1.1 302 FOUND
  Date: Fri, 11 Jan 2013 00:14:50 GMT
  Server: Apache
  X-Frame-Options: DENY
  Content-Length: 0

  Dan
 ---
 List admin: http://cool.haxx.se/list/listinfo/curl-library
 Etiquette:  http://curl.haxx.se/mail/etiquette.html



---
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Re: Prevent curl to trigger progressbar on 302 redirections

2013-01-11 Thread Dan Fandrich
On Fri, Jan 11, 2013 at 09:38:13AM +0100, Alexandre Filgueira wrote:
 Sorry, I have an error on my writting:
 to now trigger I ment to say to not trigger
 
 2013/1/11 Alexandre Filgueira alexfilgue...@cinnarch.com
 
 Content-Length: 369
 My guess this is the difference. The one redirect has a body, and the
 other doesn't:
 
 
 I see... so, if I want to bypass that to just show one progressbar, could 
 I
 check if it is a redirection first, and knowing that tell curl to now
 trigger the progressbar when content-length  0? 

Sure, that would work, at the cost of another 5 or so round-trips.

 Dan
---
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html