Commits
- Commit:
0082f4263cebb5303ddc4ef027a0bc6b79bbe50a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
imsg: allow fdpass on the net socket
it's used to pass the client certificate to the net process so has to
be enabled.
Issue <https://github.com/telescope-browser/telescope/issues/21>
spotted by linuxcult; thank you!
- Commit:
c8b8dc5c502e3b69cc28f29c0a9570a8378488c6
- From:
- Omar Polo <op@omarpolo.com>
- Date:
update imsg
- Commit:
3d89457cdeba5041aa6f0c1f8640b91bcbb6ec51
- From:
- Thomas Adam <thomas.adam22@gmail.com>
- Date:
code: add wrappers for common failure cases
Certain calls to well-known functions sometimes result in similar
error handling across the code base. Sometimes there's a need to
centralise the failure case.
Achieve this for common wrappers to often-used functions.
The transformation is achieved via coccinelle, commited with this patch.
Note that coccinelle can be told to ignore code blocks with comment
delimiters.
This transformation applies just to telescope's code, and not any of the
bundled depdencies in telescope (libgrapheme).
- Commit:
cb75f36c2043dbc8025438662a547f5b162f9e17
- From:
- Omar Polo <op@omarpolo.com>
- Date:
removed unneeded #include <assert.h>
- Commit:
a3e4d56b6d9bcfca48f3d8c8f1e526e95b0c2f64
- From:
- Thomas Adam <thomas.adam22@gmail.com>
- Date:
tls: guard against faulty gemini servers
Some gemini servers have faulty TLS handling, such as:
gg: tls_close: EOF without close notify
In such cases, telescope will receive that error and naturally assume
there was a problem and stop processing. However, in the case of there
still being legitimate content read from the request, this should still
be displayed, rather than ignored.
This change therefore detects this condition and adds a status of 'W' to
telescope's modeline to indicate that the information presented is from
a faulty gemini server and could be truncated and hence display oddly.
- Commit:
140a1abdc7de2af3283c254cf82435384495b1c0
- From:
- Omar Polo <op@omarpolo.com>
- Date:
slightly rework gemini reply handling
- rename `r' to `code'
- defer the buf_drain() call
With libevent we had to free() the header string, whereas buf_getdelim()
returns a string from the buffer itself, so we can safely defer the
drain operation after the sanity checks.
- Commit:
9659786c230c5dd9f5bb0193e07d068d828dfb44
- From:
- Omar Polo <op@omarpolo.com>
- Date:
grammar
- Commit:
1fa94674f952e02ed869066a528110a1aef8a246
- From:
- Omar Polo <op@omarpolo.com>
- Date:
make gemini_parse_reply() return -1 on error
- Commit:
81df72e1bd1474d79928c8478d09e8c713f1cdca
- From:
- Omar Polo <op@omarpolo.com>
- Date:
don't pause the request in gemini_parse_reply()
a parse routine shouldn't interfere with the handling of the events;
pulling this into the caller makes the logic simpler to follow.
- Commit:
5f285272dff39a7d4b876e094dd60b9afab0f523
- From:
- Omar Polo <op@omarpolo.com>
- Date:
simplify gemini_parse_reply()
- Commit:
f2a80e942a406dcda39fddc9fd879dfb766338a8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
simplify gemini header handling with buf_getdelim()
- Commit:
ce0234337a4093b79ae71ea572440f6a2c8af157
- From:
- Omar Polo <op@omarpolo.com>
- Date:
decouple bufio from ev
more a matter of cleanliness than a strong reason, but this allows
to reuse bufio without ev (if wanted to.)
- Commit:
51ea137bb49c36da2a1bbe887f47cb8614fbe436
- From:
- Omar Polo <op@omarpolo.com>
- Date:
net: initialize fds earlier
- Commit:
62d3cd290e6d0b4aa1fe7f2c70a7654e6d7179a6
- From:
- Omar Polo <op@omarpolo.com>
- Date:
net: use a single timer for asr and handshake timeout
- Commit:
87d297d14e29cf2c5a8a11b8f4db518d9217e337
- From:
- Omar Polo <op@omarpolo.com>
- Date:
move imsgev & co to their own file
This avoids bringing the dependency on ev on telescope-identity(1) and
the tests as well.
- Commit:
108846853f74d3cd0934bf2ccb2041b95668f1b8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
net: re-enable asr_run
Make asr_run() work on top of ev. While here, rename the function
names and add real error checking.
- Commit:
99ebdacbeb6a98bb61e227c3239dd47de5f36b06
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add a paranoic check
- Commit:
cc300b254acac91d7a531e5305c3bc681fb3871d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add missing return
otherwise we try to reschedule the socket we've just closed.
- Commit:
98d3e6c172747dc58042bde09a848d3e03572934
- From:
- Omar Polo <op@omarpolo.com>
- Date:
convert telescope to use ev instead of libevent
libevent is a very cool library, I like the APIs and enjoy using
it. However, telescope is not as large and doesn't have as many
file descriptor, so libevent is quite ``too big'' for our needs.
ev started as a small event loop on top of poll(2) for amused, and
can be used here too, it just needed to grow the ability to handle
several timers, as we need quite some on telescope (in fact, we use
more timers than fds!)
- Commit:
c6287992bf8097498b7fe492345e5334218b3b17
- From:
- Omar Polo <op@omarpolo.com>
- Date:
net: improve error messages for connection failures
- Commit:
af6907bf376ad1ee642b1a281ef64cdb7cd4ddbe
- From:
- Omar Polo <op@omarpolo.com>
- Date:
net: improve handling of connect(2) failures
If we succeed to make a socket(2) but fail to connect(2), still
attempt to reconnect using the other results from getaddrinfo(3).
- Commit:
90c462261dfb869b5e25c44bc9f17259e28e4b40
- From:
- Omar Polo <op@omarpolo.com>
- Date:
improve error message on connection interruption
- Commit:
d35e18b31b0e05c6178a6bfa891dd2e2dadf3db1
- From:
- Omar Polo <op@omarpolo.com>
- Date:
first draft of client certificate support
At the moment telescope loads a mapping host:port/path -> certificate
from a file and always uses it, no ways to change it, use a temporary
one, generate a new one, etc are provided yet.
The format of ~/.telescope/certs/certs is
host port path certificate file name
where the certificate file name is the name of a file inside
~/.telescope/certs.
~/.telescope/certs/ is ~/.local/share/telescope/ when using XDG.
- Commit:
54764e41a11e16a56da805313f209a9937c5173d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
send the reply code and meta in a single imsg
- Commit:
0388b56b659378d06da4d3ae5b44ec1b11d53374
- From:
- Omar Polo <op@omarpolo.com>
- Date:
net: switch to new imsg apis