Commits


add missing time.h include


convert telescope to use ev instead of libevent libevent is a very cool library, I like the APIs and enjoy using it. However, telescope is not as large and doesn't have as many file descriptor, so libevent is quite ``too big'' for our needs. ev started as a small event loop on top of poll(2) for amused, and can be used here too, it just needed to grow the ability to handle several timers, as we need quite some on telescope (in fact, we use more timers than fds!)


some headers cleanup try to not include headers from headers, and remove some redundant include. This helps in modularizing the codebase and also helps during incremental compilations.


rework the history management It was a huge pile of spaghetti with useless utility functions and lots of code reaching into the "data structure" (if you can call it so) to do stuff. Instead, provide a "module" with a clean interface and noone reaching in the insides.


partial revert of "abstract over evbuffers" partial revert of commit d54dd8160b88709f3d243e1410a781e5de7fc187. We don't really need an abstraction over "printf-like" things. I can just use plain old FILEs. open_memstream (which conforms to POSIX.1) is what I should have used from the beginning in my mcache implementation.


parser/serialize: abstract over evbuffers the serialize "method" will soon be used in other context where using evbuffers would be awkward. Introduce a small abstraction over it: a printfn (print function) fprintf-like.


switch the cache to the new parser_serialize API


crank up cache limits delete pages that are older than one hour, and scan the cache only once every five minutes. The previous defaults were a bit too much conservative.


drop useless struct instead of keeping the struct mcache that's private to mcache.c and used only once, just define its fields as (static) variables. While here, mark as static also gemtext_prefixes.


timer-based cache removal: delete cached pages older than 15 minutes


cache: keep track of the total size and number of cached pages


mcache_tab: free previous copies of that page


move util.c declarations in utils.h it's not spelled `util.h' because otherwise it'd get included instead of /usr/include/util.h


de-duplicate hash_* function: collect them in util.c


save parser name across mcache_tab/mcache_lookup