Commit Graph

8 Commits

Author SHA1 Message Date
Omar Polo a5d310bc0d
[cgi] added support for path parameters
enhance the CGI scripting support so that script can take path
parameters.  That is, a script at /cgi/foo is called when the request
path is /cgi/foo/bar/...

This commit also introduce some backward incompatible changes as the
default env variables set for the CGI script changed.
2020-11-10 14:07:36 +01:00
Omar Polo 0ed5656795
documentation improvements 2020-11-06 18:11:45 +01:00
Omar Polo 72342dc960
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!
2020-11-06 13:01:31 +01:00
Omar Polo 2c3a40faf8
added option to log to a file 2020-11-06 10:58:30 +01:00
Omar Polo 20f688381a
doc: point out that we can handle multiple clients concurrently 2020-11-05 17:06:12 +01:00
Omar Polo fab952e1d7
minor documentation edits 2020-10-03 17:49:09 +02:00
Omar Polo 6980aad6d7
fix errors in manpage
man -Tlint -l gmid.1

helped a lot
2020-10-02 19:44:32 +02:00
Omar Polo 3e4749f7f9
initial commit 2020-10-02 19:39:00 +02:00