All pastes #746330 Raw Edit

Something

public text v1 · immutable
·published 2007-10-23 04:16 UTC
rendered paste body
int connection::readline(){
        char temp[512],temp2[512];
        int mark=0;
        char *saveptr;
        int bytes=1;
                bytes=recv(this->fd,temp2,512,MSG_PEEK);
                temp2[bytes]=0;
                if ((temp2[0]=='\r') || (temp2[0]=='\n')){
                        bytes=recv(this->fd,temp,1,0);
                        //printf("skiped char 0x%x\n",temp2[0]);
                        return 1;
                }
                //printf("%s\n",temp2);
                mark=strcspn(temp2,"\n\r");
                temp2[mark]='X';
                //printf("%s\n",temp2);
                bytes=recv(this->fd,temp,mark,0);
                temp[bytes]=0;
                //printf("got '%s'\n",temp);
                this->parse(temp);
                return bytes;
}