/[svn]/ircd-hybrid/src/send.c
ViewVC logotype

Diff of /ircd-hybrid/src/send.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 627 by michael, Fri Apr 28 06:48:08 2006 UTC revision 628 by adx, Mon May 29 20:04:32 2006 UTC
# Line 103  send_message(struct Client *to, char *bu Line 103  send_message(struct Client *to, char *bu
103  {  {
104    assert(!IsMe(to));    assert(!IsMe(to));
105    assert(&me != to);    assert(&me != to);
106      assert(len <= IRCD_BUFSIZE);
107    
108    if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(to))    if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(to))
109    {    {
# Line 262  send_queued_write(struct Client *to) Line 263  send_queued_write(struct Client *to)
263          retlen = SSL_write(to->localClient->fd.ssl, first->data, first->size);          retlen = SSL_write(to->localClient->fd.ssl, first->data, first->size);
264    
265          /* translate openssl error codes, sigh */          /* translate openssl error codes, sigh */
266          if (retlen < 0)          if (retlen < 0)
267            switch (SSL_get_error(to->localClient->fd.ssl, retlen))            switch (SSL_get_error(to->localClient->fd.ssl, retlen))
268            {            {
269              case SSL_ERROR_WANT_READ:              case SSL_ERROR_WANT_READ:
270                return;  /* retry later, don't register for write events */                return;  /* retry later, don't register for write events */
271    
272              case SSL_ERROR_WANT_WRITE:              case SSL_ERROR_WANT_WRITE:
273                errno = EWOULDBLOCK;                errno = EWOULDBLOCK;
274              case SSL_ERROR_SYSCALL:              case SSL_ERROR_SYSCALL:
275                break;                break;
276              case SSL_ERROR_SSL:              case SSL_ERROR_SSL:
277                if (errno == EAGAIN)                if (errno == EAGAIN)
278                  break;                  break;
279              default:              default:
280                retlen = errno = 0;  /* either an SSL-specific error or EOF */                retlen = errno = 0;  /* either an SSL-specific error or EOF */
281            }            }
282        }        }
283        else        else
284  #endif  #endif
# Line 296  send_queued_write(struct Client *to) Line 297  send_queued_write(struct Client *to)
297        /* We have some data written .. update counters */        /* We have some data written .. update counters */
298        to->localClient->send.bytes += retlen;        to->localClient->send.bytes += retlen;
299        me.localClient->send.bytes += retlen;        me.localClient->send.bytes += retlen;
300      } while (dbuf_length(&to->localClient->buf_sendq));      }
301        while (dbuf_length(&to->localClient->buf_sendq));
302    
303      if ((retlen < 0) && (ignoreErrno(errno)))      if ((retlen < 0) && (ignoreErrno(errno)))
304      {      {
# Line 342  send_queued_slink_write(struct Client *t Line 344  send_queued_slink_write(struct Client *t
344        /* If we have a fatal error */        /* If we have a fatal error */
345        if (!ignoreErrno(errno))        if (!ignoreErrno(errno))
346        {        {
347          dead_link_on_write(to, errno);          dead_link_on_write(to, errno);
348          return;          return;
349        }        }
350      }      }
351      else if (retlen == 0)      else if (retlen == 0)

Legend:
Removed from v.627  
changed lines
  Added in v.628

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28