Commit Briefs

Thomas Adam

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@


Thomas Adam

whitespace fix


Thomas Adam

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@


Thomas Adam

gotwebd: improve gotwebd_assign_querystring()

This prevents the issues that we just hit with forgetting to remove PREVID: instead of relying on the enum value to yield the size of a table, use nitems(). Also, quit as soon as the matching key was found, no need to iterate further. ok stsp@


Thomas Adam

gotwebd: render all the datetimes in a time tag

fixes an unused variable that should have been dropped in previous commit too. ok stsp@



Thomas Adam

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!)


Thomas Adam

gotwebd: fix branches modification time with show_repo_age off

If show_repo_age is set to off, got_get_repo_age() returns without setting the timestamp. got_get_repo_age() is also used by the branch listing to show how old they are however, and we end up rendering the stack garbage. Instead, respect `show_repo_age off' one layer above, and always return a timestamp in got_get_repo_age(). While here, initialize the timestamp to zero so it's set also in case of failures. Issue reported on IRC by xs, thanks!


Thomas Adam

bubble up got_repo_commits()

now that got_get_repo_commits() doesn't look at `action' we can stop fetching the commits during the rendering and bubble up the call. This yields better error messages and better replies codes on failure.


Thomas Adam

simplify gotwebd' server matching

Currently, if there is not a match on the server name, it attempts to match the "subdomain" against the server names, and fall back to the first server defined. The server name is taken from the SERVER_NAME fastcgi' parameter, the subdomain extracted from HTTP_HOST. Keep only the SERVER_NAME matching, but still use the first server defined if there's no match. Fix the manpage documenting how matching works and drop the lie about SNI as gotwebd doesn't do TLS but just looks at what the upstream http server decided. ok stsp@


Thomas Adam

retire GOT_ERR_QUERYSTRING

it's redundant with GOT_ERR_BAD_QUERYSTRING; convert its only use to the latter.


Thomas Adam

dropping unnecessary strlen()s

ok jamsek, stsp


Thomas Adam

gotwebd: fix some got_error_from_errno2/3 calls

it's not printf-like so %s don't make sense. Tweak the order of the arguments to obtain the intended output.



Thomas Adam

rename got_gotweb_flushfile -> got_gotweb_closefile

suggested and ok millert@



Thomas Adam

simplify got_gotweb_openfile/flushfile

Return only the FILE *, and require only that to close subsequently. Having to manage the file descriptor too makes using these functions unnecessary complex. millert@ agrees


Thomas Adam

gotwebd: fix logic error and skip again some entries in the index

logic error introduced in df2d3cd25 ok stsp@


Thomas Adam

gotwebd: don't special case BLOB, BLOBRAW and RSS

shuffle some code to handle all the page types in the switch. ok tracey@


Thomas Adam

gotwebd: reply with non-200 HTTP status code on error

ok tracey@


Thomas Adam

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@


Thomas Adam

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.


Thomas Adam

portable: rework SHA detection

Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.


Thomas Adam

portable: remove sha1.h; found portably

Remove sha1.h as this is found portably across systems.


Thomas Adam

include sha2.h too where sha1.h is included

In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>