/[svn]/ircd-hybrid/branches/8.2.x/src/packet.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.2.x/src/packet.c

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

revision 3453 by michael, Thu Apr 24 16:15:51 2014 UTC revision 3454 by michael, Thu May 1 19:31:23 2014 UTC
# Line 86  extract_one_line(struct dbuf_queue *qptr Line 86  extract_one_line(struct dbuf_queue *qptr
86        if (IsEol(c) || (c == ' ' && phase != 1))        if (IsEol(c) || (c == ' ' && phase != 1))
87        {        {
88          ++empty_bytes;          ++empty_bytes;
89    
90          if (phase == 1)          if (phase == 1)
91            phase = 2;            phase = 2;
92        }        }
# Line 129  parse_client_queued(struct Client *clien Line 130  parse_client_queued(struct Client *clien
130    {    {
131      int i = 0;      int i = 0;
132    
133      for (; ;)      while (1)
134      {      {
135        if (IsDefunct(client_p))        if (IsDefunct(client_p))
136          return;          return;
# Line 148  parse_client_queued(struct Client *clien Line 149  parse_client_queued(struct Client *clien
149        /* if they've dropped out of the unknown state, break and move        /* if they've dropped out of the unknown state, break and move
150         * to the parsing for their appropriate status.  --fl         * to the parsing for their appropriate status.  --fl
151         */         */
152        if(!IsUnknown(client_p))        if (!IsUnknown(client_p))
153          break;          break;
154      }      }
155    }    }
# Line 159  parse_client_queued(struct Client *clien Line 160  parse_client_queued(struct Client *clien
160      {      {
161        if (IsDefunct(client_p))        if (IsDefunct(client_p))
162          return;          return;
163        if ((dolen = extract_one_line(&lclient_p->buf_recvq,        if ((dolen = extract_one_line(&lclient_p->buf_recvq, readBuf)) == 0)
                                     readBuf)) == 0)  
164          break;          break;
165    
166        client_dopacket(client_p, readBuf, dolen);        client_dopacket(client_p, readBuf, dolen);
167      }      }
168    }    }
# Line 180  parse_client_queued(struct Client *clien Line 181  parse_client_queued(struct Client *clien
181       * messages in this loop, we simply drop out of the loop prematurely.       * messages in this loop, we simply drop out of the loop prematurely.
182       *   -- adrian       *   -- adrian
183       */       */
184      for (; ;)      while (1)
185      {      {
186        if (IsDefunct(client_p))        if (IsDefunct(client_p))
187          break;          break;
# Line 200  parse_client_queued(struct Client *clien Line 201  parse_client_queued(struct Client *clien
201         */         */
202        if (checkflood > 0)        if (checkflood > 0)
203        {        {
204          if(lclient_p->sent_parsed >= lclient_p->allow_read)          if (lclient_p->sent_parsed >= lclient_p->allow_read)
205            break;            break;
206        }        }
207    
208        /* allow opers 4 times the amount of messages as users. why 4?        /* allow opers 4 times the amount of messages as users. why 4?
209         * why not. :) --fl_         * why not. :) --fl_
210         */         */
211        else if (lclient_p->sent_parsed >= (4 * lclient_p->allow_read) &&        else if (lclient_p->sent_parsed >= (4 * lclient_p->allow_read) && checkflood != -1)
                checkflood != -1)  
212          break;          break;
213    
214        dolen = extract_one_line(&lclient_p->buf_recvq, readBuf);        dolen = extract_one_line(&lclient_p->buf_recvq, readBuf);
# Line 294  read_packet(fde_t *fd, void *data) Line 294  read_packet(fde_t *fd, void *data)
294  #ifdef HAVE_LIBCRYPTO  #ifdef HAVE_LIBCRYPTO
295      if (fd->ssl)      if (fd->ssl)
296      {      {
297        length = SSL_read(fd->ssl, readBuf, READBUF_SIZE);        length = SSL_read(fd->ssl, readBuf, sizeof(readBuf));
298    
299        /* translate openssl error codes, sigh */        /* translate openssl error codes, sigh */
300        if (length < 0)        if (length < 0)
# Line 317  read_packet(fde_t *fd, void *data) Line 317  read_packet(fde_t *fd, void *data)
317      else      else
318  #endif  #endif
319      {      {
320        length = recv(fd->fd, readBuf, READBUF_SIZE, 0);        length = recv(fd->fd, readBuf, sizeof(readBuf), 0);
321      }      }
322    
323      if (length <= 0)      if (length <= 0)
# Line 339  read_packet(fde_t *fd, void *data) Line 339  read_packet(fde_t *fd, void *data)
339        client_p->localClient->lasttime = CurrentTime;        client_p->localClient->lasttime = CurrentTime;
340      if (client_p->localClient->lasttime > client_p->localClient->since)      if (client_p->localClient->lasttime > client_p->localClient->since)
341        client_p->localClient->since = CurrentTime;        client_p->localClient->since = CurrentTime;
342    
343      ClearPingSent(client_p);      ClearPingSent(client_p);
344    
345      /* Attempt to parse what we have */      /* Attempt to parse what we have */

Legend:
Removed from v.3453  
changed lines
  Added in v.3454

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