<-- back to the mailing list

How do you buffer a Gemini connection?

almaember almaember at disroot.org

Mon Mar 29 07:22:05 BST 2021

- - - - - - - - - - - - - - - - - - - 

On Mon, 29 Mar 2021 07:17:31 +0300Ecmel Berk Canlıer <me at ecmelberk.com> wrote:

This is what I do on Moonlander. Not by line, as binary data can be
sent over Gemini, but in 1029 byte chunks (exactly the max length of
one Gemini header. Saves me code in trying to split that too)

That makes sense, it will even save me from having to mess withmalloc and realloc.

I send each chunk into a separate "renderer" for the given file type,
which in text's case decodes it into the given encoding (default
UTF-8) and sends it over to the text/gemini parser which then does
the line splitting and parsing there. (And in other cases it will
just save the bytes directly to a file)One question, what do you do if a single line is split into multiplechunks?

I will try checking your source for it, but I don't really understandor know Rust so I'm not sure I will understand it.

~almaember-------------- next part --------------A non-text attachment was scrubbed...Name: not availableType: application/pgp-signatureSize: 659 bytesDesc: OpenPGP digital signatureURL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20210329/8cbc68a6/attachment.sig>