summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-16 11:20:45 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-16 11:20:45 +0000
commit99c1d61eca2bdf19939a72ad00124c1f7e58845a (patch)
treea0d596692eca0654d16fc134dcf1ec16eb77bcde /src/inspircd.cpp
parentac60f15b03d248318e9378ce2abfb7c9a1663dd4 (diff)
Added various routing tokens (such as 'R' redirect message)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@610 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 07e04fad1..254723389 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -2819,7 +2819,6 @@ bool process_module_umode(char umode, userrec* source, void* dest, bool adding)
}
else
{
- log(DEBUG,"*** BUG *** Non-module umode passed to process_module_umode!");
if (faked)
{
delete s2;
@@ -5450,7 +5449,7 @@ void handle_oper(char **parameters, int pcnt, userrec *user)
{
/* found this oper's opertype */
ConfValue("type","host",j,Hostname,&config_f);
- strncpy(user->dhost,Hostname,256);
+ ChangeDisplayedHost(user,Hostname);
}
}
if (!strchr(user->modes,'o'))
@@ -6401,6 +6400,13 @@ void handle_plus(char token,char* params,serverrec* source,serverrec* reply, cha
log(DEBUG," ");
}
+void handle_R(char token,char* params,serverrec* source,serverrec* reply, char* udp_host)
+{
+ char* server = strtok(params," ");
+ char* data = strtok(NULL,"\r\n");
+ log(DEBUG,"Forwarded packet '%s' to '%s'",data,server);
+ NetSendToOne(server,data);
+}
void handle_J(char token,char* params,serverrec* source,serverrec* reply, char* udp_host)
{
@@ -6490,6 +6496,12 @@ void process_restricted_commands(char token,char* params,serverrec* source,serve
case '+':
handle_plus(token,params,source,reply,udp_host);
break;
+ // R <server> <data>
+ // redirect token, send all of <data> along to the given
+ // server as this server has been found to still have a route to it
+ case 'R':
+ handle_R(token,params,source,reply,udp_host);
+ break;
// ?
// ping
case '?':
@@ -7004,7 +7016,7 @@ int InspIRCd(void)
// *FIX* Instead of closing sockets in kill_link when they receive the ERROR :blah line, we should queue
// them in a list, then reap the list every second or so.
- if (reap_counter>5000)
+ if (reap_counter>2500)
{
if (fd_reap.size() > 0)
{
@@ -7018,6 +7030,7 @@ int InspIRCd(void)
fd_reap.clear();
reap_counter=0;
}
+ reap_counter++;
fd_set serverfds;
FD_ZERO(&serverfds);
@@ -7067,7 +7080,7 @@ int InspIRCd(void)
char udp_msg[MAXBUF];
strncpy(udp_msg,msgs[ctr].c_str(),MAXBUF);
if (strlen(udp_msg)<1)
- {
+ {
log(DEBUG,"Invalid string from %s [route%d]",udp_host,x);
break;
}
@@ -7262,7 +7275,6 @@ int InspIRCd(void)
FD_SET (openSockfd[count], &selectFds);
}
- reap_counter++;
tv.tv_usec = 1;
selectResult = select(MAXSOCKS, &selectFds, NULL, NULL, &tv);