Commits
- Commit:
aff8d1901084bbfd81f4a6335dbed70a02b930fb
- From:
- Omar Polo <op@omarpolo.com>
- Date:
handle CGI concurrently
don’t stop-the-world-until-cgi-end, but rather poll on the script, so
we can handle other requests in the meantime.
- Commit:
60ba426e7e5da49c017f306be78446032cdaf1cf
- From:
- Omar Polo <op@omarpolo.com>
- Date:
[cgi] setenv instead of building an env + define more env variables
- Commit:
75d233f00c010a1489d597b82b13e3d09bc01e45
- From:
- Omar Polo <op@omarpolo.com>
- Date:
pass the query parameter to start_cgi
- Commit:
aa0fe0cf240e0add51d5b60a83dd554fd0575b28
- From:
- Omar Polo <op@omarpolo.com>
- Date:
extract query parameters from the URL
- Commit:
3c19febb014ddc7d9afa1b517c108da4b3fda5dc
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ensure the requested protocol is “gemini”
…and not something else that happens to be 6-bytes long.
- Commit:
e8cac16e03c5b86eebd6e50b267a3f0479bf3a81
- From:
- Omar Polo <op@omarpolo.com>
- Date:
mark every open file as close-on-exec
- Commit:
72342dc9606a0283490a3a9283d2ed2d31888eeb
- From:
- Omar Polo <op@omarpolo.com>
- Date:
implementing CGI – NOT READY YET!
This is a first try at implementing CGI scripting. The idea is that,
if CGI is explicitly enabled by the user, when a user requires an
executable file instead of serving it to the client, that file will be
executed and its output fed to the client.
There are various pieces that are still lacking, the firsts that comes
to mind are:
- performance: the handle_cgi just loops ignoring the
WANT_POLLIN/POLLOUT and blocking if the child process hasn’t
outputted anything.
- we don’t parse query variable (yet)
- we need to set more variables in the child environment
side question: it’s better to set the variables using setenv() or
by providing an explicit environment?
- document what environment the CGI script will get
- improve the horrible unveil/pledge(cgi ? …)
but now I can serve “hello-world”-tier script from gmid!
- Commit:
2c3a40faf850ad608abf87f928a11fb4fba3057b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
added option to log to a file
- Commit:
932b001a3f330546d8719424f505b8ba671a3896
- From:
- Omar Polo <op@omarpolo.com>
- Date:
typo
- Commit:
dd080e1f755075b28ff552d3ebcf94508e3c3e66
- From:
- Omar Polo <op@omarpolo.com>
- Date:
define a MIME type for xml files
- Commit:
0cf902af628108c5038cd20f5958d524a812e232
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ignore SIGPIPE
bad clients can shutdown the socket and we will exit due to a SIGPIPE.
it ain’t fun.
- Commit:
9468027ba731a6ca955df8f49edd51cb4b46390a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
initial work for ipv6
make_socket can now return an ipv6 socket, and everything else still
works. ipv4 is still hardcoded tho.
- Commit:
f28f9311393eb43145c15dae01a440f1d0c9064c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
switching to mmap() based file handling
- Commit:
9c56b0a78a8194849c8d3b0f3e9727407b03dda0
- From:
- Omar Polo <op@omarpolo.com>
- Date:
style
- Commit:
09a1b978967c316e9c40caed8fe63a9a55565b9f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
put back the missing lseek, and change variables name
(I know, changing variables names AND introducing changes is better
done in more commits, but…)
Added back an lseek that was missing. If TLS_WANT_POLL{IN,OUT}, we
need to re-send that block, but we need also to rewind the file, in
order to read(2) that chunk again. This doesn’t solve the corruption
in transferring big files, but reduces them. I still haven’t tracked
down the corruption :/