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

@@ -222,18 +222,18 @@ char *rest = PasteArgs(ArgList, 0);
static int check_server_sync(char *from, char **ArgList)
{
static char *desync = NULL;
static char *desync = NULL;
if (!desync || (desync && !wild_match(desync, from)))
/* If we get a "permission denied" type numeric from a _remote_ server,
* then it means the network is desyched.
*/
if (my_stricmp(from, get_server_itsname(from_server)) &&
(!desync || my_stricmp(desync, from)))
{
if (!wild_match(from, get_server_name(from_server)))
{
malloc_strcpy(&desync, from);
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));
return 1;
}
malloc_strcpy(&desync, from);
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));
return 1;
}
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)
{
char *channel;
char *s;
if (!(channel = ArgList[0]) || !ArgList[1])
return;
PasteArgs(ArgList, 1);
s = get_server_name(from_server);
if (!my_strnicmp(s, from, strlen(s)))
if (!my_stricmp(from, get_server_itsname(from_server)))
{
if (strcmp(channel, "*"))
remove_channel(channel, from_server);