Commit Graph

  • f48819bb61 Proper return values for kjson_check. kristapsdz 2018-01-15 13:19:26 +00:00
  • adf02db341 Fix for kjson_write. kristapsdz 2018-01-15 12:38:09 +00:00
  • 4120fa26ff Merge https://github.com/kristapsdz/kcgi/pull/24 --- thanks! kristapsdz 2018-01-15 09:19:46 +00:00
  • 6a1cb5c61c Note UTF requirement on strings. kristapsdz 2018-01-14 09:13:43 +00:00
  • 5142251aad Unify writing function and properly handle control characters as noted by schwarze@---thanks! kristapsdz 2018-01-14 09:13:26 +00:00
  • 0ea1fa13a0 Add manpage. kristapsdz 2018-01-14 08:52:29 +00:00
  • 19991a3809 Reflect standard and denormal number handling. kristapsdz 2018-01-14 05:21:31 +00:00
  • 3302d154f6 Allow subnormals as mentioned by schwarze@, thanks! kristapsdz 2018-01-14 05:08:03 +00:00
  • faa8abef61 Reflect new language in kcgijson(3). kristapsdz 2018-01-14 04:58:31 +00:00
  • c61040559b Merge doc clarifications by schwarze@, thanks! kristapsdz 2018-01-14 04:50:26 +00:00
  • 2d09098f52 Add an example, note refs in SEE ALSO, and note that kjson_open and kjson_close can be called at any time. kristapsdz 2018-01-14 04:44:59 +00:00
  • ad979c68a1 Document writer-disable interface. kristapsdz 2018-01-14 04:02:46 +00:00
  • 9f6e417ce7 Make writer-disable interface public. kristapsdz 2018-01-14 04:02:33 +00:00
  • 80b364434b Make sure to free writer memory on close. kristapsdz 2018-01-13 10:25:44 +00:00
  • 7c2b85715a Add kxml_prologue. kristapsdz 2018-01-12 14:42:29 +00:00
  • 895ac2ec06 Account for new return value. kristapsdz 2018-01-12 14:40:47 +00:00
  • c4bcf78f0a Return an error code from kjson_open and use kcgi_writer interface. kristapsdz 2018-01-12 14:37:11 +00:00
  • 3b3ee18d28 Have a return code from khtml_open and use kcgi_writer. kristapsdz 2018-01-12 14:36:22 +00:00
  • d56601e1e7 Split prologue-output into kxml_prologue() to allow calling kxml_open at any time. Use the new kcgi_writer interface. kristapsdz 2018-01-12 14:34:02 +00:00
  • 26a47a926e Introduce an API for controlling output. Such a mechanism was suggested by schwarze@ as part of an on-going audit. This API sets the basis for controlling the write behaviour of front-end APIs like kcgijson. It is still being developed. The theory is that front-end APIs are allocated, then further front-ends disabled from allocation, restricting output to a given format. The original khttp_write and friends are to be deprecated in favour of a raw-mode output frontend. kristapsdz 2018-01-12 14:27:57 +00:00
  • 3c80d0229d Copyright. kristapsdz 2018-01-11 05:57:49 +00:00
  • b94204df19 Document the necessity of kxxxx_close, which must disable further output. Also document kcgihtml's return codes. kristapsdz 2018-01-11 05:47:05 +00:00
  • db8e4f310a Remove long-deprecated function. kristapsdz 2018-01-11 04:39:17 +00:00
  • c48efacb6e Use kcgi_err return codes. kristapsdz 2018-01-11 04:38:11 +00:00
  • 31e4fd66aa Make (temporary?) nesting limit not be a magic number and document the interface. kristapsdz 2018-01-10 12:02:50 +00:00
  • 8de367c299 Convert to using kcgi_err. kristapsdz 2018-01-10 11:47:37 +00:00
  • 1cf90c7df1 Re-order assertion on stack size as noted by schwarze@, thanks! Also make the stack size a cpp variable. kristapsdz 2018-01-10 05:30:34 +00:00
  • c98074d2b9 As seen by schwarze@: non-normal (inf/nan) numbers may cause syntax errors in JSON output. Check against them. kristapsdz 2018-01-10 05:20:58 +00:00
  • f84d9bad8c Clean up check function as suggested by schwarze@ and add documentation. kristapsdz 2018-01-10 05:03:10 +00:00
  • e1b9971eb7 Identify kjson_close as being a convenience function. kristapsdz 2018-01-10 04:32:23 +00:00
  • 5851c30604 Complete migrating kcgijson to using kcgi_err. kristapsdz 2018-01-10 04:27:25 +00:00
  • fb7b8d99ad Almost finished converting to enum kcgi_err. kristapsdz 2018-01-09 13:14:23 +00:00
  • c2cd2e6f80 Adding atom feed. kristapsdz 2018-01-09 13:06:08 +00:00
  • 6a3e7bc11e Migrating more functions to enum kcgi_err. kristapsdz 2018-01-09 12:51:05 +00:00
  • 55193929f1 Integers and booleans (error passing). kristapsdz 2018-01-09 06:36:36 +00:00
  • 89285c37e7 Migration of JSON double formatting. kristapsdz 2018-01-09 06:33:17 +00:00
  • 0d8554de03 Convert internal checking function and the object-print functions to kcgi_err. kristapsdz 2018-01-09 05:57:24 +00:00
  • fc6460f714 Have internal writing function propogate write errors. For now not used by the non-internal functions. kristapsdz 2018-01-04 16:29:39 +00:00
  • 09fc01e8c6 Failing validation causes the type to be unset and its parsed value cleared. Suggested by schwarze@, thanks! kristapsdz 2018-01-04 16:14:03 +00:00
  • fbaa7a6b6f Add validation of doubles to regression test. kristapsdz 2018-01-04 10:34:28 +00:00
  • 6428a69118 Double validation: first, don't let underflow through. Second, save errno and restore on success. Third, properly trim() string to prevent ending whitespace from invalidation. Remove superfluous check for empty string and re-add it for the trimmed version. Most of this in a suggestion by schwarze@, thanks! (Also add a small one-liner for easier reading of udouble, also by schwarze@.) kristapsdz 2018-01-04 10:32:03 +00:00
  • 608ca5e3b5 Add note. kristapsdz 2018-01-04 09:13:44 +00:00
  • e08ec87636 Finesse khttp_body_compress and make it more meaningful. Leave auto-compression to khttp_body. kristapsdz 2018-01-04 09:05:49 +00:00
  • b93b20a635 Document new return value. kristapsdz 2018-01-04 08:14:11 +00:00
  • c9a9279fae Remove check for return code. kristapsdz 2018-01-04 08:13:40 +00:00
  • caca6afb60 Convert khttp_body() to return a proper error code. kristapsdz 2018-01-04 08:08:07 +00:00
  • 4927630b60 Convert kdata_body to return a success code. kristapsdz 2018-01-04 05:41:43 +00:00
  • 9c5420f9ea Lift the restriction on header limits in khttp_head(3) and also return a value indicating the success. kristapsdz 2018-01-04 05:12:31 +00:00
  • 4347587512 These dates are now valid. kristapsdz 2018-01-04 05:03:40 +00:00
  • be5bc1c712 Copyright year. kristapsdz 2018-01-04 05:00:32 +00:00
  • 4762be727c Specify the correct behaviour of the date conversion functions and also document the new checking functions. kristapsdz 2018-01-04 04:59:11 +00:00
  • f7d5576af6 Introduce functions for validating broken-down dates and times. kristapsdz 2018-01-04 04:57:36 +00:00
  • 3394f6fbc4 Be explicitly clear on what the kvalid_date covers. We know the leap year calculation works after the Gregorian date, so don't hedge. kristapsdz 2018-01-04 04:14:51 +00:00
  • 303be32dfc Additional month/day restrictions noted by schwarze@ and make sure that our calendar date is Gregorian. kristapsdz 2018-01-04 04:12:10 +00:00
  • 6bd9672cf6 Doc fixes from schwarze@---thanks! kristapsdz 2018-01-04 03:09:11 +00:00
  • 22d5af44d0 Have khttp_write and friends return the error condition of kdata_write. kristapsdz 2018-01-03 11:40:15 +00:00
  • e35f5905d7 Have kdata_drain() return a value. kristapsdz 2018-01-03 11:34:22 +00:00
  • 4e7f21f64f Convert kdata_flush to return an error code. kristapsdz 2018-01-03 11:31:09 +00:00
  • f8b635b612 Convert fcgi_write() to have an error on failure. Document the return value of a function in wrappers.c. kristapsdz 2018-01-03 11:25:51 +00:00
  • 61db79e5a2 Start getting the error condition of kdata_write properly exported from the function instead of being ignored. This converts the line buffer code to properly account for errors. kristapsdz 2018-01-03 10:21:00 +00:00
  • b3e9043f68 Merge a patch by schwarze@ noting the mutability of val. kristapsdz 2018-01-03 08:51:24 +00:00
  • ba53f66630 Significantly improve this manpage as mostly written by schwarze@---thanks! kristapsdz 2018-01-03 08:47:05 +00:00
  • 2b010d99e8 Test that dates via kvalid_date() are checked for correctness. Note this in the manpage. Add a regression test as well. kristapsdz 2018-01-03 08:17:11 +00:00
  • 60d65adc79 Merge simplifying patch from schwarze@---thanks! kristapsdz 2018-01-03 07:24:46 +00:00
  • 855475e1d3 Simplify trim(), from a patch by schwarze@. Thanks! kristapsdz 2018-01-02 10:54:45 +00:00
  • c802282279 Need not set value to NULL, it's done in the function. kristapsdz 2018-01-02 10:08:49 +00:00
  • 9eace120f7 Catch the situation where asprintf returns zero. kristapsdz 2018-01-02 10:06:47 +00:00
  • 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! kristapsdz 2018-01-02 10:03:52 +00:00
  • 4b59545955 Make kutil_urlpart and friends all return NULL on memory allocation failure. This is much more consistent. Noted by schwarze@, thanks! kristapsdz 2018-01-02 09:19:57 +00:00
  • 61f90d1c21 Simply function. From a patch by schwarze@---thanks! kristapsdz 2018-01-02 07:18:38 +00:00
  • f6c3a02f73 Move template functions into their own file. kristapsdz 2018-01-02 07:09:45 +00:00
  • 00e6b824e0 As suggested by schwarze@, move output functions into output.c. Thanks! kristapsdz 2018-01-02 05:14:08 +00:00
  • ee84211f7b Remove a bogus assertion as noted by schwarze@---thanks! kristapsdz 2017-12-30 14:56:21 +00:00
  • c1dada3a5d Start adding version notes so I don't forget. kristapsdz 2017-12-30 14:44:04 +00:00
  • b867fc3ff8 Simplify documentation. From a patch by schwarze@---thanks! kristapsdz 2017-12-30 08:38:09 +00:00
  • a91a6b7da4 Add more examples. kristapsdz 2017-12-30 07:57:24 +00:00
  • d364a58646 Add an example. kristapsdz 2017-12-30 06:34:03 +00:00
  • f12462cc64 Copyright date correction. kristapsdz 2017-12-30 06:33:41 +00:00
  • 82aae86845 From a patch by schwarze@ to simplify and improve khttp_body(3). Thanks! kristapsdz 2017-12-30 06:28:30 +00:00
  • d524bbea39 Small clean-ups from mandoc -Tlint. kristapsdz 2017-12-30 06:14:54 +00:00
  • 7732694bcf Convert erroneous Nm -> Fn. From a patch by schwarze@, thanks! kristapsdz 2017-12-30 06:09:59 +00:00
  • 417456b80b Use a more ordinary invocation of cookie setting that involves expiration. Also reference the HTTP standard for headers and, for the example, cookies. kristapsdz 2017-12-30 06:01:28 +00:00
  • c1654985ac Improve khttp_head(3) documentation and move kresps array from khttp_parse(3). Directly from a patch by schwarze@. Also note schwarze@ in copyright message. Thanks! kristapsdz 2017-12-30 05:50:47 +00:00
  • a61c6165fa Add some generic buffer tools. This allows me to use the template functions to write into a buffer instead of to output. (I do this all the time in child processes that send e-mails from a template.) kristapsdz 2017-12-08 05:02:10 +00:00
  • fee2b02758 Don't include <stddef.h> in documents that aren't a complete example (e.g., when requiring NULL). Patched by schwarze@---thanks! kristapsdz 2017-11-30 08:39:19 +00:00
  • 86e04e0228 Some great simplification from schwarze@---thanks! kristapsdz 2017-11-30 08:32:15 +00:00
  • 6487bbaee9 From schwarze@: set paddingLength functionally and use an appropriate NUL-padded buffer. Thanks! kristapsdz 2017-11-30 07:38:57 +00:00
  • 9f7830d083 Strip warning. kristapsdz 2017-11-29 03:44:08 +00:00
  • 3533dbdb9c URL-decoding of key vanished: re-add. kristapsdz 2017-11-29 03:43:46 +00:00
  • de301424fe Deprecate plaintext queries. kristapsdz 2017-11-21 03:07:35 +00:00
  • 1cb4caa72b 144 -> 72 line length (editing in split terminal). kristapsdz 2017-11-21 03:06:22 +00:00
  • 7d0b43d599 Add more regression to test null query values. kristapsdz 2017-11-21 03:06:00 +00:00
  • db16025520 Fix (again) empty values in urlencoded query strings. Thanks, schwarze@! kristapsdz 2017-11-21 03:04:51 +00:00
  • fdb66612cd Put check for blank subpart names after OWS syntax check as suggested by schwarze@---thanks! kristapsdz 2017-11-21 02:31:33 +00:00
  • a20e187a8d Two finds by schwarze@: clarify language regarding dropped MIME headers and move check for empty key to include obsolete syntax. While here, merge his suggestion about a shorter loop. Thanks! kristapsdz 2017-11-21 02:29:13 +00:00
  • f939411735 If the content-type is unset for multiform documents, the RFC defines it as text/plain. So do so and make sure that ctypepos is also set appropriately. Also document that any "mime" array overriding the default should include text/plain in this event. This all noted by schwarze@---thanks! kristapsdz 2017-11-21 02:13:49 +00:00
  • 35fe2ce74a Get ready for next version. kristapsdz 2017-11-20 02:59:22 +00:00
  • 6b7aadb640 As noted by schwarze@, move a shared operation out of an if-then-else cascade. Thanks! kristapsdz 2017-11-19 07:20:29 +00:00
  • ea84289eaa Don't pass untrusted input to output. Noted by schwarze@---thanks! kristapsdz 2017-11-19 05:16:31 +00:00
  • f82a909568 As patched by schwarze@: we always should set "er" on failure. kristapsdz 2017-11-19 04:33:38 +00:00