cosmopolitan/libc/str
Justine Tunney bf03b2e64c Make major improvements to redbean and libraries
The most exciting improvement is dynamic pages will soon be able to use
the executable itself as an object store. it required a heroic technique
for overcoming ETXTBSY restrictions which lets us open the executable in
read/write mode, which means (1) wa can restore the APE header, and (2)
we can potentially containerize redbean extension code so that modules
you download for your redbean online will only impact your redbean.

Here's a list of breaking changes to redbean:

- Remove /tool/net/ prefix from magic ZIP paths
- GetHeader() now returns NIL if header is absent

Here's a list of fixes and enhancements to redbean:

- Support 64-bit ZIP archives
- Record User-Agent header in logs
- Add twelve error handlers to accept()
- Display octal st_mode on listing page
- Show ZIP file comments on listing page
- Restore APE MZ header on redbean startup
- Track request count on redbean index page
- Report server uptime on redbean index page
- Don't bind server socket using SO_REUSEPORT
- Fix #151 where Lua LoadAsset() could free twice
- Report rusage accounting when workers exit w/ -vv
- Use ZIP iattr field as text/plain vs. binary hint
- Add ParseUrl() API for parsing things like a.href
- Add ParseParams() API for parsing HTTP POST bodies
- Add IsAcceptablePath() API for checking dots, etc.
- Add IsValidHttpToken() API for validating sane ASCII
- Add IsAcceptableHostPort() for validating HOST[:PORT]
- Send 400 response to HTTP/1.1 requests without a Host
- Send 403 response if ZIP or file isn't other readable
- Add virtual hosting that tries prepending Host to path
- Route requests based on Host in Request-URI if present
- Host routing will attempt to remove or add the www. prefix
- Sign-extend UNIX timestamps and don't adjust FileTime zone

Here's some of the improvements made to Cosmopolitan Libc:

- Fix ape.S indentation
- Improve consts.sh magnums
- Write pretty good URL parser
- Improve rusage accounting apis
- Bring mremap() closer to working
- Added ZIP APIs which will change
- Check for overflow in reallocarray()
- Remove overly fancy linkage in strerror()
- Fix GDB attach on crash w/ OpenBSD msyscall()
- Make sigqueue() portable to most UNIX distros
- Make integer serialization macros more elegant
- Bring back 34x tprecode8to16() performance boost
- Make malloc() more resilient to absurdly large sizes
2021-04-18 12:34:15 -07:00
..
a64l.c Add base64 support 2021-03-27 18:17:54 -07:00
bcmp.c Implement getcwd() for XNU 2021-01-30 08:54:12 -08:00
bcopy.c Change license 2020-12-27 17:18:44 -08:00
bsf.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
bsfl.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
bsfll.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
bsr.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
bsrl.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
bsrll.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
btowc.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
c16rtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
c32rtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
chomp.c Fix XNU / FreeBSD / OpenBSD / RHEL5 / NT bugs 2021-01-25 18:31:17 -08:00
chomp16.c Change license 2020-12-27 17:18:44 -08:00
crc32.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
crc32c-pure.c Fix Clang support 2021-02-06 00:29:09 -08:00
crc32c-sse42.c Fix Clang support 2021-02-06 00:29:09 -08:00
crc32c.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
crc32z.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
djbsort.c Fix Clang support 2021-02-06 00:29:09 -08:00
endswith.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
endswith16.c Change license 2020-12-27 17:18:44 -08:00
escapedos.c Change license 2020-12-27 17:18:44 -08:00
getcachesize.c Fix Clang support 2021-02-06 00:29:09 -08:00
getutf16.ncabi.c Change license 2020-12-27 17:18:44 -08:00
getx86processormodel.c Change license 2020-12-27 17:18:44 -08:00
getzipcdir.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getzipcdiroffset.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getzipcdirrecords.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getzipcfilecompressedsize.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getzipcfilemode.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getzipcfileoffset.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getzipcfileuncompressedsize.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getziplfilecompressedsize.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
getziplfileuncompressedsize.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
hextoint.c Change license 2020-12-27 17:18:44 -08:00
highwayhash64.c Hunt down some small bugs 2020-12-24 16:01:48 -08:00
highwayhash64.h Hunt down some small bugs 2020-12-24 16:01:48 -08:00
index.c Make more functions friendly to Address Sanitizer 2021-02-02 03:45:31 -08:00
indexdoublenulstring.c Change license 2020-12-27 17:18:44 -08:00
insertionsort.greg.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
internal.h Fix Clang support 2021-02-06 00:29:09 -08:00
isalnum.c Change license 2020-12-27 17:18:44 -08:00
isalpha.c Change license 2020-12-27 17:18:44 -08:00
isascii.c Change license 2020-12-27 17:18:44 -08:00
isblank.c Change license 2020-12-27 17:18:44 -08:00
iscntrl.c Change license 2020-12-27 17:18:44 -08:00
isdigit.c Change license 2020-12-27 17:18:44 -08:00
isgraph.c Change license 2020-12-27 17:18:44 -08:00
islower.c Change license 2020-12-27 17:18:44 -08:00
isprint.c Change license 2020-12-27 17:18:44 -08:00
ispunct.c Change license 2020-12-27 17:18:44 -08:00
isspace.c Change license 2020-12-27 17:18:44 -08:00
isupper.c Change license 2020-12-27 17:18:44 -08:00
iswalnum.c Change license 2020-12-27 17:18:44 -08:00
iswalpha.c Change license 2020-12-27 17:18:44 -08:00
iswblank.c Change license 2020-12-27 17:18:44 -08:00
iswcntrl.c Change license 2020-12-27 17:18:44 -08:00
iswctype.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
iswdigit.c Change license 2020-12-27 17:18:44 -08:00
iswgraph.c Change license 2020-12-27 17:18:44 -08:00
iswlower.c Change license 2020-12-27 17:18:44 -08:00
iswprint.c Change license 2020-12-27 17:18:44 -08:00
iswpunct.c Change license 2020-12-27 17:18:44 -08:00
iswspace.c Change license 2020-12-27 17:18:44 -08:00
iswupper.c Change license 2020-12-27 17:18:44 -08:00
iswxdigit.c Change license 2020-12-27 17:18:44 -08:00
isxdigit.c Change license 2020-12-27 17:18:44 -08:00
iszipcdir32.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
iszipcdir64.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
kx86processormodels.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
l64a.c Add base64 support 2021-03-27 18:17:54 -07:00
lz4check.c Change license 2020-12-27 17:18:44 -08:00
lz4cpy.c Make ANSI mode closer to being ANSI 2021-02-03 17:14:17 -08:00
lz4decode.c Change license 2020-12-27 17:18:44 -08:00
mb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mb.internal.h Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mblen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrlen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtoc16.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtoc32.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbrtowc.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsinit.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsnrtowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbsrtowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbstowcs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
mbtowc.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
memcasecmp.c Support POST parameters in redbean server pages 2021-03-27 07:29:55 -07:00
memccpy.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
memchr.c Make more functions friendly to Address Sanitizer 2021-02-02 03:45:31 -08:00
memcmp.c Change license 2020-12-27 17:18:44 -08:00
memfrob.c Change license 2020-12-27 17:18:44 -08:00
memmem.c Apply some touchups 2021-02-07 07:02:46 -08:00
memmove-pure.c Fix Clang support 2021-02-06 00:29:09 -08:00
memset-pure.c Fix Clang support 2021-02-06 00:29:09 -08:00
memset16.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
oldutf16.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
pututf16.ncabi.c Implement more security stuff 2021-02-02 20:21:06 -08:00
rawmemchr.c Implement more security stuff 2021-02-02 20:21:06 -08:00
rindex.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
startswith.c Change license 2020-12-27 17:18:44 -08:00
startswith16.c Change license 2020-12-27 17:18:44 -08:00
stpcpy.c Fix Clang support 2021-02-06 00:29:09 -08:00
stpncpy.c Change license 2020-12-27 17:18:44 -08:00
str.h Support POST parameters in redbean server pages 2021-03-27 07:29:55 -07:00
str.mk Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
strcasecmp.c Change license 2020-12-27 17:18:44 -08:00
strcasecmp8to16.c Change license 2020-12-27 17:18:44 -08:00
strcasecmp16.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strcat.c Fix XNU / FreeBSD / OpenBSD / RHEL5 / NT bugs 2021-01-25 18:31:17 -08:00
strcat16.c Support dirfd relative iops on Windows 2021-01-30 01:49:43 -08:00
strchr.c Fix Clang support 2021-02-06 00:29:09 -08:00
strchrnul.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strclen.c Change license 2020-12-27 17:18:44 -08:00
strclen16.c Change license 2020-12-27 17:18:44 -08:00
strcmp.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strcmp8to16.c Change license 2020-12-27 17:18:44 -08:00
strcmp8to16i.internal.h Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
strcmp16.c Change license 2020-12-27 17:18:44 -08:00
strcoll.c Add more POSIX function stubs 2021-03-02 03:27:55 -08:00
strcpy.c Fix Clang support 2021-02-06 00:29:09 -08:00
strcpy16.c Implement getcwd() for XNU 2021-01-30 08:54:12 -08:00
strcspn-pure.c Fix Clang support 2021-02-06 00:29:09 -08:00
strcspn16.c Change license 2020-12-27 17:18:44 -08:00
strlcat.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
strlcpy.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
strlen-pure.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strncasecmp.c Change license 2020-12-27 17:18:44 -08:00
strncasecmp8to16.c Change license 2020-12-27 17:18:44 -08:00
strncasecmp16.c Change license 2020-12-27 17:18:44 -08:00
strncat.c Add NetBSD support 2021-02-05 06:19:45 -08:00
strncmp.c Change license 2020-12-27 17:18:44 -08:00
strncmp8to16.c Change license 2020-12-27 17:18:44 -08:00
strncmp16.c Change license 2020-12-27 17:18:44 -08:00
strncpy.c Fix XNU / FreeBSD / OpenBSD / RHEL5 / NT bugs 2021-01-25 18:31:17 -08:00
strnlen.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
strntolower.c Change license 2020-12-27 17:18:44 -08:00
strntoupper.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strpbrk.c Change license 2020-12-27 17:18:44 -08:00
strpbrk16.c Change license 2020-12-27 17:18:44 -08:00
strrchr.c Change license 2020-12-27 17:18:44 -08:00
strrchr16.c Change license 2020-12-27 17:18:44 -08:00
strsep.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
strsignal.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
strspn.c Change license 2020-12-27 17:18:44 -08:00
strspn16.c Change license 2020-12-27 17:18:44 -08:00
strstr.c Apply some touchups 2021-02-07 07:02:46 -08:00
strstr16.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
strtok.c Change license 2020-12-27 17:18:44 -08:00
strtok_r.c Change license 2020-12-27 17:18:44 -08:00
strtolower.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strtoupper.c Implement more security stuff 2021-02-02 20:21:06 -08:00
strverscmp.c Work towards improving signals and processes 2021-01-27 19:34:02 -08:00
thompike.h Add minor improvements and cleanup 2020-10-27 03:39:46 -07:00
timingsafe_memcmp.c Add timingsafe_memcmp #13 2020-12-28 20:01:15 -08:00
tolower.c Change license 2020-12-27 17:18:44 -08:00
toupper.c Change license 2020-12-27 17:18:44 -08:00
towlower.c Change license 2020-12-27 17:18:44 -08:00
towupper.c Change license 2020-12-27 17:18:44 -08:00
tpdecode.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
tpdecode.ncabi.c Implement more security stuff 2021-02-02 20:21:06 -08:00
tpdecodecb.internal.h wip on intellisense (again) 2021-02-02 11:14:45 -05:00
tpenc.h Implement more security stuff 2021-02-02 20:21:06 -08:00
tpenc.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
tpencode.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
tpencode.ncabi.c Change license 2020-12-27 17:18:44 -08:00
tprecode8to16.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
tprecode16to8.c Fix Clang support 2021-02-06 00:29:09 -08:00
undeflate.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
undeflate.h Initial import 2020-06-15 07:18:57 -07:00
utf16.h Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00
wchomp.c Change license 2020-12-27 17:18:44 -08:00
wcrtomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcscasecmp.c Change license 2020-12-27 17:18:44 -08:00
wcscat.c Implement getcwd() for XNU 2021-01-30 08:54:12 -08:00
wcscmp.c Change license 2020-12-27 17:18:44 -08:00
wcscpy.c Implement getcwd() for XNU 2021-01-30 08:54:12 -08:00
wcscspn.c Change license 2020-12-27 17:18:44 -08:00
wcsendswith.c Change license 2020-12-27 17:18:44 -08:00
wcslen.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcsncasecmp.c Change license 2020-12-27 17:18:44 -08:00
wcsncmp.c Change license 2020-12-27 17:18:44 -08:00
wcsncpy.c Change license 2020-12-27 17:18:44 -08:00
wcsnrtombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcspbrk.c Change license 2020-12-27 17:18:44 -08:00
wcsrchr.c Change license 2020-12-27 17:18:44 -08:00
wcsrtombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wcsspn.c Change license 2020-12-27 17:18:44 -08:00
wcsstartswith.c Change license 2020-12-27 17:18:44 -08:00
wcstombs.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wctob.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wctomb.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wmemcpy.c Change license 2020-12-27 17:18:44 -08:00
wmemmove.c Change license 2020-12-27 17:18:44 -08:00
wmempcpy.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
wmemset.c Add Musl multibyte functions 2021-03-06 09:53:16 -08:00
zipfindcentraldir.c Make major improvements to redbean and libraries 2021-04-18 12:34:15 -07:00