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 2916 by michael, Sat Jan 25 21:09:18 2014 UTC vs.
Revision 3107 by michael, Thu Mar 6 12:09:42 2014 UTC

# Line 55 | Line 55 | static void client_dopacket(struct Clien
55   static int
56   extract_one_line(struct dbuf_queue *qptr, char *buffer)
57   {
58  struct dbuf_block *block;
58    int line_bytes = 0, empty_bytes = 0, phase = 0;
59 <  unsigned int idx;
60 <
62 <  char c;
63 <  dlink_node *ptr;
59 >  unsigned int idx = 0;
60 >  dlink_node *ptr = NULL;
61  
62    /*
63     * Phase 0: "empty" characters before the line
# Line 76 | Line 73 | extract_one_line(struct dbuf_queue *qptr
73     */
74    DLINK_FOREACH(ptr, qptr->blocks.head)
75    {
76 <    block = ptr->data;
76 >    struct dbuf_block *block = ptr->data;
77 >
78 >    if (ptr == qptr->blocks.head)
79 >      idx = qptr->pos;
80 >    else
81 >      idx = 0;
82  
83 <    for (idx = 0; idx < block->size; idx++)
83 >    for (; idx < block->size; ++idx)
84      {
85 <      c = block->data[idx];
85 >      char c = block->data[idx];
86 >
87        if (IsEol(c) || (c == ' ' && phase != 1))
88        {
89 <        empty_bytes++;
89 >        ++empty_bytes;
90          if (phase == 1)
91            phase = 2;
92        }
# Line 113 | Line 116 | extract_one_line(struct dbuf_queue *qptr
116    dbuf_delete(qptr, line_bytes + empty_bytes);
117    return IRCD_MIN(line_bytes, IRCD_BUFSIZE - 2);
118   }
116
119   /*
120   * parse_client_queued - parse client queued messages
121   */
# Line 332 | Line 334 | read_packet(fde_t *fd, void *data)
334        return;
335      }
336  
337 <    dbuf_put(&client_p->localClient->buf_recvq, readBuf, length);
337 >    dbuf_put_raw(&client_p->localClient->buf_recvq, readBuf, length);
338  
339      if (client_p->localClient->lasttime < CurrentTime)
340        client_p->localClient->lasttime = CurrentTime;

Diff Legend

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