Commits
- Commit:
693188cbff678ee0934f5fe5da91365614864888
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ui_require_input: take a fn pointer instead of the protocol number
- Commit:
98b6dee90d3fd7300cc834972decd2c123af999c
- From:
- Omar Polo <op@omarpolo.com>
- Date:
only memcpy into imsg->data if datalen is not zero
Passing a NULL pointer to memcpy is UB no matter if len is 0 (commit by
claudio@, backporting for telescope.)
- Commit:
6d5348f32514004ad33d27ece8dec68ffed9b209
- From:
- Omar Polo <op@omarpolo.com>
- Date:
set_scroll_position: further semplifications
Simplify it even further. There's no need to keep the curfound variable
*at all*: if we end the loop, current_line is not found.
- Commit:
2ef8fcaedd93b1a56d0940ddd58a43a6d6c321f0
- From:
- Omar Polo <op@omarpolo.com>
- Date:
set_scroll_position: always set current_line
There's a small chance we may end up finding the topline but not the
current line if a page content is abruptedly changed.
While here also drop `curfound = 1': it's a dead assignment since it
returns in that conditions.
Bug found while reading the output of clang' scan-build, but not thanks
to clang. scan-build complained about the `curfound' variable, and by
re-reading the code I spotted the missing case.
- Commit:
0e49c9bbcbfef05d5bdf9ad6d851f51fe25c2eaa
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gemini_parse_reply: return code and don't close connection
clang static analyzer found a possible use after free: if the code is
not 2X in gemini_parse_reply we call close_conn. Then, in net_read we
set req->done_header, but req may have been free'd!
Actually, this is almost impossible to trigger. close_conn never ends
up calling free(req) on its first try, because tls_close takes a while
and is rescheduled by libevent. (The check req->ctx != NULL in
close_conn is always true if it's a gemini request.)
Nevertheless, it's clear to move close_conn out of gemini_parse_reply
and simply return the response code: it feels wrong that a "parsing
function" takes logic decisions.
- Commit:
3591e6dbd5cf94dae2b0a438542bf542ae094c01
- From:
- Omar Polo <op@omarpolo.com>
- Date:
declare data as uint8_t *; pointer arith on void * is a GNU extension
- Commit:
6ecb1353d2c2d97f08d74510f3067c7fd25a28db
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add some more warnings to the mix
- Commit:
6241aa26f34274ae8b9b7934c88d5686bcb2c7a2
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix tests for build out-of-tree
now `make distcheck' works as advertised
- Commit:
23a912c214e3f9a8bbb2bf03e65c2d3a538f869f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add test of parsing and deserialization of gophermaps
- Commit:
1bcb8303e1b913df31980ca332a5619424a72b01
- From:
- Omar Polo <op@omarpolo.com>
- Date:
move load_page_from_str to telescope.c
I'd like to use parser{,_gophermap,_gemtext}.c in standalone testing
programs, and this function is getting in the way since it depends on
ui.c
- Commit:
fe84b7508f733106d346acf1b120951c78ad77a1
- From:
- Omar Polo <op@omarpolo.com>
- Date:
switch the cache to the new parser_serialize API
- Commit:
069c9a92f36df9d307d734ffa8903035c7181129
- From:
- Omar Polo <op@omarpolo.com>
- Date:
parsers: add serialize function
Add a parser_serialize function and an optional function `serialize' for
parsers. The default implementation just prints the text line, which is
suitable for parser_textplain and parser_textpatch; gemtext and
gophermap uses their own specific unparse functions.
This is intended for an incoming cache refactoring: we'll cache the page
serialized in the correct format, not once it has been translated to
gemtext. This will allow in the future to provide commands such as
``save page to disk'' or interface with an on-disk cache.
- Commit:
5a21e0eb51554d72c1b6465c2b4afc8cdef5dcf1
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add fn pointer to the parser init function to struct parser
will come in handy in the future cache refactoring.
- Commit:
b96fa8fe23277bee0c42d55dae506449d83909bc
- From:
- Omar Polo <op@omarpolo.com>
- Date:
use parser_init instead of directly calling the parser init fn
- Commit:
bf5b33f40e876afe41fd486ff5d3eb182dfaf046
- From:
- Omar Polo <op@omarpolo.com>
- Date:
correctly save scrolling position
Before we didn't save the scrolling position before a refresh
(nohist=1) and that's annoying. This saves the scrolling position
only in the correct case, which is when changing from a page to
another, expect when switching to TAB_LAZY off.