Commits
- Commit:
ea827802c0280cb0d5539553eabb137f990fb926
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
ab5bda7ecb7748b16898b3af71948dc94ce96296
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
f422fd17f5e761577489af8e09480ed6cd2f61bf
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: ignore SIGPIPE in the sockets processes too
- Commit:
f85c939fb7758c7cad91e0705b4d932d52597867
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
7d1d4b6ff2bc57110299da7fafbade01160fa0ef
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
2edd250dd96801661e3eba82e6b3ee229563f38f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
9cfaa6380d1d5dd7099dc202d5abe01963cea9b8
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
reduce gotwebd pledges to the minimum currently required; with op@
- Commit:
79e60db648de07c38759b79dd9acefb3b82e04f2
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
d8bf4f258cbea84e319b0ed044224aaac37a085c
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
102d840de78061d9f313aaa557ef64f586932143
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
dropping unnecessary strlen()s
ok jamsek, stsp
- Commit:
e19f80400423f0275c9dd785179aa06a3efabab0
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: drop unused `prefixlen' from struct address
ok stsp@
- Commit:
161663e7ebf5aa10caf7b4048f013d5e45db5fe3
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
2e9bd5cb1a3122326a3b347a6febc7da047b58ad
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
4fccd2fe0ffbbc668b66abe63614470635f92f1b
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: configure: split out dependencies
Rather than assume all dependencies are required for all programs, split
them out.
This will make packaging easier, as well as splitting the code to use
subprojects.
Note that due to the use of config.h semantics, in most cases the
got_compat.h header file is now at the top of the .c file it is included
in, so that it can handle the system header inclusion properly.
- Commit:
e7e5fa49fc2e589a02ba9a9412a7b8e2377ead68
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: start using the template system
ok tracey@
- Commit:
55e6cffd2185ebe82b0abfbdcd92c49778cc928d
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
make gotwebd cache open repository handles in struct server
ok op@
- Commit:
e4c7e0b01e18572d45e9de2ee0fe0be23f11f0f9
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
allow multiple "listen on" statements per server in gotwebd.conf
ok tracey
- Commit:
75716fd6ed1a99a0e601b2820363b17d7c0333a7
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: sockets: handle sa_len/ss_len portably
In the sockaddr_storage struct, there can be a ss_len field. This is
seen on some BSDs, but not Linux. Since this isn't POSIX-specific,
there's no guarantee it will be available on all systems.
- Commit:
1f6ec0684239b7d7a1b63040f34db7d348fe5cb7
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
mark functions internally used by sockets.c as static
ok tracey
- Commit:
c19738c9ed1553d21d6acaecb58a6fa9d966b63b
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- 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:
9d7714e36f114695b3a1737360a6ef12b361860d
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: struct socket_conf can only use a single address, so don't use a list
ok tracey
- Commit:
720c2b0511f6dbff9e2bf529e474143ca8617731
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: initialize IPv4 and IPv6 sockets in the same way
ok tracey
- Commit:
90d63d4711e9554b6e7e6e26d2fbeb50964452cf
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: do not allocate server/socket list heads separately
ok millert@
- Commit:
62f852145bf61e3ed9b42f7a00cd7cd0b5ff8835
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
gotwebd: do not allocate address list heads separately, this is unnecessary
ok millert@
- Commit:
717a78d4f87c3704afe34c77e211349932575d5b
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix snprintf error handling
follow the "proper secure idiom" described in the CAVEATS section of
printf(3). reminded by tb@ and millert@