[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs core TLS support
From: |
Andreas Schwab |
Subject: |
Re: Emacs core TLS support |
Date: |
Mon, 06 Sep 2010 17:53:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Ted Zlatanov <address@hidden> writes:
>>> +DEFUN ("gnutls-init", Fgnutls_init, Sgnutls_init, 2, 2, 0,
> ...
>>> + ret = gnutls_init((gnutls_session_t*)&(XPROCESS(proc)->gnutls_state),
>
> AS> Aliasing violation.
>
> Can you explain please?
The function wants to store a value of one type into an object of a
different type. BAD. The compiler is allowed to assume the object was
never changed.
> AS> IMHO all your functions should return t on success and either some error
> AS> symbol on failure or even raise an error.
>
> Yes, but I'm not sure which one. Can you recommend?
Take your pick. I don't know anything about gnutls.
>>> === modified file 'src/process.h'
>>> +
>>> +#ifdef HAVE_GNUTLS
>>> + /* XXX Store GNU TLS state and auth mechanisms in Lisp_Objects. */
>>> + Lisp_Object gnutls_state;
>>> + Lisp_Object x509_cred, x509_callback;
>>> + Lisp_Object anon_cred;
>>> + Lisp_Object srp_cred;
>>> +#endif
>
> AS> None of them should be Lisp_Objects. Also make sure the resources are
> AS> properly released when the process object is deleted.
>
> I don't know enough (the choice of using Lisp_Objects was in the
> original patch) to know what to do instead of using Lisp_Objects. Why
> not, first of all?
You never store Lisp_Object values in there, so what's the point?
x509_callback is never used, btw.
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Re: Emacs core TLS support, Andreas Schwab, 2010/09/05
- Message not available
- Re: Emacs core TLS support, Stefan Monnier, 2010/09/06
- Re: Emacs core TLS support, Ted Zlatanov, 2010/09/06
- re: Emacs core TLS support, Ted Zlatanov, 2010/09/11
- Re: Emacs core TLS support, Ted Zlatanov, 2010/09/11
- Re: Emacs core TLS support, Stefan Monnier, 2010/09/12
- Re: Emacs core TLS support, Ted Zlatanov, 2010/09/14
- Re: Emacs core TLS support, Nikos Mavrogiannopoulos, 2010/09/13
- Re: Emacs core TLS support, Ted Zlatanov, 2010/09/14