- case I_RESOLVING:
- log(DEBUG,"State = I_RESOLVING, calling DoResolve()");
- return this->DoResolve();
- break;
- case I_CONNECTING:
- log(DEBUG,"State = I_CONNECTING");
- this->SetState(I_CONNECTED);
- /* Our socket was in write-state, so delete it and re-add it
- * in read-state.
- */
- ServerInstance->SE->DelFd(this->fd);
- ServerInstance->SE->AddFd(this->fd,true,X_ESTAB_MODULE);
- return this->OnConnected();
- break;
- case I_LISTENING:
- length = sizeof (client);
- incoming = accept (this->fd, (sockaddr*)&client,&length);
- this->SetQueues(incoming);
- this->OnIncomingConnection(incoming,inet_ntoa(client.sin_addr));
- return true;
- break;
- case I_CONNECTED:
- n = this->OnDataReady();
- /* Flush any pending, but not till after theyre done with the event
- * so there are less write calls involved.
- * Both FlushWriteBuffer AND the return result of OnDataReady must
- * return true for this to be ok.
- */
- return (n && !this->FlushWriteBuffer());
- break;
- default:
- break;
+ irc::sockets::aptosa(mask, 0, sa);
+ sa2cidr(*this, sa, 128);
+ }
+ else
+ {
+ int range = ConvToInt(mask.substr(bits_chars + 1));
+ irc::sockets::aptosa(mask.substr(0, bits_chars), 0, sa);
+ sa2cidr(*this, sa, range);