Coder Social home page Coder Social logo

snarf's Introduction

This program is FREE SOFTWARE. See the file COPYING for details.

==================
snarf version 2.0
October 1, 1998
==================

Description
-----------
     Snarf is a utility I wrote to retrieve documents via the http and
ftp protocols. It supports http redirect, http and ftp resume, http
and ftp authentication, and other neat things.

Usage
-----
     To use snarf to download a file from an url, type 
"snarf <your url>". This will transfer the file from the remote
location to your computer. You can have as many URLs on the command
line as you want: "snarf <URL> <URL> <URL>" will download three
files. By default, it saves the file with the same name it had on the
remote system; if you want to change this, you can do 
"snarf <URL> <filename>" and it will save your URL to the filename you 
provide.

     To use the HTTP proxy feature, set the SNARF_PROXY, HTTP_PROXY,
or FTP_PROXY environment variables to the address of your proxy, such
as "proxy.mycompany.de:1080".

     If you run snarf without any arguments, it prints some usage
information.

Notes
-----
     I wrote this in three days four years ago and it was majorly
klugy, but it worked, and pretty niftily. I rewrote it from scratch
over the past few days and I'm pleased to say that it's much nicer and 
cleaner inside, and this cleanliness has made it easy to add some
features I always wanted to add to the old version.

Version 2.0.3:

     This version has a configure option of
"--with-guess-winsize". This feature uses ioctl to determine what your
operating system things the width of your terminal is. It's not
enabled by default, because I don't know how well it works on all
platforms. It's safe to enable on Linux and Solaris. If you manage to
get it to work somewhere else, let me know.

Email: [email protected]

Snail mail: Zachary Beane, 17 Talmadge Rd., Waite, ME 04492, USA


snarf's People

Contributors

xach avatar

Stargazers

frankfanslc avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

pandagxnu

snarf's Issues

atoi() is not safe against large files

Hi!

I'm trying to download a file which has a content-length of 2608578106 bytes (2.4 GB). When I try using snarf, I get

warning: you already have all of `indiegamethemovie-1080p-1356475247.zip', skipping

even though the local file, indiegamethemovie-1080p-1356475247.zip is empty. I believe this to be due to line 427 on http.c, which says

rsrc->outfile_size = (off_t )atoi(len_string);

I tried this line in a standalone program, as follows:

printf("%ld\n", (off_t)atoi("2608578106"));

This prints out -1686389190. I believe this is causing the condition on line 157 of file util.c to become true because the size of the file is negative.

It seems like you ought to be able to trivially fix this using atol or strtol, but in my brief testing it seemed like these returned ints and not longs. Maybe I have the compiler flags wrong or something.

Thanks for your time!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.