| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
it handles side effects differently
|
|
|
|
|
| |
* line, vector, matrix -> path
* twtuni, charcategory -> twtstr
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* consistently use cint instead of FileHandle
- this was another remnant of winapi support; on posix, they are
the same.
* move "blocking" field to PosixStream
* recvFileHandle -> recvFd, sendFileHandle -> sendFd
* merge serversocket into dynstream
* merge auxiliary C functions into dynstream_aux
|
|
|
|
|
|
|
|
|
|
|
| |
nativesockets is a wrapper over posix and winapi, but we don't support
winapi, so we can just fall back to PosixStream instead.
SocketStream remains as a constraint over PosixStream to allow
sendFileHandle/recvFileHandle.
As a nice side effect, we can drop some allowed syscalls from the
seccomp filter.
|
|
|
|
|
|
|
|
|
| |
* use more PosixStream (because it has double-close checking)
* factor out some common mailcap operations
* move console from client to pager
* fix case-insensitive mime type matching
* replace convoluted fdin/fdout comparison logic (that only accidentally
worked) with a boolean flag
|
|
|
|
|
|
| |
* accept HTTP status line
* reject status codes with >3 length
* reduce pointless copying
|
|
|
|
| |
rare, but possible
|
|
|
|
|
|
|
|
|
|
| |
This finally makes it possible to use socks5 for Gemini.
Also slightly refactored the config, to make it easier to pass on the
config dir.
By the way, the known_hosts file is now stored in the config dir too.
The adapter will try to move it to there from the old location.
|
|
|
|
| |
normal construction is enough (and it wasn't really used anyway)
|
| |
|
| |
|
|
|
|
| |
also, erase cacheRef when it couldn't be opened
|
| |
|
|
|
|
|
| |
This lets us send the transparency bit as a header, and also halves the
number of header parsers in loader.
|
|
|
|
|
|
|
|
| |
I'm thinking of making libcurl entirely optional; let's start with the
easiest part.
I've added a SOCKS5 client for ALL_PROXY support; I know curl supported
others too, but whatever.
|
|
|
|
|
|
| |
* allow string values for public errors
* remove unused errors
* update naming
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
std/selectors uses OS-specific selector APIs, which sounds good in
theory (faster than poll!), but sucks for portability in practice.
Sure, you can fix portability bugs, but who knows how many there are
on untested platforms... poll is standard, so if it works on one
computer it should work on all other ones. (I hope.)
As a bonus, I rewrote the timeout API for poll, which incidentally
fixes setTimeout across forks. Also, SIGWINCH should now work on all
platforms (as we self-pipe instead of signalfd/kqueue magic).
|
|
|
|
|
|
| |
* fix broken int conversion in dynstream
* fix EPIPE handling in forkserver
* merge fdmap and connectingContainers into loader map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* refactor parseHeader
* optimize response blob()
* add direct "to cache" mode for loader requests which sets stdout to a
file, and use it for image processing
* move image resizing into a separate process
* mmap cache files in between processing steps when possible
At last, resize is no longer a part of image decoding. Also, it feels
much nicer to keep encoded image data in the same cache as everything
else.
The mmap operations *should* be more efficient than copying the whole
RGBA data through a pipe. In practice, it only makes a difference for
loading (well, now just mmapping) the encoded image into the pager,
where it singlehandedly speeds up image display by 10x on my test image.
For the other steps, the unfortunate fact that "tocache" must delay the
next fork/exec in the pipeline until the entire image is processed seems
to equal out any wins we might have gotten from skipping a single raw
RGBA copy.
I have tried moving the delay before the exec (it's possible with yet
another pipe), but it didn't help much and made the code much
uglier. (Not that tocache didn't, but I can live with this...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I thought this would work fine, but then images weren't loading. Upon
closer inspection I realized we don't necessarily let the image decoder
finish reading the entire file on pass 1 (header parsing), which means
pass 2 (decoding) can end up reading a partially downloaded cache file.
To fix this, we now fall back to streaming mode when an open handle to
the cached item still exists.
(An alternative would be to wait for the cached item to finish loading,
but that's harder to implement and might be slower anyway - the current
implementation allows for the decoder to run while an image is still
being loaded, but we couldn't do that with the second approach.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Module boundaries didn't make much sense here either. Specifically:
* loader/cgi was originally just one of the many "real" protocols
supported by loader, so it was in a separate module (like the other
ones). Now it's mostly an "internal" protocol, and it was getting
cumbersome to pass all required loader state to loadCGI.
* The loader interface has grown quite large, but there is no need for
(or advantage in) putting it in the same module as the implementation.
Now CGI is handled by loader, and the interface is in the new module
"loaderiface".
|
|
|
|
| |
directly accessing map was a bit too error prone
|
|
|
|
|
|
|
|
| |
* factor out input/output handle tables; use a seq instead
* add possibility to directly open cached items onto stdin (mainly an
optimization for reading images, which are always cached)
* close used handles on local CGI execution
* make clone during load work again
|
|
|
|
| |
select allocates. (makes sense, but I never realized...)
|
|
|
|
|
|
|
| |
pain...
(also, fix an fd leak, plus a more general bug where we registered
empty output handles.)
|
|
|
|
| |
+ be a bit more paranoid about double closes
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* stream: and passFd is now client-based, and accessible for buffers
* Bitmap's width & height is now int, not uint64
* no more non-network Bitmap special case in the pager for canvas
I just shoehorned it into the static image model, so it still doesn't
render changes after page load. But at least now it doesn't crash the
browser.
|
| |
|
|
|
|
|
|
| |
* actually download & compile modules (but don't run them yet)
* fix a bug in XHR (on some older Nim versions, move() doesn't
actually move)
|
|
|
|
|
|
|
|
|
|
| |
* add responseText, response
* add net tests
-> currently sync XHR only; should find a way to do async
tests...
* update monoucha
-> simplified & updated some related code that no longer worked
properly
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix header case sensitivity issues
-> probably still wrong as it discards the original
casing. better than nothing, anyway
* fix fulfill on generic promises
* support standard open() async parameter weirdness
* refactor loader response body reading (so bodyRead is no longer
mandatory)
* actually read response body
still missing: response body getters
|
|
|
|
| |
+ slightly optimize getContentType
|
| |
|
|
|
|
|
|
|
| |
data URIs can get megabytes long; however, you can only stuff so many
bytes into the envp. (This was thwarting my efforts to view pandoc-
generated standalone HTML in Chawan.) So put `data:' back into the
loader process.
|
|
|
|
|
|
|
|
|
| |
* xmlhttprequest: fix missing import
* painter: generic tuple workaround
* dynstream: merge module with implementations (so it will work with
vtables)
Not enabling vtables yet since it doesn't work with refc.
|
|
|
|
|
|
| |
* add standard interfaces to headers
* use window base URL for newRequest
* remove pointless generic in newRequest
|
| |
|
| |
|
|
|
|
|
| |
This fixes a bug where cloning buffers with images would crash the
browser.
|
|
|
|
|
|
|
|
| |
The status code & headers are no longer guaranteed to be sent right
after res/outputId, so read them asynchronously instead.
(This is pretty much the same code as the buffer connection handler in
pager. Hopefully we can merge the two at some point.)
|
| |
|
|
|
|
|
|
|
|
| |
It seems registerHandle/unregister doesn't accept cint as handles. Not
sure why it even works on 64-bit targets... (maybe some converter
weirdness?)
Seems best to explicitly cast it away.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* resize images with stb_image_resize
* use tee for output handle redirection (redirectToFile blocks)
* cache original image files
* accept lseek in sandbox
* misc stbi fixes
For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in
size, not sure if it's worth the cost. (Either way, we can always switch
later if needed, since the API is almost the same.)
Next step: move sixel/kitty encoders to CGI, and cache their output in
memory instead of the intermediate RGBA representation.
|
|
|
|
|
| |
There is no guarantee that iclose is called exactly at rsBeforeStatus
or rsBeforeHeaders.
|
| |
|