| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The old API was needlessly complex and suggested that it could only be
used for DOMException (which is not the case).
(Also optimized out code lookup from the DOMException constructor.)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of trying to track child pids (which is wrong - a child may die
at any time for whatever reason, so we could have ended up murdering
some random process that took its place...), just setsid on forkserver
start and send SIGTERM to the entire process group on termination.
Also removed the loader pid from the FileLoader object, as it is no
longer useful.
|
|
|
|
|
|
|
|
|
| |
This time, I've also ported over the consistency check to prevent some
ownership bugs.
Unfortunately, the check is very limited, and it is still possible to
double-free or leak JSValues. I think it would be possible to make
coverage 100%, but only with ARC...
|
| |
|
|
|
|
|
|
|
| |
* optimize toJS set
* change defineProperty wrappers to return an enum
If we're going to wrap defineProperty, then let's do it properly.
|
|
|
|
|
|
|
|
| |
Instead of hashing the class name for isInstanceOf, we now just reuse
the Nim type pointer -> JSClassID map, which should be more efficient.
This removes getClass and hasClass; these can be replaced by just
reusing the class ID returned from registerType.
|
|
|
|
| |
Undocumented, plus and globalThis/window are enough.
|
|
|
|
|
| |
This isn't great, but neither was passing around a pointer that pointed
to a single object.
|
|
|
|
| |
Implements the [Replaceable] WebIDL property.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Now we just pass through a socket created in pager.
This removes the need for a socket directory, and strengthens the buffer
sandbox slightly.
I've kept the ServerSocket code, because I want to add some form of RPC
and communication between separate instances in the future. However,
I don't expect this to be handled outside the main process, so I've
removed the Capsicum-specific connectat/bindat code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, each message (load, resume, passFd, etc.) would open a new
connection to loader's UNIX socket, and assumed the loader was dead
when the loader did not respond (ECONNREFUSED).
As it turns out, this model was hopelessly broken: POSIX does not
specify when a UNIX socket can refuse connections, so while it happened
to work on Linux (which just blocks if it can't accept right now),
FreeBSD would randomly refuse connections whenever its listen queue was
full.
Instead, we now take a socketpair() from the loader in addClient, and
pass on one half to the client (the other half stays in loader); this is
the control stream, and all messages from the specific client are sent
through it. If a message includes a new stream (e.g. lcLoad), then it
sends a new socketpair through the control stream.
Aside from not being completely broken (and being marginally more
efficient), this arrangement has several other benefits: it removes the
need for authentication, almost removes the need for sockdir (now only
buffers use it), and will make it easier to add async message processing
in the future.
|
|
|
|
| |
Now screen.width etc. works in the pager too.
|
|
|
|
|
|
|
|
| |
Both are quite useful.
readFile and writeFile got a small makeover in error handling; in
particular, readFile now returns null instead of the empty string when
the file is missing and writeFile throws a TypeError on I/O errors.
|
|
|
|
| |
I no longer need it
|
|
|
|
|
|
|
|
| |
not completely, because that would break the existing API :/
this also fixes the broken interruptHandler - it no longer crashes,
but it's still inefficient... probably it should "just" handle SIGINT
instead
|
|
|
|
| |
ref. https://todo.sr.ht/~bptato/chawan/27
|
|
|
|
|
|
| |
eh
probably have to move the event loop to pager...
|
|
|
|
| |
one less mystery
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's *not* a context menu: items are fixed, and currently not even
customizable. Former is a feature, latter is a bug.
Also, select now has improved mouse support; its behavior is a
combination of the w3m menu (for btn1) and GTK Firefox context menu
(for btn3).
Also, fix some bugs in select:
* lines with double width chars are handled better (not perfectly,
but at least the grid isn't completely mangled anymore)
* non-multiple select now highlights the currently selected option
* small selects at the bottom of the screen are handled correctly
* selects at the right edge of the screen are handled correctly
* select multiple no longer discards selected items on cursorLeft
|
| |
|
|
|
|
|
|
|
| |
most of it has already been moved to monoucha, and the rest fits better
in other directories.
also, move urimethodmap to config
|
| |
|
|
|
|
|
|
|
| |
* query, fragment are now strings, not options
* get rid of Host, Path types, now hostname/pathname are strings
* fix ipv4 parsing error case
* in file protocol, fix URL for dirlist without slash with a redirection
|
|
|
|
|
| |
stopgap measure until I think of a more flexible mouse configuration
method
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
| |
replaceBackup was not being cleared, so the next gotoURL with a replace
pointing to such buffers wouldn't work.
|
|
|
|
|
| |
gets rid of a todo.
(not sure why I thought this was important, but it sure looks nicer)
|
|
|
|
|
|
|
|
|
| |
Now we dispatch to select objects from the pager object too, just
to make things even more confusing.
Well, it works better than the previous arrangement, in that trying to
use unimplemented movements now just throws instead of moving around
the container. Yay for OOP (?)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...)
|
|
|
|
| |
Dispatch manually with fromJS instead.
|
| |
|
|
|
|
| |
use JSValue varargs instead
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* buffer, pager, config: add meta-refresh value, which makes it possible
to follow http-equiv=refresh META tags.
* config: clean up redundant format mode parser
* timeout: accept varargs for params to pass on to functions
* pager: add "options" dict to JS gotoURL
* twtstr: remove redundant startsWithNoCase
|
|
|
|
|
| |
Still not perfect, because it crashes on missing /tmp dir so you have to
manually set it...
|
|
|
|
|
| |
This fixes a bug where cloning buffers with images would crash the
browser.
|
|
|
|
| |
these are already defined on Window
|
|
|
|
|
|
| |
Merge timeout & interval code paths.
This fixes clearTimeout not clearing intervals.
|