- Srv->Log(DEBUG,"Ident: failed to get socket names, bailing to state 3");
- shutdown(this->fd,2);
- close(this->fd);
- this->fd = -1;
- state = IDENT_STATE_DONE;
- }
- else
- {
- // send the request in the following format: theirsocket,oursocket
- snprintf(ident_request,127,"%d,%d\r\n",ntohs(sock_them.sin_port),ntohs(sock_us.sin_port));
- send(this->fd,ident_request,strlen(ident_request),0);
- Srv->Log(DEBUG,"Sent ident request, moving to state 2");
- state = IDENT_STATE_WAITDATA;
- }
- break;
- case IDENT_STATE_WAITDATA:
- nrecv = recv(this->fd,ibuf,sizeof(ibuf),0);
- if (nrecv > 0)
- {
- // we have the response line in the following format:
- // 6193, 23 : USERID : UNIX : stjohns
- // 6195, 23 : ERROR : NO-USER
- ibuf[nrecv] = '\0';
- Srv->Log(DEBUG,"Received ident response: "+std::string(ibuf));
- shutdown(this->fd,2);
- close(this->fd);
- this->fd = -1;
- char* savept;
- char* section = strtok_r(ibuf,":",&savept);
- while (section)
+ // ID type, usually UNIX or OTHER... we dont want it, so read the next token
+ section = strtok_r(NULL,":",&savept);
+ if (section)