Archived
1
0
Fork 0
Commit graph

34 commits

Author SHA1 Message Date
Henrik Hautakoski
6758b06188 dlhist: use sha1 hashes as keys to make records fixed size.
use sha1 hashes instead of c-strings to make records fixed size.
because it's hard to find collisions in sha1 hashes, this works well
in practise. And dynamic memory allocation for the variadic size keys
is not needed anymore. space is also reduced due to most key strings being
more than 20 bytes long.

calculating sha1 should be fast enough to not make any more overhead
than dynamic memory allocation did.
2011-10-04 15:29:45 +02:00
Henrik Hautakoski
1f46350f84 dlight.c: don't use errno from http_fetch_file
http_fetch_file does not set errno. so dont use it.
2011-10-02 22:42:34 +02:00
Henrik Hautakoski
356cddf07d error.h: Incorrect name in function prototype 2011-09-29 23:25:05 +02:00
Henrik Hautakoski
02814cc1f7 dlight.c: only download a file once.
When going through the filter list for an item, we download and store the item
everytime a filter is matched.
This patch allowes an item to be downloaded the first time a filter
match and save the data throughout the rest of the list, so all
other matches never downloads the item again but uses the data in memory.
2011-09-29 21:34:34 +02:00
Henrik Hautakoski
eb0702cd93 http: Adding http_fetch_file().
Sometimes, you want to fetch a file in memory so you can
store it on multiple places on disk whitout having to download it
again or copy files. while http_fetch_page works for fetching data
in memory, the possible filename found in the 'Content-Disposition'
header-feild is not accounted to.

http_fetch_file() fetches the data and store it in memory while trying to
get ahold of the filename.
2011-09-29 19:54:02 +02:00
Henrik Hautakoski
ad4ac41b13 lockfile.c: missing stdlib.h for atexit() 2011-09-24 13:53:18 +02:00
Henrik Hautakoski
611409c777 lockfile: expose locked()
usefull to have this macro in the interface so other modules using lockfiles
can check if a certain lock is active.
2011-09-24 13:03:22 +02:00
Henrik Hautakoski
2f9e968717 dlight.c: more verbose output 2011-09-20 16:33:55 +02:00
Henrik Hautakoski
6a4d6af99d lockfile.h: small typo in headercomment 2011-09-12 20:40:52 +02:00
Henrik Hautakoski
5eda6e7705 dlhist.c: resize_table: Oops, storing floating point value in integer. 2011-09-21 17:19:12 +02:00
Henrik Hautakoski
fce177b486 dlight.c: dlhist purge: remove magic number and set interval to 6h 2011-09-21 17:19:12 +02:00
Henrik Hautakoski
90505d8e5b remove new-line from error() calls. 2011-09-21 17:19:12 +02:00
Henrik Hautakoski
9767be013a http.c: refactor http request code.
remove duplicated curl code in 'fetch_page' and 'download_file'
and put it in an helper function.
2011-09-21 17:19:12 +02:00
Henrik Hautakoski
8cf883eb29 http.c: remove new-line from error() calls
one new-line is always appended to the message by the error function.
2011-09-21 17:19:11 +02:00
Henrik Hautakoski
c1a7c9671d http.c: skip memory storage when download files
don't need to store the http data in memory when downloading files, write to disk directly.
2011-09-21 17:19:11 +02:00
Henrik Hautakoski
3aea2adbc6 dlight.c: print items that are downloaded 2011-09-21 17:19:11 +02:00
Henrik Hautakoski
a2569b58e3 http.c: remove double init of CURLhandle
handle is initialized in setup_connection()
2011-09-21 17:19:11 +02:00
Henrik Hautakoski
8b649d35f6 http.h: remove unneeded function prototype 2011-09-21 17:19:11 +02:00
Henrik Hautakoski
d931ce7fd8 adding command line tool for checking an regex 2011-09-21 17:19:11 +02:00
Henrik Hautakoski
4c8c92b7f6 lockfile.c: unlink locks on signal 2011-09-21 17:19:10 +02:00
Henrik Hautakoski
45736b3845 filter.c: dont print error in 'compile()'.
Make compile store the error information in a struct so that both filter_check_syntax
and filter_match, can share the code.
2011-09-21 17:19:10 +02:00
Henrik Hautakoski
a2f2e58353 Make the other modules use error.c 2011-09-21 17:19:10 +02:00
Henrik Hautakoski
6bc3ffde5d Adding error.c/.h 2011-09-21 17:19:10 +02:00
Henrik Hautakoski
692cdc16dd Makefile: add -Wall -O2 to CFLAGS 2011-09-21 17:19:10 +02:00
Henrik Hautakoski
b02ff8863e lockfile: release locks on exit 2011-09-21 17:19:10 +02:00
Henrik Hautakoski
31293d7253 gitignore: ignore executeables and config file 2011-09-21 17:19:09 +02:00
Henrik Hautakoski
1166d3be86 compiled file format: associate destination whit each invidual filter
Better to have an destination for every filter then every target.
otherwise one will have to have two targets with the same source but
different destination.
2011-09-21 17:19:09 +02:00
Henrik Hautakoski
bb5963dbf6 License with GPLv2 2011-09-21 17:19:09 +02:00
Henrik Hautakoski
ffb8241a89 compile.c: parse_alias() only allow 'MAXNAME' number of characters for an alias 2011-09-21 17:19:09 +02:00
Henrik Hautakoski
31ede77a9a compile.c: refactor out alias parsing 2011-09-21 17:19:09 +02:00
Henrik Hautakoski
06dca6c150 dlhist.c: use lockfile 2011-09-21 17:19:09 +02:00
Henrik Hautakoski
5a5a3d33e4 Adding lockfile.c
moving code from compile.c under an api so it can be reused.
2011-09-21 17:19:09 +02:00
Henrik Hautakoski
00e149c04c compile.c: check filter syntax 2011-09-21 17:19:08 +02:00
Henrik Hautakoski
b2df740514 Initial commit 2011-09-21 17:13:28 +02:00