Commit graph

356 commits

Author SHA1 Message Date
Fabrizio Bertocci
662b889f81 Merge branch 'master' of https://github.com/jart/cosmopolitan into FEATURE/ioctl_SIOCGIFCONF_IPHLPAPI 2021-06-23 14:10:54 +02:00
Fabrizio Bertocci
c60de329a2 Removed debugging statements from the NT implementation of ioctl 2021-06-23 14:05:13 +02:00
Fabrizio Bertocci
b3b85c2f96 Major refactor of the Windows implementation of ioctl for SIOCGIFxxxx
methods.
2021-06-23 13:58:43 +02:00
ahgamut
4d8f884e76 Get Info-ZIP's zip to build
* removed unnecessary files (like amiga/osdep.h)
* makefile has 4 targets: zip, zipnote, zipcloak, zipsplit
* added clang-format off at the start of all source files
* added necessary headers
2021-06-22 12:38:56 -07:00
ahgamut
4ce5664c4b added zip from Info-ZIP 2021-06-22 12:38:56 -07:00
Gautham
98c53ae526
Simplify getnameinfo (#196)
The getnameinfo implementation requires an address -> name lookup on the
hosts file (ie struct HostsTxt) and the previous implementation used
flags to check whether HostsTxt was sorted according to address or name,
and then re-sorted it if necessary. Now getnameinfo lookup does not
require sorting, it does a simple linear lookup, and so the related code
was simplified

See #172 for discussion.
2021-06-22 12:35:58 -07:00
Fabrizio Bertocci
5704b03d26 Completed more functionality 2021-06-22 20:12:09 +02:00
Fabrizio Bertocci
08765c0850 Added initial implementation of SIOCGIFCONFIG, SIOCGIFADDR, SIOCGIFFLAGS 2021-06-21 23:31:20 +02:00
Fabrizio Bertocci
70828ee0ca Exported method WideCharToMultiByte to convert Windows wchar_t strings to multibyte 2021-06-21 23:30:50 +02:00
Fabrizio Bertocci
ac3ac44d06 Added LIBC_NT_IPHLPAPI to the target modules 2021-06-19 19:40:05 +02:00
Fabrizio Bertocci
933032ce81 Added STATIC_YOINK and the required dependency between sock and IPHLPAPI library 2021-06-19 19:39:38 +02:00
Justine Tunney
1f87640d17 Add half close flag to netcat example 2021-06-15 11:24:24 -07:00
Justine Tunney
e4ef38403b Make port optional in X-Forwarded-For
This parser was being overly restrictive which presented integration
issues with haproxy which doesn't make it easy to pass the port info
2021-06-15 06:46:30 -07:00
Justine Tunney
87d7010495 Improve performance of bitscanning intrinsics
This change helps spectre more intelligently plan execution, by working
around false output dependencies, impacting ops like popcnt bsr and bsf
2021-06-15 06:29:51 -07:00
Fabrizio Bertocci
b9b1e4f3b5 Attempt to get the siocgifconf_nt to work using the GetAdaptersAddresses, unsuccessful so far 2021-06-14 08:04:31 -04:00
Justine Tunney
29cb53881e Fix SQLite home directory discovery on Windows
See #193
2021-06-12 00:28:06 -07:00
Justine Tunney
8d7d00af3a Pacify file locks on Windows
This change gets redbean SQLite working in write mode on Windows.
Warnings have been added to the appropriate and responsible places.
Hacking proprietary PC systems into production-worthy servers isn't
terribly high on the list of priorities. Consider BSD or Linux when
building online systems that service requests from multiple people.

Fixes #193
2021-06-12 00:01:55 -07:00
Justine Tunney
9504ebaf7e Introduce fsum() 2021-06-11 16:49:30 -07:00
Justine Tunney
8b08e81a07 Fix build in opt mode 2021-06-11 16:47:48 -07:00
Justine Tunney
a3ccc5af1f Fix redbean hidden path bug 2021-06-10 08:55:50 -07:00
Justine Tunney
f271ffcf90 Release redbean 1.2 2021-06-10 08:14:45 -07:00
Justine Tunney
88806b79b1 Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.

We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.

Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.

Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.

If you need something that was removed, file an issue, and we'll add it.
2021-06-10 08:00:08 -07:00
Justine Tunney
eb08b9fbeb Fix redbean inappropriately linking ASAN
Fixes #188
2021-06-10 07:59:50 -07:00
Gautham
248c6d54bb
Added getnameinfo with only name lookup (#172)
Added necessary constants (DNS_TYPE_PTR, NI_NUMERICHOST etc.).
Implementation of getnameinfo is similar to getaddrinfo, with internal
functions:

* ResolveDnsReverse: performs rDNS query and parses the PTR record
* ResolveHostsReverse: reads /etc/hosts to map hostname to
  address

Earlier, the HOSTS.txt would only need to be sorted at loading time,
because the only kind of lookup was name -> address. Now since address
-> name lookups are also possible, so the HostsTxt struct, the sorting
method (and the related tests) was changed to reflect this.
2021-06-09 19:35:44 -07:00
Gautham
05350eca60
Added wcstok and wmemcmp (#183) 2021-06-09 19:34:27 -07:00
Justine Tunney
f721d61b54 Fix build to not require bash #190 2021-06-09 04:39:52 -07:00
Paul Kulchenko
cd2f984ec2
Fix lsqlite make #187 2021-06-08 14:55:30 -07:00
Paul Kulchenko
b3a08d9286 Add sqlite3 support to Lua scripts in redbean. 2021-06-05 18:38:38 -07:00
Paul Kulchenko
067c14891f Add lsqlite source (v0.9.5). 2021-06-05 18:38:38 -07:00
Fabrizio Bertocci
3929d7c726 Removed vim-folding from around function. No functional change 2021-05-23 22:13:31 -04:00
Fabrizio Bertocci
d5a839c724 Added support for SIOCGIFBRDADDR, SIOCGIFDSTADDR, SIOCGIFFLAGS 2021-05-23 16:32:40 -04:00
Fabrizio Bertocci
1b8776dea7 Fixed all the issues related to BSD for the implementation of SIGCGIFCONF, SIGCGIFADDR, and SIOCGIFNETMASK ioctls 2021-05-21 18:37:17 -04:00
dosisod
b8f38cf55d
Add ISO 646 header (#168) 2021-05-16 23:18:33 -07:00
Justine Tunney
7cbc2bc083 Cosmopolitan 1.0 2021-05-16 20:35:10 -07:00
Justine Tunney
1a3d22b2fd Improve LLVM compatibility a little bit 2021-05-16 20:34:46 -07:00
Justine Tunney
3057315a1b Make default redbean lua module path zip:.lua/...
Fixes #157
2021-05-16 19:05:35 -07:00
Justine Tunney
6a8c21269f Make trivial code size enhancements 2021-05-16 18:22:39 -07:00
Justine Tunney
b3838173ec Remove undefined behaviors 2021-05-16 11:16:28 -07:00
Justine Tunney
4864565198 Make minor improvements 2021-05-15 21:53:26 -07:00
Justine Tunney
221817e537 Further polish SQLite vendoring
- Now integrated with `make tags` for Emacs IDE features
- Delete some old deprecated broken full-text search engines
- Rename .h → .inc files that don't meet our definition of header
- Make sure every #include line is normal form so tools understand

See #162
2021-05-14 10:43:58 -07:00
Justine Tunney
690be544da Make redbean StoreAsset() work better
- Better UBSAN error messages
- POSIX Advisory Locks polyfills
- Move redbean manual to /.help.txt
- System call memory safety in ASAN mode
- Character classification now does UNICODE
2021-05-14 05:44:37 -07:00
ahgamut
919b6fec10 Get SQLite to build
* changed headers
* removed redundant declarations
* ran clang-format
* added sqlite3.mk
2021-05-14 02:40:04 -07:00
Justine Tunney
644f290035 Added sqlite-preprocessed-3350500
From https://www.sqlite.org/2021/sqlite-preprocessed-3350500.zip
2021-05-14 02:07:09 -07:00
Fabrizio Bertocci
f6388b2bf6 Added some debugging printf to troubleshoot issue for BSD 2021-05-13 08:55:10 -04:00
Fabrizio Bertocci
b08a23283d Added definition of initial ifreq_bsd containing only padding data 2021-05-13 08:54:47 -04:00
Fabrizio Bertocci
0b20b4cdf8 Removed circular dependency with the winsock library by using the weaken way to access a symbol from a higher-level library 2021-05-11 21:40:14 -04:00
Fabrizio Bertocci
1d3bb7a467 Corrected the signature of the ioctl-siocgifconf 2021-05-11 21:39:38 -04:00
Fabrizio Bertocci
8279a993d5 Added some padding in place of ifru_map to ensure ifreq structure correctly match the structure defined in Linux 2021-05-11 21:37:25 -04:00
Fabrizio Bertocci
2323b3c0e2 Removed wrong dependency with LIBC_SOCK and LIBC_NT_WS2_32 as it is causing a circular dependency 2021-05-11 21:36:35 -04:00
Dan Tocchini IV
4577f7fe11
Add MacOS toolchain instructions (#163) 2021-05-07 07:52:32 -07:00