Changeset 915
- Timestamp:
- 11/07/06 09:39:47 (2 years ago)
- Files:
-
- trunk/pdns/pdns/pdns_recursor.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/pdns_recursor.cc
r903 r915 653 653 conn->state=TCPConnection::BYTE1; 654 654 if(bytes==2) { 655 conn->qlen=( conn->data[0]<<8)+conn->data[1];655 conn->qlen=(((unsigned char)conn->data[0]) << 8)+ (unsigned char)conn->data[1]; 656 656 conn->bytesread=0; 657 657 conn->state=TCPConnection::GETQUESTION; … … 665 665 } 666 666 else if(conn->state==TCPConnection::BYTE1) { 667 int bytes=recv(conn->fd, conn->data+1,1,0);667 int bytes=recv(conn->fd, conn->data+1, 1, 0); 668 668 if(bytes==1) { 669 669 conn->state=TCPConnection::GETQUESTION; 670 conn->qlen=( conn->data[0]<<8)+conn->data[1];670 conn->qlen=(((unsigned char)conn->data[0]) << 8)+ (unsigned char)conn->data[1]; 671 671 conn->bytesread=0; 672 672 } … … 681 681 } 682 682 else if(conn->state==TCPConnection::GETQUESTION) { 683 int bytes=recv(conn->fd, conn->data + conn->bytesread,conn->qlen - conn->bytesread, 0);683 int bytes=recv(conn->fd, conn->data + conn->bytesread, conn->qlen - conn->bytesread, 0); 684 684 if(!bytes || bytes < 0) { 685 685 L<<Logger::Error<<"TCP client "<< conn->remote.toString() <<" disconnected while reading question body"<<endl;