Fixed two places where the client compared the source of a numeric against

get_server_name(from_server) instead of get_server_itsname(from_server) -
this meant that if the client had a different idea of the local server name
from the server (say, if you used a round-robin to connect), then the client
would incorrectly assume the numeric came from a remote server.

The symptoms were:

 * If your local server sent you a "you're not op" type message, BitchX would
report the channel had desynched.

 * If your local server send you a "channel doesn't exist" numeric (eg. if
you typed /mode #nosuchchannel to see if it existed), BitchX would not show
it. 


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@71 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2009-09-19 14:24:15 +00:00
parent e338d2d9fd
commit 771b2af59d
2 changed files with 16 additions and 14 deletions

View File

@@ -1,5 +1,10 @@
[Changes 1.2c01 ] [Changes 1.2c01 ]
* Fixed two cases where the client was incorrectly deciding that a numeric
originated from a remote server rather than the local server - this caused
BitchX to falsely report channel desynch and incorrectly hide some
numerics. (caf)
* Fixed $servernum() scripting function, it was returning the wrong server * Fixed $servernum() scripting function, it was returning the wrong server
reference in most cases. (caf) reference in most cases. (caf)

View File

@@ -224,17 +224,17 @@ static int check_server_sync(char *from, char **ArgList)
{ {
static char *desync = NULL; static char *desync = NULL;
/* If we get a "permission denied" type numeric from a _remote_ server,
if (!desync || (desync && !wild_match(desync, from))) * then it means the network is desyched.
{ */
if (!wild_match(from, get_server_name(from_server))) if (my_stricmp(from, get_server_itsname(from_server)) &&
(!desync || my_stricmp(desync, from)))
{ {
malloc_strcpy(&desync, from); malloc_strcpy(&desync, from);
if (do_hook(DESYNC_MESSAGE_LIST, "%s %s", from, ArgList[0])) if (do_hook(DESYNC_MESSAGE_LIST, "%s %s", from, ArgList[0]))
put_it("%s", convert_output_format(fget_string_var(FORMAT_DESYNC_FSET), "%s %s %s", update_clock(GET_TIME), ArgList[0], from)); put_it("%s", convert_output_format(fget_string_var(FORMAT_DESYNC_FSET), "%s %s %s", update_clock(GET_TIME), ArgList[0], from));
return 1; return 1;
} }
}
return 0; return 0;
} }
@@ -307,14 +307,11 @@ static void channel_topic(char *from, char **ArgList, int what)
static void not_valid_channel(char *from, char **ArgList) static void not_valid_channel(char *from, char **ArgList)
{ {
char *channel; char *channel;
char *s;
if (!(channel = ArgList[0]) || !ArgList[1]) if (!(channel = ArgList[0]) || !ArgList[1])
return; return;
PasteArgs(ArgList, 1); PasteArgs(ArgList, 1);
s = get_server_name(from_server); if (!my_stricmp(from, get_server_itsname(from_server)))
if (!my_strnicmp(s, from, strlen(s)))
{ {
if (strcmp(channel, "*")) if (strcmp(channel, "*"))
remove_channel(channel, from_server); remove_channel(channel, from_server);