Fix gnutls write-before-negotiation case.

* gnutls.c (emacs_gnutls_write): If we're trying to write before
gnutls is ready, return EAGAIN as the errno.
This commit is contained in:
Lars Magne Ingebrigtsen 2010-10-10 20:47:45 +02:00
parent edfd76ce91
commit 355cdaf37b
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2010-10-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnutls.c (emacs_gnutls_write): If we're trying to write before
gnutls is ready, return EAGAIN as the errno.
2010-10-10 Dan Nicolaescu <dann@ics.uci.edu>
* vm-limit.c:

View file

@ -77,8 +77,15 @@ emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf,
register int rtnval, bytes_written;
gnutls_session_t state = proc->gnutls_state;
if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
if (proc->gnutls_initstage != GNUTLS_STAGE_READY) {
#ifdef EWOULDBLOCK
errno = EWOULDBLOCK;
#endif
#ifdef EAGAIN
errno = EAGAIN;
#endif
return -1;
}
bytes_written = 0;