about summary refs log tree commit diff stats
path: root/src/server
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate some superfluous copiesbptato2025-05-112-2/+2
|
* Enable ProveInit warningbptato2025-05-103-4/+9
| | | | It has caught some minor bugs.
* buffer: remove gpstream & SIGTERM handlerbptato2025-05-082-13/+1
| | | | | SIGTERM will kill us anyway, and then the control stream gets automatically closed. Fin.
* event: implement capturing phase, misc improvementsbptato2025-05-051-17/+31
| | | | Fixes acid3 tests 31, 32
* layout, csstree: build stacking contexts together with treebptato2025-05-031-2/+3
| | | | | | | | We often redo sub-layouts in layout, and this makes stacking contexts very hard to build reliably there. This fixes a bug where positioned descendants of flex items would sometimes mysteriously disappear.
* url: add schemeType, fix port bug on protocol assignmentbptato2025-05-032-8/+8
| | | | Allows branching on the scheme without string comparisons.
* container: support Refresh headerbptato2025-05-022-39/+44
|
* myaddr: backport & switch to newSeqUninitbptato2025-04-301-1/+1
|
* loader: remove obsolete commentbptato2025-04-171-1/+0
|
* loader: use pipes in network streamsbptato2025-04-172-13/+11
| | | | | | | | | | | Turns out we don't actually have a reliable mechanism to detect broken streams - if a pipe is broken, well, it's broken, but that's about all we know. It seems UNIX sockets didn't trigger the code path, but pipes do now, and it was causing issues (reporting some correctly ended streams as broken). This is not fixable with the current protocol, so for now, I've just made onError do the same as onRead at EOF.
* loaderiface: return PosixStream for startRequestbptato2025-04-153-10/+9
|
* loader: fix redirectToFile looping logicbptato2025-04-151-13/+14
|
* loader: remove target pid from addCacheFilebptato2025-04-152-13/+8
| | | | I wonder if it would be better to just resume in the buffer.
* loader, pager: fix login with username onlybptato2025-04-131-2/+7
| | | | | | It's a bit tricky, because "username only" means "try with the username only" only if no password has been recorded for the username on the origin.
* loader: remove referrer field from Requestbptato2025-04-133-12/+20
| | | | It's OK to store it in headers.
* loader: support Set-Cookie for non-initial requestsbptato2025-04-054-78/+142
| | | | | | | | | For compatibility with mainstream browsers. e.g. this should allow log-ins through ajax. To synchronize the loader's cookie jar with that of the pager, we open a stream (about:cookie-stream) to pass over serialized cookies when required.
* config: add user-style, deprecate [css] and stylesheetbptato2025-04-011-3/+3
| | | | | I'm not 100% content with this syntax either, but it's a significant improvement over the previous solution.
* loader: respect credentials modebptato2025-03-282-14/+29
|
* loader: do not crash on shareCachedItem with invalid source/target pidsbptato2025-03-241-3/+6
| | | | | This may happen if the buffer crashes while pager is trying to share its resources.
* newhttp: drop libcurl dependencybptato2025-03-211-2/+0
| | | | Now it only does HTTP/1.1, with Connection: close.
* loader: fix some CGI header parsing bugsbptato2025-03-211-1/+6
|
* Cast Pid to IntAlex2025-03-151-1/+1
|
* loader, forkserver: launch CGI processes from fork serverbptato2025-03-142-92/+169
| | | | | | | | | | Well, it's not much prettier... but it will be useful for keep-alive. (Hopefully.) Also, loader could now be locked down capsicum/pledge/seccomp, but I'm not sure if there's a point. The biggest potential threat it faces is cross-contamination of handles, and no amount of syscall filtering is going to protect against that.
* forkserver: clean up, do not panic on forkBuffer failurebptato2025-03-141-52/+25
| | | | | | | | | I've removed the SIGINT trap because the fork server is now in a separate process group than the main process anyway. We'll see if this actually works... Also realized we weren't closing the fork server's control stream on fork; now we do.
* forkserver: simplify & improve process cleanupbptato2025-03-132-30/+5
| | | | | | | | | | 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.
* headers: hide table, always specify guardbptato2025-03-126-64/+79
|
* Re-add JSValueConstbptato2025-03-123-6/+7
| | | | | | | | | 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...
* loader: remove unset from client closebptato2025-03-081-1/+1
| | | | it worked somehow, but it's wrong...
* loader: refactor handle registration, fix a cache bugbptato2025-03-071-74/+63
| | | | | | | | | Previously, the code just called put and unset on handles in situations where it seemed necessary, but this has become unmanageable. Now, put is called as soon as a handle receives its stream, and unset is called whenever said handle (and thereby its stream) is closed. This fixes a bug in loadCGI with an rbtCache body.
* loader: asyncify inputhandle status responsesbptato2025-03-051-133/+164
| | | | | | I've also removed the rsBeforeStatus error check from iclose. I'm not sure if it's still needed at all, but if it is, then it was implemented in the wrong place.
* loader: fix crash on iclose if client is deadbptato2025-03-021-3/+6
|
* buffer, dom: fix stylesheet leaksbptato2025-03-021-4/+0
|
* loader: merge status and header packetsbptato2025-03-013-39/+20
| | | | | | | We sent the two packets at the same time anyway. (Status could have been sent earlier in some cases, but there is no point - it's unused until after all headers have been received.)
* Refactor bufreader, bufwriterbptato2025-03-015-94/+85
| | | | | This adds a runtime check to packet readers to ensure that all fds have been read, and switches to seqs for packet writers.
* dynstream, console: remove DynFileStreambptato2025-02-261-2/+2
| | | | | Conflating buffered streams with non-buffered streams is generally a bad idea.
* dynstream: remove exceptionsbptato2025-02-264-108/+108
| | | | | | | | | | | | | Now we just pass down the value of n and check errno, plus readDataLoop/writeDataLoop returns a bool indicating whether it failed. For now this seems to work OK, but maybe I'll add a better abstraction in the future. EOFError is still used for handling failed packets; this is brittle, and should be replaced once we have a proper buffering mechanism for them. (That will also let us kill BufStream.) Unrelated: this also fixes a bug in buffer with cacheId.
* loader: do not refcount ctxbptato2025-02-251-96/+94
|
* tempfile: merge into pager/loaderbptato2025-02-251-4/+14
| | | | | | | | and throw out the conflict resolution logic; it doesn't matter much if we override an old cache file, as it should have been cleaned up anyway. I've also replaced dirExists + createDir with a single mkdir at call sites. If it fails, so be it.
* Add mark-links featurebptato2025-02-181-6/+19
| | | | ref. https://todo.sr.ht/~bptato/chawan/43
* layout: implement negative z-indexbptato2025-02-181-3/+2
| | | | Ugly, but works. I think.
* render: respect stacking context for inline boxesbptato2025-02-171-2/+2
| | | | | | | | | | | | Also, eliminate the offset attribute in StackItem by just taking render.offset from the nearest ancestor as the base. That leaves us with clipBox, which I'm not yet sure how to get rid of. Its current implementation is certainly wrong: `position: absolute' should really use its absolute container's clip box. It is however correct for `position: relative' in its current form. (One way would be to cache it inside CSSBox, like we do offset.)
* xhr, event, catom: fix some bugsbptato2025-02-152-2/+5
| | | | Event handler functions can be set twice now.
* buffer: wait for scripts in headless modebptato2025-02-151-5/+24
| | | | | Dump mode remains the same, except now it can be controlled in config.toml as well.
* buffer: remove estream, fdbptato2025-02-141-6/+3
|
* csstree, layout: more refactoringbptato2025-02-131-6/+8
| | | | | Base InlineBox is a fair bit smaller now, and (most) strings are cached using RefString.
* catom: make factory globalbptato2025-02-131-11/+7
| | | | | This isn't great, but neither was passing around a pointer that pointed to a single object.
* layout: separate out tree construction logicbptato2025-02-121-0/+1
| | | | | | | | | | | | | | | For now, the skeleton remains in layout. Eventually it should be lazily constructed during the actual layout pass (thereby making layout "single-pass" (sometimes :p)) The end goal is to do it all in styledNode.children, so that caching can be as simple as "next box = find next matching cached box ?? make new". This does mean that the internal structure of cached boxes will always have to be reconstructed, but I don't see a better way. (I suppose it still remains possible to optimize out the unnecessary layout pass when only a repaint is needed (e.g. color change) by modifying computed values in-place.)
* buffer: fix nil check in maybeReshapebptato2025-02-101-1/+1
|
* box: abstract over tree traversalbptato2025-02-081-16/+4
|
* buffer: treat elements with click listener as clickablebptato2025-02-081-1/+3
|