cosmopolitan/net/http
Justine Tunney 00611e9b06 Improve ZIP filesystem and change its prefix
The ZIP filesystem has a breaking change. You now need to use /zip/ to
open() / opendir() / etc. assets within the ZIP structure of your APE
binary, instead of the previous convention of using zip: or zip! URIs.
This is needed because Python likes to use absolute paths, and having
ZIP paths encoded like URIs simply broke too many things.

Many more system calls have been updated to be able to operate on ZIP
files and file descriptors. In particular fcntl() and ioctl() since
Python would do things like ask if a ZIP file is a terminal and get
confused when the old implementation mistakenly said yes, because the
fastest way to guarantee native file descriptors is to dup(2). This
change also improves the async signal safety of zipos and ensures it
doesn't maintain any open file descriptors beyond that which the user
has opened.

This change makes a lot of progress towards adding magic numbers that
are specific to platforms other than Linux. The philosophy here is that,
if you use an operating system like FreeBSD, then you should be able to
take advantage of FreeBSD exclusive features, even if we don't polyfill
them on other platforms. For example, you can now open() a file with the
O_VERIFY flag. If your program runs on other platforms, then Cosmo will
automatically set O_VERIFY to zero. This lets you safely use it without
the need for #ifdef or ifstatements which detract from readability.

One of the blindspots of the ASAN memory hardening we use to offer Rust
like assurances has always been that memory passed to the kernel via
system calls (e.g. writev) can't be checked automatically since the
kernel wasn't built with MODE=asan. This change makes more progress
ensuring that each system call will verify the soundness of memory
before it's passed to the kernel. The code for doing these checks is
fast, particularly for buffers, where it can verify 64 bytes a cycle.

- Correct O_LOOP definition on NT
- Introduce program_executable_name
- Add ASAN guards to more system calls
- Improve termios compatibility with BSDs
- Fix bug in Windows auxiliary value encoding
- Add BSD and XNU specific errnos and open flags
- Add check to ensure build doesn't talk to internet
2021-08-22 01:11:53 -07:00
..
categorizeip.c Improve performance of printf functions 2021-04-24 13:58:50 -07:00
csscolor.h Initial import 2020-06-15 07:18:57 -07:00
decodebase64.c Add SSL to redbean 2021-06-24 13:20:50 -07:00
decodelatin1.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
encodebase64.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
encodehttpheadervalue.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
encodelatin1.c Fix redbean date header in daemonize mode 2021-05-02 11:11:26 -07:00
encodeurl.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
escape.h Fix redbean date header in daemonize mode 2021-05-02 11:11:26 -07:00
escapefragment.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapehost.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapehtml.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapeip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapejsstringliteral.c Make redbean StoreAsset() work better 2021-05-14 05:44:37 -07:00
escapeparam.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapepass.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapepath.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapesegment.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapeurl.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
escapeurlview.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
escapeuser.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
findcontenttype.c Make improvements to redbean 2021-07-08 15:56:23 -07:00
formathttpdatetime.c Make redbean tinier 2021-07-04 12:26:54 -07:00
gethttpheader.c Change license 2020-12-27 17:18:44 -08:00
gethttpheader.gperf Add chunked transfer decoding to redbean 2021-07-05 01:05:10 -07:00
gethttpheader.inc Add SNI support to redbean and improve SSL perf 2021-07-23 13:56:13 -07:00
gethttpheadername.c Add chunked transfer decoding to redbean 2021-07-05 01:05:10 -07:00
gethttpmethod.c Accept table arg in redbean Fetch() API (#218) 2021-07-28 09:33:10 -07:00
gethttpmethod.gperf Have redbean show zip listing as default / handler 2021-03-29 01:22:49 -07:00
gethttpmethod.inc Improve performance of printf functions 2021-04-24 13:58:50 -07:00
gethttpreason.c Reduce number of disk seeks in redbean 2021-05-03 01:21:50 -07:00
getipcategoryname.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
hascontrolcodes.c Reduce number of disk seeks in redbean 2021-05-03 01:21:50 -07:00
headerhassubstring.c Merge HTTP request / response parsing code 2021-06-27 17:04:32 -07:00
http.h Make improvements to redbean 2021-07-08 15:56:23 -07:00
http.mk Add HTTP/HTTPS Fetch() API to redbean 2021-07-07 21:44:27 -07:00
indentlines.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
ip.h Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isacceptablehost.c Add HTTP/HTTPS Fetch() API to redbean 2021-07-07 21:44:27 -07:00
isacceptablepath.c Fix redbean date header in daemonize mode 2021-05-02 11:11:26 -07:00
isacceptableport.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
isafrinicip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isanonymousip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isapnicip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isarinip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isdodip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
islacnicip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isloopbackip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
ismimetype.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
ismulticastip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isprivateip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isreasonablepath.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isripeip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
istestnetip.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
isvalidhttptoken.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
kescapeauthority.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
kescapefragment.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
kescapeip.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
kescapeparam.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
kescapepath.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
kescapesegment.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
khextoint.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
khttpmethod.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
khttprepeatable.c Add chunked transfer decoding to redbean 2021-07-05 01:05:10 -07:00
khttptoken.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
parsecontentlength.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
parseforwarded.c Make port optional in X-Forwarded-For 2021-06-15 06:46:30 -07:00
parsehttpdatetime.c Change license 2020-12-27 17:18:44 -08:00
parsehttpmessage.c Add chunked transfer decoding to redbean 2021-07-05 01:05:10 -07:00
parsehttprange.c Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
parseip.c Add SNI support to redbean and improve SSL perf 2021-07-23 13:56:13 -07:00
parseurl.c Make trivial code size enhancements 2021-05-16 18:22:39 -07:00
unchunk.c Add HTTP/HTTPS Fetch() API to redbean 2021-07-07 21:44:27 -07:00
underlong.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00
url.h Make more major improvements to redbean 2021-04-20 19:14:21 -07:00
visualizecontrolcodes.c Add /statusz page to redbean plus other enhancements 2021-04-23 18:53:57 -07:00