about summary refs log tree commit diff stats
path: root/adapter/protocol
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate some superfluous copiesbptato2025-05-111-2/+2
|
* Enable ProveInit warningbptato2025-05-101-1/+2
| | | | It has caught some minor bugs.
* man, genidna: do not use std/unicodebptato2025-05-041-2/+1
|
* Improve static buildsbptato2025-05-014-8/+27
| | | | | Now we generate a single "ssl" binary for CGI scripts that need OpenSSL to reduce the output size.
* http: cast away GCC complaints properlybptato2025-04-241-4/+7
|
* http: re-add brotli supportbptato2025-04-231-1/+97
| | | | | Unfortunately this is unavoidable, as some servers still seem to return brotli despite our Accept-Encoding header not including it.
* lcgi_ssl, sftp: add cflags from pkg-configbptato2025-04-142-1/+5
|
* http: replace with newhttpbptato2025-04-142-637/+1306
| | | | | I think it works well enough at this point. If it doesn't, somebody will complain :)
* http: merge in curl.nimbptato2025-04-142-456/+456
|
* sftp: verify known_hostsbptato2025-04-131-4/+140
| | | | Long overdue... the API is extremely painful to work with.
* sftp: fix IdentityFile scan orderbptato2025-04-091-2/+4
|
* lcgi_ssl: disable DHEbptato2025-03-221-1/+1
|
* newhttp: drop libcurl dependencybptato2025-03-212-2/+43
| | | | Now it only does HTTP/1.1, with Connection: close.
* bonus: add new http handler with tinflbptato2025-03-201-0/+19
| | | | not much else is done yet, but it's a start
* curl: fix build on OS Xbptato2025-03-101-4/+2
| | | | | | (also removed unused windows check) ref. https://todo.sr.ht/~bptato/chawan/50
* dynstream: remove exceptionsbptato2025-02-265-48/+70
| | | | | | | | | | | | | 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.
* file: fix directory listingbptato2025-02-051-4/+3
|
* about: move to loaderbptato2025-01-301-20/+0
| | | | | This means we can now use about:downloads for downloads. Plus it shaves off some ks from the distribution.
* file, sftp: send Content-Lengthbptato2025-01-242-14/+28
|
* term: rework input bufferbptato2025-01-171-2/+2
| | | | heh
* More strict defsbptato2025-01-142-4/+4
|
* Fix some strict defsbptato2025-01-121-1/+1
|
* lcgi: add missing noreturnbptato2024-12-291-1/+1
|
* CHA_CONFIG_DIR -> CHA_DIRbptato2024-12-272-2/+2
| | | | | | | It isn't really limited to config. It just happens to be in XDG_CONFIG_HOME because XDG basedirs suck. (W3M_DIR works similarly.)
* Strict def fixesbptato2024-12-222-2/+2
|
* twtstr: improve content type parameter handlingbptato2024-12-223-4/+3
| | | | | * accept quoted-string * quote values in setContentTypeAttr
* default(T) -> T.default, add some strict defsbptato2024-12-172-8/+8
|
* gemini: fix known hosts not being read on *BSDbptato2024-12-161-0/+1
| | | | Only glibc starts from the file's beginning with "a+".
* chabookmark: fix new item placement, better error handlingbptato2024-12-151-18/+25
| | | | it should put it after the old items, not before them.
* md2html: add heading class to heading anchorsbptato2024-12-151-4/+7
| | | | makes it easier to hide them
* Add chabookmark scriptbptato2024-12-141-0/+235
| | | | | | | | | | Finally it's done. It's basically w3mbookmark, but using Markdown instead of HTML and in POSIX shell instead of C. As a bonus, it can also (sort of) import w3mbookmark's output. Well, at least it worked on my bookmark file, but there is a known issue with bracket escaping... if it goes wrong, it's simple enough to edit it manually :P
* lcgi: fix error handlingbptato2024-12-111-1/+1
| | | | POSIX does not guarantee that an error is negative.
* gopher: fix an escaping bug, add some item typesbptato2024-11-301-4/+4
| | | | | | the types are from gopher+. (not that we support gopher+, but they work anyways if mime.types and mailcap is configured)
* file: remove some dead codebptato2024-11-241-6/+0
| | | | no longer needed as we just redirect on wrong dir URLs
* gopher: do not assume selector starts with /bptato2024-11-201-1/+1
| | | | | | It does not have to, according to the standard. (Slashes before the item selector are still collapsed.)
* gemini: set host name extension, refactorbptato2024-11-172-39/+33
| | | | gmifetch did this, but apparently it got lost in the rewrite.
* gopher: fix queries with spacesbptato2024-11-151-1/+2
|
* twtstr: beforeLast -> untilLastbptato2024-11-151-1/+1
| | | | for consistency
* gopher: url decode path & query before submissionbptato2024-11-121-1/+3
|
* Remove useless filebptato2024-11-121-1/+0
|
* url: reduce URL object size, simplifybptato2024-11-111-1/+4
| | | | | | | * 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
* Fix some C warnings, more makefile vars, etc.bptato2024-11-082-3/+3
| | | | | | | * add some more env vars to makefile * remove fpermissive from GCC builds * update Monoucha * fix borked seccomp filter length safety check (ugh)
* ftp: improve sendCommand error handlingbptato2024-11-071-17/+15
|
* gopher: rewrite in shellbptato2024-11-053-78/+42
| | | | | | also, make gopher2html more lenient, and add some functioning error handling in our nc clone. (other scripts still have to be updated to benefit from this)
* gopher: move ipv6 handling to lcgibptato2024-11-042-10/+18
|
* protocol: sandbox more network processes + fix some gemini bugsbptato2024-11-026-9/+15
|
* config: refactor, accept more possible config dirsbptato2024-10-282-11/+0
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* gemini: fix unnecessary NUL chars being sentbptato2024-10-271-1/+1
|
* sftp: switch to libssh2bptato2024-10-267-211/+234
| | | | | | | | | | | | | | | | | | | Just to remove a level of indirection; the libcurl API is annoying to deal with when you don't even need asynchrony. It doesn't change anything in actual dependencies, because libcurl uses libssh2 too - however, now only http depends on libcurl, which makes reducing it to an optional module feasible. Still, I've listed libssh2 (along with OpenSSL - long overdue) in the readme just in case some OS doesn't pull in the headers by default as a libcurl dependency. Also, fix some bugs: * fix missing CWD command in FTP * resolve directories even if they don't end in / * allow links without -> in dirlist
* sandbox: do not ask for signal permissionsbptato2024-10-173-0/+3
| | | | | On a second thought, no timeouts for name resolution is fine - and even if it weren't, it's better implemented in the loader.