1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 17:43:12 +02:00

- Port the SSL code over to the evented I/O subsystem.

This commit is contained in:
William Pitcock
2012-10-05 14:19:54 +00:00
parent 97b643aad7
commit 25318ec24b
5 changed files with 102 additions and 108 deletions
+24 -2
View File
@@ -85,8 +85,30 @@ int deliver_it(aClient *cptr, char *str, int len)
}
#ifdef USE_SSL
if (cptr->flags & FLAGS_SSL)
retval = ircd_SSL_write(cptr, str, len);
if (IsSSL(cptr) && cptr->ssl != NULL)
{
retval = SSL_write(cptr->ssl, str, len);
if (retval < 0)
{
switch (SSL_get_error(cptr->ssl, retval))
{
case SSL_ERROR_WANT_READ:
/* retry later */
return 0;
case SSL_ERROR_WANT_WRITE:
SET_ERRNO(P_EWOULDBLOCK);
break;
case SSL_ERROR_SYSCALL:
break;
case SSL_ERROR_SSL:
if (ERRNO == P_EAGAIN)
break;
default:
return 0;
}
}
}
else
#endif
retval = send(cptr->fd, str, len, 0);