Commit Graph

  • fb807d8377 Be more specific about return values, use tables, and specifically note that 2tms is for struct tm. kristapsdz 2020-05-10 16:25:05 +00:00
  • 1b0fab4eaf Enable new regression test. kristapsdz 2020-05-10 16:24:41 +00:00
  • 11e21bfa61 Add simple regression for khttp_epoch2datetime. kristapsdz 2020-05-10 16:24:21 +00:00
  • c803276c92 Don't use "struct tm" conventions for this function. kristapsdz 2020-05-10 16:23:35 +00:00
  • 6f97345c5b Be completely explicit with exactly which date and time values are possible. This is prevent any and all confusion that's rife in mktime() and family. kristapsdz 2020-05-10 15:21:00 +00:00
  • 2bacfb3e4d Switch completely to using int64_t internally, with only khttp_epoch2tms being the only non-int64_t version. This catches corner cases where int-valued years will overflow. While here, don't using the internal mktime-style conversion code, instead preventing input values from having bad components. kristapsdz 2020-05-10 15:20:04 +00:00
  • 7b52236d6a For 32-bit time_t, don't assign to "v", which will wrap the 64-bit tests. kristapsdz 2020-05-10 09:19:34 +00:00
  • 1b4efc5e13 Don't use strftime at all, which doesn't handle 5-digit years on Solaris. kristapsdz 2020-05-10 09:07:53 +00:00
  • 7ad85de7b2 Update manpages to mention UB for dates with year beyond INT_{MIN,MAX}. Also add regression tests for inputs beyond INT_{MIN,MAX} and >4 digit years. kristapsdz 2020-05-10 08:45:17 +00:00
  • ea143bc850 timegm can legit return error here, so ignore it. kristapsdz 2020-05-06 22:18:20 +00:00
  • 74f95d783e Have the date2epoch check use native time for its tests more intelligently to avoid casting between int64_t and time_t. kristapsdz 2020-05-06 22:08:49 +00:00
  • 9ef6206e23 Don't use time_t at all, as it will convert from the 64 bits for non-64 bit time machines. kristapsdz 2020-05-06 21:56:05 +00:00
  • 16cdd3710c Use newlib's gmtime as well. This accepts 64-bit time values unlike Solaris, which still has 32-bit time, and some Linux. This allows kcgi to be totally 64-bit time friendly. kristapsdz 2020-05-06 19:17:30 +00:00
  • 9bcd5fb595 INT_MAX is in limits.h, not sys/param.h. kristapsdz 2020-05-06 17:32:09 +00:00
  • 5e28bbe0ac Code docs and tweak release notes. kristapsdz 2020-05-06 13:39:16 +00:00
  • a866b92bcd Add some more tests. kristapsdz 2020-05-06 13:36:07 +00:00
  • 69f195c684 Use an internal mktime/timegm based upon newlib's code. This is because FreeBSD doesn't handle year values before 1900, which is ridiculous, so a portable version is necessary. kristapsdz 2020-05-06 13:26:33 +00:00
  • c7712dfd5c Add version notes and get ready for bump. kristapsdz 2020-05-05 13:29:30 +00:00
  • c217fbba0f Switch manpage to reference renamed functions. kristapsdz 2020-05-05 13:03:27 +00:00
  • 6a4da3bde8 Provide safer, more meaningful datetime conversion functions. These use timegm(3) as the underlying mechanism instead of relying on hand-rolled functions. They improve upon timegm(3) in not having ambiguous return values. Also add regression tests for all new functions. kristapsdz 2020-05-05 10:26:55 +00:00
  • fb957bb5b9 Prevent version clobbering. kristapsdz 2020-04-24 17:36:18 +00:00
  • 1dc434a259 Keep running version notes. kristapsdz 2020-04-24 14:05:13 +00:00
  • a91b35d58f Note deprecation. kristapsdz 2020-04-24 14:02:48 +00:00
  • b19ef60157 Split kutil_epoch2str manpage into its new functional parts. kristapsdz 2020-04-24 14:01:29 +00:00
  • 58e2e73fa5 Add test for KHTTP_EPOCH2TM. kristapsdz 2020-04-24 12:48:41 +00:00
  • ff869b7beb Write tests for new functions khttp_epoch2xxx, move existing tests to deprecated test file. kristapsdz 2020-04-24 12:43:13 +00:00
  • 35d192dfec Reconstitute kutil_epoch2str, kutil_epoch2utcstr, kutil_epoch2tmvals, and KUTIL_EPOCH2TM as khttp_epoch2str, khttp_epoch2ustr, khttp_epoch2tms, and KHTTP_EPOCH2TM, respectively. Internally, these now use gmtime() instead of the legacy hand-rolled system. They cover a significantly broader range of time (including negative time values), properly truncate strings in the the 2str and 2ustr case, and properly handle NULL or zero-length input. kristapsdz 2020-04-24 12:40:29 +00:00
  • f63261d2e5 Arguments to the deprecated attribute aren't supported in all compilers and cause failure. Reported by jturner@ via stsp@, thank you both! kristapsdz 2020-04-16 11:59:43 +00:00
  • 3afedcfe89 Have deprecation warning produce an informative message too. kristapsdz 2020-04-10 12:58:29 +00:00
  • cd29a98a43 Version notes. kristapsdz 2020-04-10 12:54:46 +00:00
  • 6bd4670fcf Remove unused. kristapsdz 2020-04-10 12:54:36 +00:00
  • 56e8517e16 Version notes. kristapsdz 2020-04-10 11:53:36 +00:00
  • dba9422e8a Document new khttp_urldecode family, throwing away old manpage entirely. Add new urldecode regression test, which is basically just a copy of the old. kristapsdz 2020-04-10 11:53:23 +00:00
  • 8184cb35cd Deprecate kutil_urldecode and kutil_urldecode_inplace for khttp equivalents. These are the same except they handle a NULL dst properly. kristapsdz 2020-04-10 11:51:07 +00:00
  • 5850c23e8f Check for both lowercase and uppercase encoding styles. Add some strings. kristapsdz 2020-04-10 10:58:07 +00:00
  • dd66c6b720 Update documentation about URL encoding query string values and add khttp_urlencode page, removing the legacy version from kutil_urlencode. kristapsdz 2020-04-10 10:33:13 +00:00
  • 85aeac0dac Add tests for NULL/empty string query string value behaviour. kristapsdz 2020-04-10 10:28:21 +00:00
  • aa961a734d Re-name kutil_urlencode to khttp_urlencode, the only difference being handling of NULL values (return now as empty strings instead of ambiguously erroring out). This flushed out some errors in the regression suite with invalid parameters. Add regression test with fuller testing. kristapsdz 2020-04-10 10:24:39 +00:00
  • 4b26ccbf47 Add to version notes. kristapsdz 2020-04-09 16:22:43 +00:00
  • be8b65885e Polish. kristapsdz 2020-04-09 16:22:28 +00:00
  • b430c1e084 Add examples (and verify they work). kristapsdz 2020-04-09 16:22:12 +00:00
  • ebcf3eb591 Fix mdoc syntax. kristapsdz 2020-04-09 11:03:24 +00:00
  • a7dd2aebf2 Removed kutil_urlabs reference. kristapsdz 2020-04-09 11:01:30 +00:00
  • f137e80063 Note vararg type width. kristapsdz 2020-04-09 11:01:13 +00:00
  • dde4492390 Add manpage and regression test for khttp_urlabs. kristapsdz 2020-04-09 11:00:45 +00:00
  • f7130d4b3e Break out query string formatter for urlpart/urlabs. Add khttp_urlabs, which replaces kutil_urlabs but is significantly more robust. kristapsdz 2020-04-09 11:00:05 +00:00
  • 98e8c87717 Bump version. kristapsdz 2020-04-08 22:02:39 +00:00
  • 973cad1e86 Add version notes. kristapsdz 2020-04-08 21:05:29 +00:00
  • 84f9eee442 Newest oconfigure. kristapsdz 2020-04-08 21:01:13 +00:00
  • 017fa8f236 Polish. kristapsdz 2020-04-08 20:55:56 +00:00
  • ef353ea094 Add new manpage. kristapsdz 2020-04-08 13:50:33 +00:00
  • c39828615b Add renamed khttp_urlpart and family, which in form is like kutil_urlpart except without the "struct kreq". It also adds khttp_vurlpart et al., which exposes the va_list interface. kristapsdz 2020-04-08 13:31:16 +00:00
  • 7d36f7dfe2 Add regression tests for backing out nonexisting scopes. kristapsdz 2020-03-27 22:17:10 +00:00
  • f7ebff758c Docu. kristapsdz 2020-03-27 22:14:15 +00:00
  • b0b5e2e801 Have khtml_puts() not bail on NULL value and regress test it. kristapsdz 2020-03-27 22:02:17 +00:00
  • 9f4636cff4 Add regression test for void/instruction elements. kristapsdz 2020-03-27 21:54:03 +00:00
  • 8f5f67bcd3 This is no longer true. kristapsdz 2020-03-27 21:26:37 +00:00
  • 3651fd33d7 Mention KCGI_ENOMEM usage. kristapsdz 2020-03-27 21:26:12 +00:00
  • fed1075eaf style(9). kristapsdz 2020-03-27 21:25:20 +00:00
  • f6cd493ab9 Recover from errors in khtml_attr functions enough to close the variable argument context. Rename KDATA_MAXELEMSZ for consistency. style(9). kristapsdz 2020-03-27 21:19:03 +00:00
  • b5ccfd9c21 Fix function prototype. kristapsdz 2020-03-27 21:01:37 +00:00
  • 66d7b3f7c4 Break apart kcgixml into each function having its own manpage. kristapsdz 2020-03-27 20:59:25 +00:00
  • b7fe7a94a7 Use KCGI_ENOMEM instead of KCGI_WRITER on stack exhaustion. kristapsdz 2020-03-27 20:38:01 +00:00
  • 311137d50e Apparently a broken file slipped in... fixed. kristapsdz 2020-03-27 20:27:25 +00:00
  • 36e6cdcddf When reaching the hard-coded limit to JSON scope stack size, return ENOMEM instead of aborting. kristapsdz 2020-03-27 20:19:54 +00:00
  • 719decfc86 Don't abort on maximum number of JSON stacks: return ENOMEM. Eventually this will need to be re-written to be expandable. kristapsdz 2020-03-27 20:18:53 +00:00
  • 9b7f5c4f70 Make sure "elem" values are valid element indices, allow NULL strings for put-style functions, use KCGI_WRITER instead of KCGI_FORM. Also style(9). kristapsdz 2020-03-27 20:13:20 +00:00
  • f8b8d0aa8a Sort title. kristapsdz 2020-03-27 11:46:25 +00:00
  • 059ea21e6f Bump date. kristapsdz 2020-03-27 11:38:39 +00:00
  • dad766870f Emit all manpages as a grid in the main page. kristapsdz 2020-03-27 11:36:51 +00:00
  • 5356ccb0df Version notes. kristapsdz 2020-03-27 11:20:08 +00:00
  • 592f523b8a Use abort() instead of assert(). kristapsdz 2020-03-27 11:08:01 +00:00
  • 0af3d9a67d Handle more corner cases. kristapsdz 2020-03-27 10:58:35 +00:00
  • 5c0424ef75 style(9) kristapsdz 2020-03-27 10:58:25 +00:00
  • 747fa86fa4 Typoe, KCGI_WRITE -> KCGI_WRITER. kristapsdz 2020-03-27 10:58:02 +00:00
  • 89efbe6e4a Install new split-out kcgijson manpages. kristapsdz 2020-03-27 10:57:17 +00:00
  • 3a13479c73 Add split-out kcgijson functions. kristapsdz 2020-03-27 10:56:54 +00:00
  • 5e64dc2c4b Use style(9). Change KCGI_FORM -> KCGI_WRITER. Make NULL values for string pointers to string writers be a noop. kristapsdz 2020-03-27 10:19:17 +00:00
  • d1dbe9c066 Add a new error value, KCGI_WRITER, for when the writing functions have syntactic errors (e.g., a JSON named object opened in an array context). These were earlier KCGI_FORM, but this error code already has different meaning. kristapsdz 2020-03-27 10:12:00 +00:00
  • ffabb76c8a Version notes. kristapsdz 2020-03-26 10:12:23 +00:00
  • fc1db72f16 Add test for disabled HTML failure and make simple HTML test more interesting. kristapsdz 2020-03-26 10:10:26 +00:00
  • 672da95138 Fix typo. kristapsdz 2020-03-26 09:55:36 +00:00
  • bde37b6271 If kcgi_writer_get is going to bail, don't use assert(), which can be masked. Instead use abort() and print a message prior. kristapsdz 2020-03-26 09:53:51 +00:00
  • 45c5baba4c Split kcgihtml(3) into its functions. kristapsdz 2020-03-26 09:50:04 +00:00
  • 1e33995ff3 Fix a bug where khtml_closeto would close all scopes if given the current scope as a savepoint. This is obviously not intended. kristapsdz 2020-03-26 00:02:02 +00:00
  • f46341e03b If given a stack depth greater than the current depth, simply do nothing instead of returning a KCGI_FORM, which is indicative of other, more serious errors. kristapsdz 2020-03-25 23:19:54 +00:00
  • d4d3c1fb01 const-ify the khtmlreq passing into khtml_elemat. kristapsdz 2020-03-25 22:47:07 +00:00
  • 2404214cc2 API change: update entity value from 16 to 32 bits. Modern unicode can go up to 150 000 or so. kristapsdz 2020-03-25 22:11:39 +00:00
  • 4dc8865581 Have a NULL buffer passed to khtml_write be a noop, just like khttp_write. kristapsdz 2020-03-25 22:05:06 +00:00
  • 6364df8f8c Merge support for khtml_printf provided by Tracey Emery, thanks! Patch tweaked for correct manpage invocation. Merging a simple HTML test at the same time. kristapsdz 2020-03-25 20:49:42 +00:00
  • 253f80636d Use newest oconfigure for endian tests (not used, though). kristapsdz 2020-03-23 10:19:38 +00:00
  • 34616a5f4b Zlib is now required. kristapsdz 2020-03-23 00:21:52 +00:00
  • 4da685db99 Remove all other instances of LDADD_ZLIB. kristapsdz 2020-03-22 23:26:37 +00:00
  • 4e4560481b oconfigure deprecating zlib check for pkg-config instead. kristapsdz 2020-03-22 23:08:16 +00:00
  • d8ccb5b871 Use oconfigure to automatically set whether -static is supported. kristapsdz 2020-03-22 21:29:47 +00:00
  • c5f5e47029 Remove minci.cfg: it's a stupid idea. kristapsdz 2020-03-22 20:23:44 +00:00
  • fa6705ec07 Hot-fix: type name. kristapsdz 2020-03-22 12:54:42 +00:00
  • 38848134a4 Quick-release with these small changes in place. kristapsdz 2020-03-22 12:50:03 +00:00
  • 93aac1eefc Clarify what happens if buffers are NULL or zero-sized. Add regression tests to test behaviour. kristapsdz 2020-03-22 12:46:24 +00:00
  • 6275866d30 Cast for compiler warning. kristapsdz 2020-03-22 11:02:41 +00:00