+Fri Nov 28 19:13:21 EET 2003 Pekka Riikonen <priikone@silcnet.org>
+
+ * Changed the SILC_LOG_* macros to not be empty if SILC_DEBUG
+ is not defined. They can now be safely used in if-statements
+ without braces. Affected file lib/silcutil/silclog.h.
+
+ * Added the checks for backup closing connection due to error
+ (local or remote) and thus not allow the resuming to occur
+ in reconnect. Affected files are silcd/packet_send.c
+ and server.c.
+
Tue Nov 25 15:20:59 EET 2003 Pekka Riikonen <priikone@silcnet.org>
* Help file updates. Affected files in irssi/src/docs/help/in/.
Wed Nov 23 20:51:21 CET 2003 Patrik Weiskircher <pat@icore.at>
- * Fixed channel messages across cells. Affected file
+ * Fixed channel messages across cells. Affected file
silcd/packet_send.c
Wed Nov 12 11:34:56 EET 2003 Pekka Riikonen <priikone@silcnet.org>
sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" :
"Router")));
- if (sock->user_data)
+ if (sock->user_data) {
+ /* If backup then mark that resuming will not be allowed */
+ if (server->server_type == SILC_ROUTER && !server->backup_router &&
+ sock->type == SILC_SOCKET_TYPE_SERVER) {
+ SilcServerEntry server_entry = sock->user_data;
+ if (server_entry->server_type == SILC_BACKUP_ROUTER)
+ server->backup_closed = TRUE;
+ }
+
silc_server_free_sock_user_data(server, sock, NULL);
+ }
SILC_SET_DISCONNECTING(sock);
silc_server_close_connection(server, sock);
return ret;
}
memcpy(iv, data + (data_len - iv_len - mac_len), iv_len);
- silc_message_payload_encrypt(data, data_len - iv_len - mac_len,
- data_len - mac_len, iv, iv_len,
+ silc_message_payload_encrypt(data, data_len - iv_len - mac_len,
+ data_len - mac_len, iv, iv_len,
channel->channel_key, channel->hmac);
}
sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" :
"Router")));
- if (sock->user_data)
+ if (sock->user_data) {
+ /* If backup then mark that resuming will not be allowed */
+ if (server->server_type == SILC_ROUTER && !server->backup_router &&
+ sock->type == SILC_SOCKET_TYPE_SERVER) {
+ SilcServerEntry server_entry = sock->user_data;
+ if (server_entry->server_type == SILC_BACKUP_ROUTER)
+ server->backup_closed = TRUE;
+ }
+
silc_server_free_sock_user_data(server, sock, NULL);
+ }
SILC_SET_DISCONNECTING(sock);
silc_server_close_connection(server, sock);
}
sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" :
"Router"), strerror(errno)));
- if (sock->user_data)
+ if (sock->user_data) {
+ /* If backup then mark that resuming will not be allowed */
+ if (server->server_type == SILC_ROUTER && !server->backup_router &&
+ sock->type == SILC_SOCKET_TYPE_SERVER) {
+ SilcServerEntry server_entry = sock->user_data;
+ if (server_entry->server_type == SILC_BACKUP_ROUTER)
+ server->backup_closed = TRUE;
+ }
+
silc_server_free_sock_user_data(server, sock, NULL);
+ }
SILC_SET_DISCONNECTING(sock);
silc_server_close_connection(server, sock);
}
if (sock->user_data) {
char tmp[128];
- /* If backup disconnected then mark that resuming willl not be allowed */
+ /* If backup disconnected then mark that resuming will not be allowed */
if (server->server_type == SILC_ROUTER && !server->backup_router &&
sock->type == SILC_SOCKET_TYPE_SERVER && sock->user_data) {
SilcServerEntry server_entry = sock->user_data;
if (SILC_PRIMARY_ROUTE(server) == sock && server->backup_router)
server->backup_noswitch = TRUE;
- if (sock->user_data)
+ if (sock->user_data) {
+ /* If we are router and backup errorred then mark that resuming
+ will not be allowed */
+ if (server->server_type == SILC_ROUTER && !server->backup_router &&
+ sock->type == SILC_SOCKET_TYPE_SERVER) {
+ SilcServerEntry server_entry = sock->user_data;
+ if (server_entry->server_type == SILC_BACKUP_ROUTER)
+ server->backup_closed = TRUE;
+ }
+
silc_server_free_sock_user_data(server, sock, NULL);
+ }
SILC_SET_DISCONNECTING(sock);
silc_server_close_connection(server, sock);
}
/* Do not switch to backup in case of error */
server->backup_noswitch = (status == SILC_STATUS_OK ? FALSE : TRUE);
- /* If backup disconnected then mark that resuming willl not be allowed */
+ /* If backup disconnected then mark that resuming will not be allowed */
if (server->server_type == SILC_ROUTER && !server->backup_router &&
sock->type == SILC_SOCKET_TYPE_SERVER && sock->user_data) {
SilcServerEntry server_entry = sock->user_data;
unsigned char data[4];
SILC_LOG_DEBUG(("Backup resuming not allowed since we are still "
"primary router"));
+ SILC_LOG_INFO(("Backup resuming not allowed since we are still "
+ "primary router"));
SILC_PUT32_MSB(SILC_SERVER_BACKUP_START, data);
silc_server_packet_send(server, sock, SILC_PACKET_FAILURE, 0,
data, 4, FALSE);
SILC_LOG_DEBUG(("Client %s",
silc_id_render(client->id, SILC_ID_CLIENT)));
- if (client->router)
+ if (client->router && client->router->id)
SILC_LOG_DEBUG(("Client->router %s",
silc_id_render(client->router->id, SILC_ID_SERVER)));
client->router = to;
}
- if (client->router)
+ if (client->router && client->router->id)
SILC_LOG_DEBUG(("Client changed to %s",
silc_id_render(client->router->id, SILC_ID_SERVER)));
SILC_LOG_DEBUG(("Client %s",
silc_id_render(client->id, SILC_ID_CLIENT)));
- if (client->router)
+ if (client->router && client->router->id)
SILC_LOG_DEBUG(("Client->router %s",
silc_id_render(client->router->id, SILC_ID_SERVER)));
client->router = to;
}
- if (client->router)
+ if (client->router && client->router->id)
SILC_LOG_DEBUG(("Client changed to %s",
silc_id_render(client->router->id, SILC_ID_SERVER)));