Commit graph

12 commits

Author SHA1 Message Date
Laslo Hunhold
ccdb51b96d Refactor the single source file into multiple modules
And many other things, too many to list here. For example, it now
properly logs uds instead of erroring out.
Separating concerns in many places definitely improves the readability.
2018-02-04 21:27:33 +01:00
Hiltjo Posthuma
5defa985db config.mk: improve feature test macros and compatibility
- add missing header netinet/in.h for socket declarations (POSIX).
- rename sendfile to responsefile, sendfile(2) is a syscall on FreeBSD.
- remove _XOPEN_SOURCE: this will give a warning about strptime on Linux
  glibc, but unbreaks the build on NetBSD and FreeBSD.

thanks also to josuah and quinq for testing!
2017-08-30 23:30:58 +02:00
Laslo Hunhold
7e199ee04d Don't default to clang 2017-08-14 00:06:26 +02:00
Laslo Hunhold
bf23f53b12 Update MANPREFIX according to FHS
http://www.pathname.com/fhs/2.2/fhs-4.11.html
2017-08-13 23:30:13 +02:00
Hiltjo Posthuma
e8dab1db94 config.mk: fix warning about strptime on glibc 2017-06-28 20:20:10 +02:00
Hiltjo Posthuma
6ec37625f8 config.mk: fix compiler warning, just use DEFAULT_SOURCE
warning was:
warning: implicit declaration of function 'strptime'
warning: implicit declaration of function 'setgroups'
2017-06-27 23:31:08 +02:00
Laslo Hunhold
6347e2ec3e Rewrite quark from the ground up again
I noticed that the data structures didn't allow a flexible handling of
the code while trying to extend it to support if-modified-since-responses.
To tackle this, I refactored the data structures and proceeded to
rewrite the server from the ground up, implementing all present features
plus fixing a lot of bugs and introducing the 304 header handling as
requested by many people.

Please report bugs if you find them.

While at it, I refactored the build system as well and updated all
surrounding files respectively.
2017-06-20 21:40:00 +02:00
FRIGN
0ce86bba15 Initial commit of quark rewrite
Roughly 700 LOC (half of the old quark on the Hiltjo branch) in size,
this rewrite supports partial content and other good stuff that will
make it fun again to use quark for simple static purposes.
The error checking is rigorous and strict and it will report proper
error codes back to the client whenever there was a problem or the
request was invalid in some way.

A cool feature is the support for listening on a UNIX-domain socket,
which will in the long run allow us to solve problems with virtual hosts
and other things in separate programs. But until then, this should be
robust enough for most use-cases.

This resets quark's version to 0, but this was no problem as there
haven't been any quark releases yet.

Feedback is appreciated.
2016-09-02 09:59:02 +02:00
FRIGN
0e8cac1ee4 Prepare repository for rewrite
It was sad to see that quark never got the attention it deserved in my
opinion. However, there were good reasons why that was the case.

The project lost focus by trying to add CGI support, which in all
fairness worked only half of the time.
For the rest of the use cases, a static server to make it dead simple to
publish a directory, it was also pretty bad, given it does not support
partial content. Seeking in a mp3 was impossible and it was very
frustrating.

Long ago we discussed in the team how exciting it would be to test out
new concepts of having a web server that listens on a UNIX-domain
socket, potentially allowing new concepts for realizing virtual hosts
and other things.

It took me half a year to make the decision to rewrite quark, so it is
now time to purge the repo and push the initial commit.
2016-09-02 09:46:01 +02:00
sin
7a587cfa36 Simplify config.mk
A separate INCS/LIBS is not really necessary here and confuses
the common case.
2014-12-01 18:18:58 +01:00
Hiltjo Posthuma
fa113f8b47 cgi: parse Status: header
CGI applications can specify a HTTP status to output with the Status:
header. For simplicity the CGI application must use this header on the
first line. With this change cloning git repositories over HTTP with
cgit works.

in config.mk specify _GNU_SOURCE and _POSIX_C_SOURCE instead of
_GNU_SOURCE, this is for getline().
2014-08-20 12:58:10 +02:00
Anselm R Garbe
ce31aca1aa initial commit 2009-08-15 19:56:11 +01:00