[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Request for Feedback: new BIO API
From: |
Christian Grothoff |
Subject: |
Re: Request for Feedback: new BIO API |
Date: |
Sat, 16 May 2020 00:09:14 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Hi Alessio,
This looks indeed perfect to me, modulo possibly one issue that is
totally unrelated to the design and more like a legacy bug you're copying:
https://en.wikipedia.org/wiki/Endianness#Floating_point
implies that we should actually also do network byte order conversions
on double and float, instead of copying them 1:1 into the byte stream.
But that is an _existing_ bug in BIO I just noticed while reading your
patch ;-).
Otherwise, very nice. The BIO part is IMO ready, but obviously the rest
of the code needs to be (slightly) adjusted to match the API change
before we can merge this.
Happy hacking!
Christian
On 5/14/20 4:17 PM, Alessio Vanni wrote:
> Hello,
>
> the patch attached to this e-mail is another attempt at improving BIO,
> using Christian's suggestions.
>
> It adds a read/write spec API based on callbacks, read/write operations
> on in-memory buffers and adds a new API to "gnunet_buffer_lib.h".
>
> Some things addressed below:
>
> Christian Grothoff <address@hidden> writes:
>
>> Indeed, simply adding a GNUNET_buffer_reap() that returns a void * +
>> size_t instead of a C-string would do the trick, and should be trivial.
>
> I implemented this function, but also changed
>
> *buf = struct GNUNET_Buffer { 0 };
>
> and similar to a call to `memset'.
>
> I did this because I wasn't 100% sure about handling a `GNUNET_Buffer'
> inside `GNUNET_BIO_WriteHandle' the way it was suggested in
> "gnunet_buffer_lib.h", so I took the easy way out and allocated the
> buffer dynamically. Because the assignment would change the pointer, a
> slightly more expensive call to `memset' is used.
>
> Slightly OT:
>> Likely firemail.cc runs some way too aggressive spam filter? Anyway,
>> cc'ing you directly may help...
>
> The fact is, I also receive my own mails to the list and when I sent the
> very first mail I didn't get anything. That was what prompted me to
> check the web archive. Anyway, I received my second mail (the one you
> replied to) so everything seems to be fixed, whatever the problem was.
>
> Thanks,
> A.V.
>
signature.asc
Description: OpenPGP digital signature
- Request for Feedback: new BIO API, Alessio Vanni, 2020/05/09
- Re: Request for Feedback: new BIO API, Alessio Vanni, 2020/05/11
- Re: Request for Feedback: new BIO API, Christian Grothoff, 2020/05/11
- Re: Request for Feedback: new BIO API, Alessio Vanni, 2020/05/14
- Re: Request for Feedback: new BIO API,
Christian Grothoff <=
- Re: Request for Feedback: new BIO API, Alessio Vanni, 2020/05/15
- Re: Request for Feedback: new BIO API, Christian Grothoff, 2020/05/17
- Re: Request for Feedback: new BIO API, Alessio Vanni, 2020/05/18
- Re: Request for Feedback: new BIO API, Christian Grothoff, 2020/05/18