ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/packet.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/packet.c (file contents):
Revision 1632 by michael, Sun Nov 4 15:37:10 2012 UTC vs.
Revision 2881 by michael, Mon Jan 20 17:15:39 2014 UTC

# Line 39 | Line 39
39  
40   #define READBUF_SIZE 16384
41  
42 struct Callback *iorecv_cb = NULL;
43
42   static char readBuf[READBUF_SIZE];
43   static void client_dopacket(struct Client *, char *, size_t);
44  
# Line 271 | Line 269 | flood_recalc(fde_t *fd, void *data)
269   }
270  
271   /*
274 * iorecv_default - append a packet to the recvq dbuf
275 */
276 void *
277 iorecv_default(va_list args)
278 {
279  struct Client *client_p = va_arg(args, struct Client *);
280  int length = va_arg(args, int);
281  char *buf = va_arg(args, char *);
282
283  dbuf_put(&client_p->localClient->buf_recvq, buf, length);
284  return NULL;
285 }
286
287 /*
272   * read_packet - Read a 'packet' of data from a connection and process it.
273   */
274   void
# Line 310 | Line 294 | read_packet(fde_t *fd, void *data)
294        /* translate openssl error codes, sigh */
295        if (length < 0)
296          switch (SSL_get_error(fd->ssl, length))
297 <        {
297 >        {
298            case SSL_ERROR_WANT_WRITE:
299 <            fd->flags.pending_read = 1;
300 <            SetSendqBlocked(client_p);
301 <            comm_setselect(fd, COMM_SELECT_WRITE, (PF *) sendq_unblocked,
302 <                           client_p, 0);
319 <            return;
320 <          case SSL_ERROR_WANT_READ:
321 <            errno = EWOULDBLOCK;
299 >            comm_setselect(fd, COMM_SELECT_WRITE, (PF *)sendq_unblocked, client_p, 0);
300 >            return;
301 >          case SSL_ERROR_WANT_READ:
302 >              errno = EWOULDBLOCK;
303            case SSL_ERROR_SYSCALL:
304 <            break;
304 >              break;
305            case SSL_ERROR_SSL:
306              if (errno == EAGAIN)
307                break;
308            default:
309 <            length = errno = 0;
310 <        }
309 >            length = errno = 0;
310 >        }
311      }
312      else
313   #endif
# Line 347 | Line 328 | read_packet(fde_t *fd, void *data)
328        return;
329      }
330  
331 <    execute_callback(iorecv_cb, client_p, length, readBuf);
331 >    dbuf_put(&client_p->localClient->buf_recvq, readBuf, length);
332  
333      if (client_p->localClient->lasttime < CurrentTime)
334        client_p->localClient->lasttime = CurrentTime;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)