45 Commits
Author SHA1 Message Date
kristapsdz 0f7f5071ab All kxsocketpair() callers use the same arguments, so don't pass them. 2020-07-17 14:03:24 +00:00
kristapsdz ee09bfac8a Remove XASPRINTF and XVASPRINTF, make return checks for -1, make exported
wrapper functions consistent in error handling.
2020-07-17 13:58:05 +00:00
kristapsdz ecc091c29b Replace XMALLOC and XCALLOC and use some style(9) while there. 2020-07-17 13:32:36 +00:00
kristapsdz 05f95f41ab Remove the XREALLOC and XREALLOCARRAY functions. Plug a small memory leak
when unable to reallocate kpairs.
2020-07-17 13:14:44 +00:00
kristapsdz d77e5db1dc Remove XSTRDUP macro and remove superfluous line/file bits from kxstrdup. 2020-07-17 13:09:23 +00:00
kristapsdz ed3889ae5c Convert wrappers.c to using kutil_warn-style functions instead of the macro
wrappers.  Use style(9).  Remove an unused function.  Clarify docs.
2020-07-15 08:32:43 +00:00
kristapsdz ea1c07a7d6 Start leaning away from XWARN[X] in wrappers.c by using kutil_warn[x]
directly.  Liberally apply style(9).  Fix a yet-unfound bug where fullwritefd()
would return integral errors (<0, >0, 0), but the caller was doing a boolean
test of the result.  Now fullwritefd() properly returns a boolean value.
2020-07-14 12:25:03 +00:00
kristapsdz da43c0ea40 Switch to using kutil_warn and kutil_warnx for the XWARN and XWARNX macros.
This removes the old kxwarn[x] functions that didn't do much and did it poorly
at that.  This shouldn't affect any callers unless they depend on backend logging
formats, which is undocumented anyway.
2020-07-14 11:23:47 +00:00
kristapsdz 9726880e6f Fix minor scan-build nits. 2018-09-28 14:28:36 +00:00
kristapsdz c7f1fe9c6d Catch SIGPIPE when writing to a closable descriptor. 2018-04-09 19:28:08 +00:00
kristapsdz 60e0eba3a6 Have writing function return kcgi_err. 2018-03-25 05:41:58 +00:00
kristapsdz f8b635b612 Convert fcgi_write() to have an error on failure. Document the return value
of a function in wrappers.c.
2018-01-03 11:25:51 +00:00
kristapsdz 913a5dda60 Don't specify -1 on asprintf's error and make sure that the returned pointer
is set to NULL on failure.  Extending a patch by schwarze@, thanks!
2018-01-02 10:03:52 +00:00
kristapsdz f82a909568 As patched by schwarze@: we always should set "er" on failure. 2017-11-19 04:33:38 +00:00
kristapsdz 83733174fe The fullwrite function should never have a NULL buffer. Make it so! By schwarze@---thanks! 2017-11-19 04:31:47 +00:00
kristapsdz b37ee382c9 Replace nil -> NUL as noted by schwarze@---thanks! 2017-11-19 01:16:58 +00:00
kristapsdz 685abdeced Full switch to oconfigure instead of current system, so remove all of the
test and compat files.  These are now in tests.c and compats.c, and driven
by the configure script.   Also remove the MD5 code, which is part of
compats.c.  Lastly, move ifdefs to ifs, remove defined (same), and also
remove HAVE_CONFIG_H.
2017-10-18 21:36:59 +00:00
kristapsdz 041ba58542 Use fullwriteword() instead of a fullwrite() dance, as suggested by schwarze@.
While here, also improve the documentation for the output() function and also
fullwriteword() itself.
2017-10-18 20:03:19 +00:00
kristapsdz 4245828e41 Document behaviour. 2017-10-16 23:56:05 +00:00
kristapsdz 88e6852a3f Be even more explicit. From a suggestion by schwarze@---thanks! 2017-10-16 22:31:46 +00:00
kristapsdz 271c209daf Add a fullreadword() that has a size parameter. 2017-10-16 22:29:18 +00:00
kristapsdz 523e991eea Note that internal functions should check for bad printables. 2017-09-21 21:14:08 +00:00
kristapsdz c6e54dbdfa Warnings if zero-length (or null) allocations occur. 2017-09-21 17:17:30 +00:00
kristapsdz 59c373e42e Copyright fixes. 2016-03-16 04:28:49 +00:00
kristapsdz 4ebb052946 Fix some no-ops found by scan-build. 2016-03-13 06:35:02 +00:00
kristapsdz 0106ebd441 Allow an extension to FastCGI indicated by an environment variable set in
application clients.  This stipulates that clients should read a file
descriptor from their control socket instead of accepting a file descriptor.
Then add a "variable pool" mode to kfcgi(8) that accepts descriptors and
passes them in the aforementioned way.  This allows for growable pools of
application clients.
2016-03-12 08:51:34 +00:00
kristapsdz 92a494a2ab Prepend all "x" functions (e.g., xmalloc) with a "k".
This avoids overriding external xmalloc() functions that are weakly declared.
Pointed out by Okan Demirmen--thanks!
2016-02-11 19:19:23 +00:00
kristapsdz 0618d1ec20 Add two coverity ignoring annotations.
These reference CID 60320, 60309.
2016-01-25 22:13:07 +00:00
kristapsdz 9f0466523d Manually cast function to void to note false positive in Coverity.
References CID 60309.
2016-01-25 20:44:10 +00:00
kristapsdz 69a53964fb This makes a false-positive found on Coverity not complain.
References CID 60312, 60311, 60310.
2016-01-25 20:40:06 +00:00
kristapsdz 7e142bb46a Add more poll(2) protection. 2015-09-05 03:14:56 +00:00
kristapsdz db7806f0ba Make sure writer doesn't spin. 2015-09-05 00:06:10 +00:00
kristapsdz ab599e7088 If the FastCGI socket is closed when responding to an HTTP request,
don't have writes just fail.
2015-09-04 21:06:39 +00:00
kristapsdz a12aabc03e Use OpenBSD's manpage as a guide for the file-descriptor receive function. 2015-08-10 22:25:44 +00:00
kristapsdz babb3fcc5c Noting more documentation. 2015-08-07 11:46:31 +00:00
kristapsdz a38c7c1e37 More control over polling and errors. 2015-08-03 21:08:25 +00:00
kristapsdz 8ae199f806 Compilation on OpenBSD. 2015-07-26 18:22:36 +00:00
kristapsdz b1da7a0fbd Initial attempt at putting control socket into a sandbox. 2015-07-19 08:52:24 +00:00
kristapsdz 361a4e7973 Adjust for compiling and running on FreeBSD. 2015-07-18 20:05:16 +00:00
kristapsdz 0e3e8157b3 Kick out kworker interface, which was getting a little awkward. 2015-07-18 09:55:21 +00:00
kristapsdz d1587fed60 Move around some code for clarity (no functional change).
Remove some unused functions.
2015-04-10 09:27:34 +00:00
kristapsdz 1c95299972 Linux workarounds. 2015-04-02 11:53:18 +00:00
kristapsdz 8fa2dd33ac Check in more FastCGI. This doesn't touch the outward-facing API and
is still in development.
2015-02-10 10:18:02 +00:00
kristapsdz fc28314971 Add initial FastCGI bits. This isn't touched [yet].
Move socketpair into its own wrapped routine.
Don't allocate setenv() bits--there's no need.
2014-12-21 00:17:04 +00:00
kristapsdz 2879027018 Wrappers for reporting errors and warnings. 2014-05-23 14:49:48 +00:00