1
0
mirror of https://git.sr.ht/~sircmpwn/gmnisrv synced 2024-06-08 17:30:43 +00:00
Commit Graph

11 Commits

Author SHA1 Message Date
Drew DeVault
becc4460b6 Implement MIME database support 2020-10-28 12:38:32 -04:00
Drew DeVault
da6f7e9f05 CGI: Fix SCRIPT_NAME variable 2020-10-26 18:16:05 -04:00
Drew DeVault
5d725ff4ee CGI: set PATH_INFO 2020-10-25 23:55:42 -04:00
Drew DeVault
cc1bd152e3 Initial support for CGI scripts 2020-10-25 23:16:50 -04:00
Drew DeVault
8baeb5a51c Initial implementation of a routing table 2020-10-25 21:46:01 -04:00
Drew DeVault
1fe107875b Overhaul network I/O to be async for real
Had to totally cut off OpenSSL from the network fd because obviously
OpenSSL is just going to wreck our shit
2020-10-25 14:50:07 -04:00
io mintz
a22bec5149 add a missing "/" to autoindex paths
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.
2020-10-15 15:44:45 -04:00
William Casarin
e77f354ca3 serve: fix gcc-9.3.0 error in serve_autoindex
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>
2020-10-15 12:06:19 -04:00
Chris Vittal
9d17ce46b0 return false on request_validate errors
This will report proper errors to clients rather than continuing on with
request processing.
2020-10-12 21:25:45 -04:00
Drew DeVault
6bc9c4deb9 Implement autoindex option 2020-09-26 15:51:28 -04:00
Drew DeVault
165e3c02fc Rehome some logic from server.c -> serve.c 2020-09-26 15:08:25 -04:00