-References awaymsg, connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, dhost, dns_done, connection::fd, flood, fullname, connection::haspassed, connection::host, ident, connection::idle_lastmsg, connection::inbuf, invites, connection::ip, connection::lastping, lines_in, modes, nick, connection::nping, oper, connection::port, recvq, connection::registered, reset_due, result, sendq, server, connection::signon, TIME, timeout, and ucrec::uc_modes.
+References awaymsg, connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, dhost, dns_done, connection::fd, flood, fullname, connection::haspassed, connection::host, ident, connection::idle_lastmsg, invites, connection::ip, connection::lastping, lines_in, modes, nick, connection::nping, oper, connection::port, recvq, connection::registered, reset_due, result, sendq, server, connection::signon, TIME, timeout, and ucrec::uc_modes.
-39 strcpy(inbuf,'');
-40 strcpy(server,'');
-41 strcpy(awaymsg,'');
-42 strcpy(oper,'');
-43 reset_due = TIME;
-44 lines_in = 0;
-45 fd = lastping = signon = idle_lastmsg = nping = registered = 0;
-46 flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
-47 haspassed = false;
-48 dns_done = false;
-49 recvq = '';
-50 sendq = '';
-51 strcpy(result,'');
-52 for (int i = 0; i < MAXCHANS; i++)
-53 {
-54 this->chans[i].channel = NULL;
-55 this->chans[i].uc_modes = 0;
-56 }
-57 invites.clear();
-58 }
+39 strcpy(server,'');
+40 strcpy(awaymsg,'');
+41 strcpy(oper,'');
+42 reset_due = TIME;
+43 lines_in = 0;
+44 fd = lastping = signon = idle_lastmsg = nping = registered = 0;
+45 flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
+46 haspassed = false;
+47 dns_done = false;
+48 recvq = '';
+49 sendq = '';
+50 strcpy(result,'');
+51 for (int i = 0; i < MAXCHANS; i++)
+52 {
+53 this->chans[i].channel = NULL;
+54 this->chans[i].uc_modes = 0;
+55 }
+56 invites.clear();
+57 }
-171 {
-172 std::string b = '';
-173 for (int i = 0; i < a.length(); i++)
-174 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7))
-175 b = b + a[i];
-176 std::stringstream stream(recvq);
-177 stream << b;
-178 recvq = stream.str();
-179 int i = 0;
-180 // count the size of the first line in the buffer.
-181 while (i < recvq.length())
-182 {
-183 if (recvq[i++] == '\n')
-184 break;
-185 }
-186 if (recvq.length() > this->recvqmax)
-187 {
-188 this->SetWriteError('RecvQ exceeded');
-189 WriteOpers('*** User %s RecvQ of %d exceeds connect class maximum of %d',this->nick,recvq.length(),this->recvqmax);
-190 }
-191 // return false if we've had more than 600 characters WITHOUT
-192 // a carriage return (this is BAD, drop the socket)
-193 return (i < 600);
-194 }
+170 {
+171 std::string b = '';
+172 for (int i = 0; i < a.length(); i++)
+173 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7))
+174 b = b + a[i];
+175 std::stringstream stream(recvq);
+176 stream << b;
+177 recvq = stream.str();
+178 int i = 0;
+179 // count the size of the first line in the buffer.
+180 while (i < recvq.length())
+181 {
+182 if (recvq[i++] == '\n')
+183 break;
+184 }
+185 if (recvq.length() > this->recvqmax)
+186 {
+187 this->SetWriteError('RecvQ exceeded');
+188 WriteOpers('*** User %s RecvQ of %d exceeds connect class maximum of %d',this->nick,recvq.length(),this->recvqmax);
+189 }
+190 // return false if we've had more than 600 characters WITHOUT
+191 // a carriage return (this is BAD, drop the socket)
+192 return (i < 600);
+193 }
-227 {
-228 if (this->GetWriteError() != '')
-229 return;
-230 if (sendq.length() + data.length() > this->sendqmax)
-231 {
-232 WriteOpers('*** User %s SendQ of %d exceeds connect class maximum of %d',this->nick,sendq.length() + data.length(),this->sendqmax);
-233 this->SetWriteError('SendQ exceeded');
-234 return;
-235 }
-236 std::stringstream stream;
-237 stream << sendq << data;
-238 sendq = stream.str();
-239 }
+226 {
+227 if (this->GetWriteError() != '')
+228 return;
+229 if (sendq.length() + data.length() > this->sendqmax)
+230 {
+231 WriteOpers('*** User %s SendQ of %d exceeds connect class maximum of %d',this->nick,sendq.length() + data.length(),this->sendqmax);
+232 this->SetWriteError('SendQ exceeded');
+233 return;
+234 }
+235 std::stringstream stream;
+236 stream << sendq << data;
+237 sendq = stream.str();
+238 }
-243 {
-244 if (sendq.length())
-245 {
-246 char* tb = (char*)this->sendq.c_str();
-247 int n_sent = write(this->fd,tb,this->sendq.length());
-248 if (n_sent == -1)
-249 {
-250 this->SetWriteError(strerror(errno));
-251 }
-252 else
-253 {
-254 // advance the queue
-255 tb += n_sent;
-256 this->sendq = tb;
-257 // update the user's stats counters
-258 this->bytes_out += n_sent;
-259 this->cmds_out++;
-260 }
-261 }
-262 }
+242 {
+243 if (sendq.length())
+244 {
+245 char* tb = (char*)this->sendq.c_str();
+246 int n_sent = write(this->fd,tb,this->sendq.length());
+247 if (n_sent == -1)
+248 {
+249 this->SetWriteError(strerror(errno));
+250 }
+251 else
+252 {
+253 // advance the queue
+254 tb += n_sent;
+255 this->sendq = tb;
+256 // update the user's stats counters
+257 this->bytes_out += n_sent;
+258 this->cmds_out++;
+259 }
+260 }
+261 }
-119 {
-120 char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
-121 char* mycmd;
-122 char* savept;
-123 char* savept2;
-124
-125 // are they even an oper at all?
-126 if (strchr(this->modes,'o'))
-127 {
-128 log(DEBUG,'*** HasPermission: %s is an oper',this->nick);
-129 for (int j =0; j < ConfValueEnum('type',&config_f); j++)
-130 {
-131 ConfValue('type','name',j,TypeName,&config_f);
-132 if (!strcmp(TypeName,this->oper))
-133 {
-134 log(DEBUG,'*** HasPermission: %s is an oper of type '%s'',this->nick,this->oper);
-135 ConfValue('type','classes',j,Classes,&config_f);
-136 char* myclass = strtok_r(Classes,' ',&savept);
-137 while (myclass)
-138 {
-139 log(DEBUG,'*** HasPermission: checking classtype '%s'',myclass);
-140 for (int k =0; k < ConfValueEnum('class',&config_f); k++)
-141 {
-142 ConfValue('class','name',k,ClassName,&config_f);
-143 if (!strcmp(ClassName,myclass))
-144 {
-145 ConfValue('class','commands',k,CommandList,&config_f);
-146 log(DEBUG,'*** HasPermission: found class named %s with commands: '%s'',ClassName,CommandList);
+118 {
+119 char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
+120 char* mycmd;
+121 char* savept;
+122 char* savept2;
+123
+124 // are they even an oper at all?
+125 if (strchr(this->modes,'o'))
+126 {
+127 log(DEBUG,'*** HasPermission: %s is an oper',this->nick);
+128 for (int j =0; j < ConfValueEnum('type',&config_f); j++)
+129 {
+130 ConfValue('type','name',j,TypeName,&config_f);
+131 if (!strcmp(TypeName,this->oper))
+132 {
+133 log(DEBUG,'*** HasPermission: %s is an oper of type '%s'',this->nick,this->oper);
+134 ConfValue('type','classes',j,Classes,&config_f);
+135 char* myclass = strtok_r(Classes,' ',&savept);
+136 while (myclass)
+137 {
+138 log(DEBUG,'*** HasPermission: checking classtype '%s'',myclass);
+139 for (int k =0; k < ConfValueEnum('class',&config_f); k++)
+140 {
+141 ConfValue('class','name',k,ClassName,&config_f);
+142 if (!strcmp(ClassName,myclass))
+143 {
+144 ConfValue('class','commands',k,CommandList,&config_f);
+145 log(DEBUG,'*** HasPermission: found class named %s with commands: '%s'',ClassName,CommandList);
+146
-148
-149 mycmd = strtok_r(CommandList,' ',&savept2);
-150 while (mycmd)
-151 {
-152 if (!strcasecmp(mycmd,command))
-153 {
-154 log(DEBUG,'*** Command %s found, returning true',command);
-155 return true;
-156 }
-157 mycmd = strtok_r(NULL,' ',&savept2);
-158 }
-159 }
-160 }
-161 myclass = strtok_r(NULL,' ',&savept);
-162 }
-163 }
-164 }
-165 }
-166 return false;
-167 }
+148 mycmd = strtok_r(CommandList,' ',&savept2);
+149 while (mycmd)
+150 {
+151 if (!strcasecmp(mycmd,command))
+152 {
+153 log(DEBUG,'*** Command %s found, returning true',command);
+154 return true;
+155 }
+156 mycmd = strtok_r(NULL,' ',&savept2);
+157 }
+158 }
+159 }
+160 myclass = strtok_r(NULL,' ',&savept);
+161 }
+162 }
+163 }
+164 }
+165 return false;
+166 }
-265 {
-266 log(DEBUG,'Setting error string for %s to '%s'',this->nick,error.c_str());
-267 // don't try to set the error twice, its already set take the first string.
-268 if (this->WriteError == '')
-269 this->WriteError = error;
-270 }
+264 {
+265 log(DEBUG,'Setting error string for %s to '%s'',this->nick,error.c_str());
+266 // don't try to set the error twice, its already set take the first string.
+267 if (this->WriteError == '')
+268 this->WriteError = error;
+269 }