| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
We already need a camel -> kebab converter anyway.
Unfortunately this also changes JS binding names, so it's a breaking
change. Oh well.
|
| |
|
|
|
|
|
|
|
| |
The fds must be read before the other buffer resumes execution.
Also, for some reason, CMSG_SPACE/CMSG_LEN are inconsistent in their
size with controllen on BSDs...
|
|
|
|
|
|
|
|
|
|
|
|
| |
One less unsafe/error prone construct. Refcounting the page as seq is
unfortunate, but still miles better than zero-filling a non-refcounted
array. (Plus it works better for base64 decoding.)
The len field is still necessary, because old runtime doesn't support
setLenUninit. Oh well, it's one wasted word, not the end of the world.
As for the chunks, it looks like the allocator still uses small ones for
the seq, so we're good.
|
| |
|
| |
|
|
|
|
|
|
| |
The goal is to get "SmallChunk" pages from the allocator.
I think I stole the idea from faststreams, but the overhead might be
different with raw pointers...
|
|
|
|
|
|
|
|
| |
Moves sendfd/recvfd out of C, and fixes some of its flaws too.
The main one is that now all file descriptors are sent together.
Also, I've decided to remove the ServerSocket after all; it's easy to
add it back if it's ever needed again.
|
|
|
|
|
|
|
| |
ok, now it works like in w3m. (mostly, barring CSS limitations...)
we'll see how this works out
Also adds/fixes some select and option DOM APIs.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
safeClose was originally added to prevent this bug:
let fd = doSomething() # allocates fd on 0, e.g. by opening a socket
let ps = newPosixStream(fd)
...
discard dup2(ps.fd, STDIN_FILENO)
ps.sclose() # stdin is now closed, despite the opposite intention.
With safeClose called on fds that could be stdin, the goal was that
stdin/stdout/stderr would never be allocated as a different file,
but it was still error-prone. Enter moveFd:
ps.moveFd(STDIN_FILENO)
If ps is already stdin, this does nothing. If not, it dup2's ps to
stdin, closes ps.fd, and sets it to stdin.
|
| |
|
|
|
|
| |
better than nothing
|
|
|
|
| |
welp. bufreader chokes on 0-sized packets...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Only works if referer-from is enabled.
|
|
|
|
| |
In some cases, it works without restyle, but not always.
|
|
|
|
|
|
|
| |
handleRead can register through fetch, so this doesn't work out as
nicely as in loader (where we control all register/unregister calls).
So now we queue up register events first, and only process them after
the "events" iterator exits.
|
| |
|
|
|
|
| |
it has to clear old styles too
|
|
|
|
|
|
|
|
|
|
| |
FD_CLOEXEC should hopefully get rid of bugs where buffers outlived the
main process because of some stray child process keeping the canary
pipe alive.
It's not perfect because of the runMailcapWriteFile/runMailcapReadFile
double-forks. Ideally they should be replaced with an implementation
that tracks temporary files in the main process.
|
|
|
|
|
|
| |
style/layout invalidation is a mess :(
Fixes acid3 test00
|
|
|
|
| |
this way, markURL works on stack traces
|
|
|
|
| |
so that unicode anchors work too
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, we just stuffed it into the URL, which was somewhat
problematic.
Mainstream browsers like to hide the username from the user, but I've
decided to follow w3m: buffers do not receive auth info, but the pager
itself displays the username.
As for the origin: I wanted to use the regular origin, but that does not
work with any custom URL. So instead of changing the regular origin
function, I've added another.
|
|
|
|
|
|
|
|
|
| |
* add failed buffers to history too
* make buffer.history and siteconf history actually do something
* prevent history in dump mode after retry too
* disable history in test configs
ref. https://todo.sr.ht/~bptato/chawan/39
|
|
|
|
|
| |
more intuitive than shoehorning it into "view image"
(also makes it easier to apply the content type)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly compatible with other browsers/tools that follow the
Netscape/curl format.
Cookie jars are represented by prepending "jar@" to the host part, but
*only* if the target jar is different than the domain. Hopefully, other
software at least does not choke on this convention. (At least curl
seems to simply ignore the entries.)
Also, I've moved cookies.nim to config so that code for local files
parsed at startup remains in one place.
|
|
|
|
|
| |
"No CGI dir configured" is no longer a common case, so it's OK to just
return "CGI file not found".
|
|
|
|
| |
Now screen.width etc. works in the pager too.
|
|
|
|
|
|
|
| |
It isn't really limited to config. It just happens to be in
XDG_CONFIG_HOME because XDG basedirs suck.
(W3M_DIR works similarly.)
|
|
|
|
| |
Respects autofocus.
|
|
|
|
|
|
|
|
|
|
| |
For APIs that cannot be implemented in a privacy-friendly manner.
As a start, I've added accurate screen size queries; getComputedStyle,
getBoundingClientRect, etc. should follow. (We have a harmless
getComputedStyle already, but it's broken.)
Probably, things like JS-based scroll belong in here too, but I'm not
sure yet. (Perhaps autofocus should be reused instead?)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix luwrap comparison function
* strip high unicode controls in term/pager
* use wcwidth in dirlist2html
* remove combining category from strwidth
* remove unused "disallowed" field from lineedit
My initial goal with switching to wcwidth in dirlist2html was just to
get rid of the outdated combining map in charwidth_gen. Then I realized
that layout will normalize those out anyway, so we don't actually have
to deal with them anywhere.
Also, I found a few bugs in the process; high unicode control chars not
being stripped out was a particularly bad one, as it allows for pages to
mess up the terminal output. (Easiest way to replicate: just open a
random binary file without this patch.)
|
|
|
|
|
|
| |
It was named "fragment" mainly because I added it back when there was
still a separate InlineBox type and I needed another name.
Now InlineBox is gone, and I'm tired of typing fragment.
|
| |
|
| |
|
|
|
|
| |
doing it manually is too error prone
|
| |
|
| |
|
|
|
|
| |
Lets us skip a couple pointless multiplications/divisions during layout.
|
|
|
|
|
|
|
|
| |
* correct action on M-b
* add external.bookmark option
* move openFileExpand functionality into unquote
* add menu items
* update docs
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It gets copied once anyway, so just use a blob.
I guess I could skip the copy with some effort, but the 4 lines
implementation is too attractive :P
This is still an improvement, as it doesn't needlessly zero-fill the
buffer on realloc.
(I've also removed the final realloc from blob, as it seemed quite
pointless. Using Content-Length could help... except it doesn't,
because it refers to the encoded length. Ugh.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unconditionally registering output handles on resume could result in a
failed assertion on double-register.
The bug would appear like:
resume (register) -> handleRead -> pushBuffer -> currentBuffer is nil ->
register again
handleWrite had a very high likelihood of occurring between resume and
handleRead, and that hid the bug by immediately unregistering the handle
after resume. In fact, I haven't been able to reproduce the bug at all
today, and only found it after poring over the source...
Fix this by not registering output handles that are empty (except
if the istream is already finished, in which case it will just be
unregistered).
|
|
|
|
|
|
|
|
|
|
|
|
| |
* remove std/streams use from mime.types; mmap and parse directly
* use mime.types for inline image extensions
* add some jpeg file extensions
Latter came up because I was trying to add a format locally and it
wouldn't recognize it on images from my file system (i.e. by extension).
As a security measure we still do not allow additional extensions for
predefined inline image types.
|
|
|
|
| |
only the most basic form; no media queries yet
|
|
|
|
| |
whoops
|