Relay server connect fixes
This commit is contained in:
parent
7ab54ea2f6
commit
8bc4efcf90
@ -1020,8 +1020,6 @@ int command_server(char *hostname, char *parameters)
|
|||||||
unsigned int token;
|
unsigned int token;
|
||||||
int i, j, ihops, found = FALSE;
|
int i, j, ihops, found = FALSE;
|
||||||
|
|
||||||
Syslog('c', "IBC: cmd_server(%s, %s)", hostname, parameters);
|
|
||||||
|
|
||||||
name = strtok(parameters, " \0");
|
name = strtok(parameters, " \0");
|
||||||
hops = strtok(NULL, " \0");
|
hops = strtok(NULL, " \0");
|
||||||
token = atoi(strtok(NULL, " \0"));
|
token = atoi(strtok(NULL, " \0"));
|
||||||
@ -1030,6 +1028,9 @@ int command_server(char *hostname, char *parameters)
|
|||||||
fullname = strtok(NULL, "\0");
|
fullname = strtok(NULL, "\0");
|
||||||
ihops = atoi(hops) + 1;
|
ihops = atoi(hops) + 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if this is our neighbour server
|
||||||
|
*/
|
||||||
for (i = 0; i < MAXIBC_NCS; i++) {
|
for (i = 0; i < MAXIBC_NCS; i++) {
|
||||||
if (strcmp(ncs_list[i].server, name) == 0) {
|
if (strcmp(ncs_list[i].server, name) == 0) {
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
@ -1037,8 +1038,6 @@ int command_server(char *hostname, char *parameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Syslog('c', "IBC: found=%s slot=%d", found ?"True":"False", i);
|
|
||||||
|
|
||||||
if (found && fullname == NULL) {
|
if (found && fullname == NULL) {
|
||||||
send_msg(i, (char *)"400 SERVER: Not enough parameters\r\n");
|
send_msg(i, (char *)"400 SERVER: Not enough parameters\r\n");
|
||||||
return 400;
|
return 400;
|
||||||
@ -1050,7 +1049,6 @@ int command_server(char *hostname, char *parameters)
|
|||||||
* remote is the same as the token we sent.
|
* remote is the same as the token we sent.
|
||||||
* In that case, the session is authorized.
|
* In that case, the session is authorized.
|
||||||
*/
|
*/
|
||||||
Syslog('c', "IBC: we are in calling state");
|
|
||||||
if (ncs_list[i].token == token) {
|
if (ncs_list[i].token == token) {
|
||||||
p = calloc(512, sizeof(char));
|
p = calloc(512, sizeof(char));
|
||||||
snprintf(p, 512, "SERVER %s %d %d %s %s %s\r\n", name, ihops, token, prod, vers, fullname);
|
snprintf(p, 512, "SERVER %s %d %d %s %s %s\r\n", name, ihops, token, prod, vers, fullname);
|
||||||
@ -1123,7 +1121,6 @@ int command_server(char *hostname, char *parameters)
|
|||||||
* valid PASS command.
|
* valid PASS command.
|
||||||
*/
|
*/
|
||||||
if (found && ncs_list[i].gotpass) {
|
if (found && ncs_list[i].gotpass) {
|
||||||
Syslog('c', "IBC: we are in waiting state");
|
|
||||||
p = calloc(512, sizeof(char));
|
p = calloc(512, sizeof(char));
|
||||||
snprintf(p, 512, "PASS %s 0100 %s\r\n", ncs_list[i].passwd, ncs_list[i].compress ? "Z":"");
|
snprintf(p, 512, "PASS %s 0100 %s\r\n", ncs_list[i].passwd, ncs_list[i].compress ? "Z":"");
|
||||||
send_msg(i, p);
|
send_msg(i, p);
|
||||||
|
Reference in New Issue
Block a user