gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Request for Feedback: new BIO API


From: Alessio Vanni
Subject: Re: Request for Feedback: new BIO API
Date: Thu, 14 May 2020 16:17:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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.

Attachment: 0001-Improved-BIO-API.patch
Description: patch for GNUnet


reply via email to

[Prev in Thread] Current Thread [Next in Thread]