about summary refs log tree commit diff stats
path: root/src/loader/loader.nim
Commit message (Collapse)AuthorAgeFilesLines
...
* loader: use recvData instead of readDatabptato2024-02-091-16/+15
| | | | | | | | recvData is a new method for PosixStream that does less weird magic than readData. Also, allow duplicates in unregWrite/unregRead; it's simpler to live with them than to prevent them.
* loader: fix (another) double-close bugbptato2024-02-081-4/+8
|
* loader: fix memory leakbptato2024-02-081-1/+3
|
* loader: fix double-close bugsbptato2024-02-081-3/+3
|
* loader: fix eagain in fetch, only add URL to handle in debugbptato2024-02-081-2/+5
| | | | | | * eagain was causing fetch to add unnecessary null bytes to input streams * URL is now only added to handles in debug mode
* Incremental renderingbptato2024-02-071-26/+67
| | | | | | | | | | | | Yay! Admittedly, it is not very useful in its current form, except maybe on very slow networks. The problem is that renderDocument is *slow*, so we only run it when onload fails to consume all bytes from the network in a single pass. Even then, we are guaranteed to get a FOUC, since CSS is only downloaded in finishLoad(). Well, I think it's cool, anyway.
* loader: clean up error handlingbptato2024-01-261-12/+11
| | | | | | | | | * remove pointless exception -> bool conversions; usually they were ignored anyway + exceptions are more convenient here * add EPIPE handler to raisePosixIOError * fix socketstream to use raisePosixIOError * fix socketstream sendFileHandle error handling * cgi: immediately return on file not found error
* cgi: fix broken libexec path env variablebptato2024-01-261-1/+2
|
* loader: send error message str for disallowed URLbptato2023-12-291-3/+3
| | | | buffer was crashing with an EOFError otherwise
* Compile with styleCheck:usagesbptato2023-12-281-8/+8
| | | | much better
* loader: refactor onRead/onErrorbptato2023-12-211-19/+22
| | | | | | It was originally written this way to accomodate for the broken std file API. We no longer use that in buffer, so we can use a more correct version now.
* Implement local CGI error message handlingbptato2023-12-151-1/+18
| | | | | | This was documented, but not implemented until now. Also, improve the loader module's protocol documentation.
* Move http out of main binarybptato2023-12-131-71/+59
| | | | | | | | | | | | Now it is (technically) no longer mandatory to link to libcurl. Also, Chawan is at last completely protocol and network backend agnostic :) * Implement multipart requests in local CGI * Implement simultaneous download of CGI data * Add REQUEST_HEADERS env var with all headers * cssparser: add a missing check in consumeEscape
* Move gopher to adapter/bptato2023-12-121-5/+0
| | | | Also, move default urimethodmap config to res.
* Move out ftp: protocol; fix some local CGI bugsbptato2023-12-121-5/+0
|
* Move out file: protocol handling to adapter/bptato2023-12-121-7/+2
|
* local CGI improvements, move data: to cgi-binbptato2023-12-121-4/+0
| | | | error codes are WIP, not final yet...
* local CGI: add mapped URI env vars; move about: to adaptersbptato2023-12-121-6/+5
| | | | | | | | | | | | | | | * Add MAPPED_URI_* as environment variables when a request is coming from urimethodmap It costs us compatibility with w3m, but it seems to be a massive improvement over smuggling in the URL as a query string and then writing an ad-hoc parser for every single urimethodmap script. The variables are set for every urimethodmap request, to avoid accidental leaking of global environment variables. * Move about: to adapters (an obvious improvement over the previous solution)
* Add w3m-cgi-compat optionbptato2023-10-011-1/+23
|
* Add urimethodmap supportbptato2023-09-301-39/+70
| | | | yay
* loader: add local-cgibptato2023-09-301-1/+5
| | | | | | | | | | | Add w3m-style local CGI support. It is not quite as powerful as w3m's local CGI, because it lacks an equivalent to W3m-control. Not sure if it's worth adding; we certainly shouldn't allow passing JS in headers, but a custom language for headers does not sound like a great idea either... eh, idk. also, TODO add multipart
* buffer: simplify contentType handlingbptato2023-09-271-2/+2
| | | | | | * remove contentType member of Buffer object * add ishtml to reduce string comparisons * consistent spelling: contenttype -> contentType
* buffer: make clone fork()bptato2023-09-231-8/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes e.g. on-page anchor navigation near-instantaneous. Well, as instantaneous as a fork can be. In any case, it's a lot faster than loading the entire page anew. This involves duplicating open resources (file descriptors, etc.), which is not exactly trivial. For now we have a huge clone() procedure that does an ok-ish job at it, but there remains a lot of room for improvement. e.g. cloning is still broken in some cases: * As noted in the comments, TeeStream'ing the input stream for any buffer is a horrible idea, as readout in the cloned buffer now depends on the original buffer also reading from the stream. (So e.g. if you clone, then kill the old buffer without waiting for the new one to load, the new buffer gets stuck.) * Timeouts/intervals are broken in cloned buffers. The timeout module probably needs a redesign to fix this. * If you clone before connect2, the cloned buffer gets stuck. The previous solution was even worse (i.e. broken in more cases), so this is still an improvement. For example, this fixes some issues with mailcap handling (removes the "set the Content-Type of htmloutput buffers to text/html" hack), does not reload all resources, does not completely break if the buffer is cloned during loading, etc.
* loader: add gopher supportbptato2023-09-201-0/+5
| | | | works
* loader: add FTP supportbptato2023-09-191-0/+8
| | | | | | | | | | | | works, sort of still needs some work: * better dirlist, ideally make it look like file dirlist (or make file look like ftp dirlist. well, anyway, they should look the same) * absolute paths? (for now you have to append an extra slash to the path beginning) * ssh keys for sftp? (actually I haven't even tested sftp yet...)
* move around more modulesbptato2023-09-141-0/+394
* ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/