Commits
- Commit:
2a83fef7ce7879df1f318a442bb1d8d0012fa5e8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: use less temp files
Instead of allocating a whole set of temp fd per `listen' directive,
just use a global set per "sockets" process. This is fine since
gotwebd doesn't keep multiple connections open at the same time,
once it enters gotwebd_process_request() it won't exit until all
the page has been processed. (this because we don't have async
APIs for got operations.)
ok stsp@
- Commit:
1220d7ea84811c79f71a7f24917d77cb2f10b02a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got{,web}d: unify log.c
gotd and gotwebd are using almost the same log.c file, so unify.
This only slightly changes gotwebd logs to include the process name,
like gotd.
ok stsp@
- Commit:
360794246d58ac20752da51536158584a51d1478
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: simplify handling of unix sockets
- don't assume an implicit "listen on socket" when another listen was
specified in a server block
- allow servers to share the sockets they're listening on
- fix unix_socket_name; now it's actually used
- remove `listen on socket off' and `unix_socket off' options that
are now no longer useful
- unify the internal handling of the sockets, i.e. don't consider
unix socket special.
ok tracey@
- Commit:
736fac9082f40fedb3e0fe65f715dc403eb7b250
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix logging during gotwebd shutdown
During `rcctl stop gotwebd' the sockets process gets a SIGTERM and
dies, and this makes the parent process assume it exited abnormally.
Instead, catch SIGINT and SIGTERM and exit gracefully.
Issue reported by xs on IRC.
ok jamsek
- Commit:
56a9d3151cd30e0b62e13d1469bc2f6b6a24f231
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: fix broken signal catching due to a pasto
While here, remove completely the libevent handling of SIGPIPE in
favour of the already existing signal(3) call to ignore it; there's
no point in logging a SIGPIPE.
- Commit:
1632f50aca5cd94ed681c20fc18c2b8ab4857b9c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove the gotwebd repository cache
It only had 4 slots so was never quite useful, and sharing of sock->pack_fds
across cached repositories seems problematic.
with help from + ok op@
- Commit:
8def94257de0c243b087788186b73585ffc24f25
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: ignore SIGPIPE in the sockets processes too
- Commit:
26678adde25a1fb7fa3e4b78c82a888cc3b767e4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: get rid of proc.[ch]
proc.c really shines when there's a network of different types of
processes, potentially with a various number of instances each,
that needs to exchange messages. Gotwebd instead has a much simpler
design, and using proc.c causes more overhead (/headaches) than it
solves.
So, this attempts to provide the same functionalities but with a
much simpler implementation that fits gotwebd better.
ok stsp@
- Commit:
0c64c2f8032e7c3de8b5b3ca5c5bd9047b89b17c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: clean up sockets_create_socket a bit
Instead of hardcoding the flags, keep ai_{family,socktype,protocol}
from the getaddrinfo() call and apply them here.
ok stsp@
- Commit:
cdfd248aa718819d40d0bf972b7efbb2eabd31c9
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotadmin: get rid of got_sockaddr.[ch] usage
It was added due to gotwebd weird structure sockaddr_storage handling.
Instead, save the size reported by getaddrinfo() and not reach into
the struct sockaddr_storage at all (except for extracting the port
number for diagnostics purposes.)
sockets_conf_new_socket_fcgi() gets an hardcoded ipproto to zero
(which is the only value it can get in practice, and keeps for the
moment the hardcoded SOCK_STREAM. It'll be cleaned in a follow-up.
ok stsp@
- Commit:
63c6b10f7b78b600251e3eb2622e0db7db0f8aa0
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
reduce gotwebd pledges to the minimum currently required; with op@
- Commit:
6fe3b58aaa9bdb466eabad75eb65bce86d7155af
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix gotwebd unveil permissions
The main process doesn't need write access anywhere and /tmp is not needed.
The sockets process didn't use unveil at all so far, but is happy with
just "x" for libexec helpers and "r" for each server's repository path.
Input from op@
Tested by myself and Kyle Ackerman who also reviewed the diffs.
Prompted by questions from mlarkin@
ok mlarkin@, op@
- Commit:
62eab86e6a1d5aea8a1bf90999c3c058b9aedd07
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: move the buffering from the fastcgi layer to the template
Reduces the indirection in fcgi.c, starts to make the struct template
opaque, simplifies the template usage. All with a net negative :-)
reads fine to stsp@ (thanks!)
- Commit:
4448825ab554378228429f5ac53c9cf943cc2503
- From:
- Omar Polo <op@omarpolo.com>
- Date:
dropping unnecessary strlen()s
ok jamsek, stsp
- Commit:
1adf41e8089257344579fba9c7e03d7ebc0c15b8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: drop unused `prefixlen' from struct address
ok stsp@
- Commit:
df2d3cd2545e0a1579ce83ae137e52135755ed1f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: provide gotweb_render_page() entrypoint for all pages
simplify gotweb_process_request more, handling all the pages
inside the big switch. There's only one entrypoint for rendering
the templates gotweb_render_page() that takes the page' content
as argument.
The only real difference is that gotweb_render_index() now skips
directory entries which fails to handle.
ok tracey@
- Commit:
5add7f42e1397d136860680e1f0411db17b4f22c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: handle short reads and timeouts
If a short read happens, or if all the fastcgi record to read don't fit
in the buffer, gotwebd fails to continue reading and hits the timeout.
If this happens before gotweb_process_request is called, it will crash
in gotweb_free_transport since c->t will be NULL.
This register the event with EV_PERSIST so fcgi_request is called again
when there's more to read and guards gotweb_free_transport. It also
makes spaces for the records as soon as they're successfully parsed.
With lots of help from stsp
ok stsp@
- Commit:
ed619ca07e51b9c984c8404ca2b1153efdb14d1e
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gotwebd: start using the template system
ok tracey@
- Commit:
b5c757f5f816a8061f4879da9e68a39141148e40
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make gotwebd cache open repository handles in struct server
ok op@
- Commit:
67d8de2a7e03c31bd8c93553fcb950fa7afc0db7
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
allow multiple "listen on" statements per server in gotwebd.conf
ok tracey
- Commit:
026ac2c462910064c5c9143a96b17a920e6bbc58
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
mark functions internally used by sockets.c as static
ok tracey
- Commit:
859aa9f48371a84128b60e2c2ba9f873a4ea70cf
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix previous: store port number in host byte order, convert for struct sockaddr
With the previous patch the listen port was correct, but the debug log output
was still displaying the swapped port number. Now both listen behaviour and
debug log output agree.
- Commit:
610dd8c9f454e1625b0eddc16af87b765279b0a5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
gotwebd: struct socket_conf can only use a single address, so don't use a list
ok tracey
- Commit:
4fcc9f7404ca2e0dd2ee085f09d6246587c6c503
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
gotwebd: initialize IPv4 and IPv6 sockets in the same way
ok tracey
- Commit:
2ad48e9a6b577bb911e97eb269ed1654dbb048f9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
gotwebd: do not allocate server/socket list heads separately
ok millert@