summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Overhaul network I/O to be async for realDrew DeVault2020-10-253-101/+241
| | | | | Had to totally cut off OpenSSL from the network fd because obviously OpenSSL is just going to wreck our shit
* add a missing "/" to autoindex pathsio mintz2020-10-151-2/+1
| | | | | | | | | | | | | | | | | | | | With the following directory structure: /srv/gmni: baz/ foo/ /srv/gmni/baz: a /srv/gmni/foo: bar/ /srv/gmni/foo/bar: b trying to access gemini://somesite/ with autoindex=on works, but accessing /foo fails because it tries to stat /srv/gmni/foobar instead of /srv/gmni/foo/bar. This commit fixes that by adding a trailing slash.
* serve: fix gcc-9.3.0 error in serve_autoindexWilliam Casarin2020-10-151-1/+1
| | | | | | | | | | | | | gcc 9.3.0 catches an off-by-one error with strncat in serve_autoindex where it might not write a 0 byte: In function ‘strncat’, inlined from ‘serve_autoindex’ at src/serve.c:60:3: /nix/store/...glibc-2.31-dev/include/bits/string_fortified.h:136:10: error: ‘__builtin___strncat_chk’ specified bound 4097 equals destination size [-Werror=stringop-overflow=] Signed-off-by: William Casarin <jb55@jb55.com>
* return false on request_validate errorsChris Vittal2020-10-121-1/+4
| | | | | This will report proper errors to clients rather than continuing on with request processing.
* Bubble up client disconnect stateDrew DeVault2020-09-271-23/+36
| | | | This will fix the segfaults but won't fix slowlorris
* Break after processing polled clientDrew DeVault2020-09-271-0/+3
| | | | Otherwise we might not grok it, ya jive
* Only handle one client per poll iterationDrew DeVault2020-09-271-8/+4
| | | | | This is a bit of a hack but it avoids some problems with invalid reads when a client gets disconnected
* mime: add .xml -> text/xmlDrew DeVault2020-09-271-0/+3
|
* server.c: re-locate definitions to appropriate scopeDrew DeVault2020-09-261-7/+7
|
* Set SO_REUSEADDRDrew DeVault2020-09-261-1/+2
|
* server.c: appease GCC's magic pixie bullshitDrew DeVault2020-09-261-2/+2
|
* server.c: import netinet/in.hDrew DeVault2020-09-261-0/+1
|
* Fix size of in{,6}_addrDrew DeVault2020-09-261-2/+2
|
* Document (and tweak) log formatDrew DeVault2020-09-261-3/+2
|
* Remove [:tls] email directiveDrew DeVault2020-09-261-2/+0
|
* Free up resources throughoutDrew DeVault2020-09-264-11/+34
|
* disconnect_client: free more client resourcesDrew DeVault2020-09-261-0/+7
|
* Implement autoindex optionDrew DeVault2020-09-263-25/+169
|
* Rehome some logic from server.c -> serve.cDrew DeVault2020-09-262-119/+129
|
* Bump client buffer size to BUFSIZDrew DeVault2020-09-261-1/+0
|
* Log response body size in bytesDrew DeVault2020-09-261-1/+4
|
* Serve files from rootDrew DeVault2020-09-262-11/+112
|
* disconnect_client: clean up biosDrew DeVault2020-09-261-2/+3
|
* Always log server messages to stderrDrew DeVault2020-09-261-1/+1
| | | | So that you can just direct stdout to a file to get the request log.
* Parse requests and serve simple responsesDrew DeVault2020-09-261-17/+169
|
* Use O_NONBLOCK for client file descriptorsDrew DeVault2020-09-261-2/+13
|
* Implement TLS exchange with clientsDrew DeVault2020-09-244-12/+134
| | | | This probably leaves a bit to be desired tbh
* tls: move cert/key into host structureDrew DeVault2020-09-241-9/+4
| | | | | | | | We'll later want to set these on the SSL object (rather than SSL_CTX), so move these into the host struct for later access. We'll prefer to set it on the SSL object so that we can automatically use an up-to-date certificate, per ~sircmpwn/gmni#26.
* Implement TLS storeDrew DeVault2020-09-243-3/+186
| | | | Includes hands-free certificate generation and loading
* Log bind addresses on startupDrew DeVault2020-09-242-1/+6
|
* Generalize loggingDrew DeVault2020-09-232-28/+66
|
* Implement basic server event loopDrew DeVault2020-09-231-4/+180
|
* Generalize IPV6_V6ONLY usageDrew DeVault2020-09-231-1/+1
| | | | Some platforms other than Linux may implement this socket option.
* Initialize socketsDrew DeVault2020-09-233-1/+131
|
* config: parse listen directivesDrew DeVault2020-09-231-3/+58
|
* Initial config parserDrew DeVault2020-09-233-5/+179
|
* Vendor in some support codeDrew DeVault2020-09-234-0/+1887
|
* Initial commitDrew DeVault2020-09-231-0/+10