~sircmpwn/gmni-devel

1

Re: [PATCH readerview] gmni: fix building with bearssl-based gmni

Details
Message ID
<CDPAOPWKT8AE.37MQ80YXQFUN9@pine64-pinephone>
DKIM signature
missing
Download raw message
On Sun Aug 15, 2021 at 9:54 AM EDT, Jiri Vlasak wrote:
> > +		n = br_sslio_read(&resp->body, &contents[contents_length], contents_size - contents_length - 1);
> > +		/*if (n == -1) {
>
> This is maybe silly question, but why to commit comented code?
>

Definitely not a silly question, thanks for asking.

Umm, soo the way I developed this patch was in two steps:

1. Commenting out code until it compiled
2. Modifying commented until it worked

I didn't read the documentation for br_sslio_read. If it returns -1 on failure, then this should be uncommented.

So this patch isn't really production-worthy,
but there's also another reason why it isn't:

According to (https://lists.sr.ht/~sircmpwn/gmni-devel/%3CC9OP3QNDE38Y.2X56ETVQZRR7L%40taiga%3E),
clients using libgmni should have no need to interact with the ssl implementation directly.
This is not done yet.

We need to 

1. Expose relevant functions in libgmni
2. refactor gmni and gmnlm to use those functions
3. refactor readerview to use those functions instead of openssl/bearssl ones.

Re: [PATCH readerview] gmni: fix building with bearssl-based gmni

Details
Message ID
<CDPW9IOU09CI.BM1FYS0ZSUAS@taiga>
In-Reply-To
<CDPAOPWKT8AE.37MQ80YXQFUN9@pine64-pinephone> (view parent)
DKIM signature
pass
Download raw message
On Sat Aug 21, 2021 at 5:27 PM CEST, Zach DeCook wrote:
> On Sun Aug 15, 2021 at 9:54 AM EDT, Jiri Vlasak wrote:
> > > +		n = br_sslio_read(&resp->body, &contents[contents_length], contents_size - contents_length - 1);
> > > +		/*if (n == -1) {
> >
> > This is maybe silly question, but why to commit comented code?
> >
>
> Definitely not a silly question, thanks for asking.
>
> Umm, soo the way I developed this patch was in two steps:
>
> 1. Commenting out code until it compiled
> 2. Modifying commented until it worked

This is not how you write robust code.

> I didn't read the documentation for br_sslio_read.

This is also not how you write robust code.
Reply to thread Export thread (mbox)