[OTR-dev] proposed API change

Ian Goldberg ian at cypherpunks.ca
Wed Jan 26 09:59:54 EST 2005


On Tue, Jan 25, 2005 at 07:26:17PM -0800, Adam Fritzler wrote:
> 
> I'm new here, but I just happened to see Ian's last post about making an
> API change and wanted to recommend another.
> 
> libotr currently keeps at least two (at first glance at least, maybe
> there's more) globals.  I think it's generally frowned upon to have
> libraries with internal globals, and for the thing I'm working on it,
> it is kind of annoying.  I'm working on a proxy solution[1] that
> potentially has several entirely unrelated users coexisting.  In an
> optimal environment, you of course wouldn't use a "public service" proxy
> to do your crypto, but the APIs are such that it'd be a lot less
> annoying if libotr didn't keep globals, even for the single-user case.
> As it stands now, the private key files and fingerprint store must be
> shared by anyone who uses the proxy!
> 
> I suggest making a "libotr context" struct that gets passed to all
> functions, and moving the globals to there.  It's a straightforward
> change, but I can make a patch if necessary. 

In fact I noticed this idea on your blog entry yesterday, and thought it
was a good one.  It's just about done being implemented now.  :-)

   - Ian



More information about the OTR-dev mailing list