+Wed Jul 18 18:34:01 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * Call silc_schedule_task_del_by_context in the
+ silc_protocol_cancel instead of silc_schedule_task_del_by_callback.
+ Affected file lib/silccore/silcprotocol.c.
+
+ * Call silc_protocol_cancel for active protocols in the
+ silc_server_close_connection if the funtion
+ silc_server_free_sock_user_data has not been called.
+ Affected file silcd/server.c.
+
+ * Generic tasks cannot be deleted using the del_by_fd
+ task deleting function since generic tasks does not match
+ any specific fd. Affected file lib/silcutil/silcschedule.[ch].
+
+ * Added a notion to SILCOPER help file that the SILCOPER works
+ only on router server, not on normal server.
+
Wed Jul 18 09:40:04 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* Added for WIN32 support for the new scheduler as well.
P: 1024/A924ED4F AD 82 53 2D 84 FF C7 D1 FF 63 19 0E 1A 78 9F 8A A9 24 ED 4F
D: Protocol architet
D: Main developer
-S: Kasarmikatu 11 A4
-S: 70110 Kuopio
+S: Snellmanninkatu 34 A 15
+S: 70100 Kuopio
S: Finland
N: Juha Räsänen
cipher, hash, hmac and pkcs configuration to the Irssi SILC's config
file.
+ o The QUIT command should wait for servers disconnection (at least for
+ a while) before exiting the application.
+
o Add local command to switch the channel's private key when channel has
several private keys. Currently sending channel messages with many
keys is not possible because changing the key is not possible by the
@SYNTAX:silcoper@
-Gives you router operator priviledges if thecorrect
+Gives you router operator priviledges if the correct
username and passphrase are given. User will be prompted
for the passphrase if the <public key> is not provided.
+NOTE: This command works only on router server. It has
+no effect on normal SILC server.
+
See also: KILL, SCONNECT, CLOSE, OPER
SILC_SERVER_COMMAND_CHECK(SILC_COMMAND_SILCOPER, cmd, 1, 2);
- if (server->server_type == SILC_SERVER)
+ if (!client || cmd->sock->type != SILC_SOCKET_TYPE_CLIENT)
goto out;
- if (!client || cmd->sock->type != SILC_SOCKET_TYPE_CLIENT)
+ if (server->server_type == SILC_SERVER) {
+ silc_server_command_send_status_reply(cmd, SILC_COMMAND_SILCOPER,
+ SILC_STATUS_ERR_AUTH_FAILED);
goto out;
+ }
/* Get the username */
username = silc_argument_get_arg_type(cmd->args, 1, &tmp_len);
server. This task remains on the queue until the end of the program. */
if (!server->listenning) {
silc_schedule_task_add(server->schedule, server->sock,
- silc_server_accept_new_connection,
- (void *)server, 0, 0,
- SILC_TASK_FD,
- SILC_TASK_PRI_NORMAL);
+ silc_server_accept_new_connection,
+ (void *)server, 0, 0,
+ SILC_TASK_FD,
+ SILC_TASK_PRI_NORMAL);
server->listenning = TRUE;
}
be closed if the key exchange protocol has not been started. */
proto_ctx->timeout_task =
silc_schedule_task_add(server->schedule, sock->sock,
- silc_server_timeout_remote,
- context, 60, 0,
- SILC_TASK_TIMEOUT,
- SILC_TASK_PRI_LOW);
+ silc_server_timeout_remote,
+ context, 60, 0,
+ SILC_TASK_TIMEOUT,
+ SILC_TASK_PRI_LOW);
}
/* Accepts new connections to the server. Accepting new connections are
this is 60 seconds and is hard coded limit (XXX). */
proto_ctx->timeout_task =
silc_schedule_task_add(server->schedule, sock->sock,
- silc_server_timeout_remote,
- (void *)server, 60, 0,
- SILC_TASK_TIMEOUT,
- SILC_TASK_PRI_LOW);
+ silc_server_timeout_remote,
+ (void *)server, 60, 0,
+ SILC_TASK_TIMEOUT,
+ SILC_TASK_PRI_LOW);
}
/* Final part of accepting new connection. The connection has now
if (!server->standalone && sock->type == SILC_SOCKET_TYPE_ROUTER &&
sock == server->router->connection)
silc_schedule_task_add(server->schedule, 0,
- silc_server_connect_to_router,
- context, 1, 0,
- SILC_TASK_TIMEOUT,
- SILC_TASK_PRI_NORMAL);
+ silc_server_connect_to_router,
+ context, 1, 0,
+ SILC_TASK_TIMEOUT,
+ SILC_TASK_PRI_NORMAL);
if (sock->user_data)
silc_server_free_sock_user_data(server, sock);
sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" :
"Router"), sock->sock));
+ /* If sock->user_data is NULL then we'll check for active protocols
+ here since the silc_server_free_sock_user_data has not been called
+ for this connection. */
+ if (!sock->user_data) {
+ /* If any protocol is active cancel its execution */
+ if (sock->protocol) {
+ silc_protocol_cancel(sock->protocol, server->schedule);
+ sock->protocol->state = SILC_PROTOCOL_STATE_ERROR;
+ silc_protocol_execute_final(sock->protocol, server->schedule);
+ sock->protocol = NULL;
+ }
+ }
+
/* We won't listen for this connection anymore */
silc_schedule_unset_listen_fd(server->schedule, sock->sock);
will not start the key exchange protocol within the specified
timeout. */
ke->timeout = silc_schedule_task_add(client->schedule, 0,
- silc_client_key_agreement_timeout,
- (void *)ke, timeout_secs, 0,
- SILC_TASK_TIMEOUT, SILC_TASK_PRI_LOW);
+ silc_client_key_agreement_timeout,
+ (void *)ke, timeout_secs, 0,
+ SILC_TASK_TIMEOUT, SILC_TASK_PRI_LOW);
}
/* Encode the key agreement payload */
/* Register task that will receive the async connect and will
read the result. */
ctx->task = silc_schedule_task_add(ctx->client->schedule, sock,
- silc_client_perform_key_agreement_start,
- (void *)ctx, 0, 0,
- SILC_TASK_FD,
- SILC_TASK_PRI_NORMAL);
+ silc_client_perform_key_agreement_start,
+ (void *)ctx, 0, 0,
+ SILC_TASK_FD,
+ SILC_TASK_PRI_NORMAL);
silc_schedule_set_listen_fd(ctx->client->schedule, sock, SILC_TASK_WRITE);
ctx->sock = sock;
void silc_protocol_cancel(SilcProtocol protocol, SilcSchedule schedule)
{
- silc_schedule_task_del_by_callback(schedule, protocol->protocol->callback);
+ silc_schedule_task_del_by_context(schedule, protocol);
}
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
+ * DESCRIPTION
+ *
+ * SILC Net API provides various network routines for applications. It
+ * can be used to create TCP/IP connections and servers. Various utility
+ * functions for resolving various information is also provided.
+ *
+ * On WIN32 systems the SILC Net API must initialized by calling the
+ * silc_net_win32_init and uninitialized when the application ends by
+ * calling the silc_net_win32_uninit function. The initializing must be
+ * done in order to assure that the SILC Net API works correctly.
+ *
*/
#ifndef SILCNET_H
{
silc_task_del_by_fd(schedule->timeout_queue, fd);
silc_task_del_by_fd(schedule->fd_queue, fd);
- silc_task_del_by_fd(schedule->generic_queue, fd);
}
/* Remove task by task callback. */
{
SilcTask first, old, next;
- if (!queue)
+ if (!queue || !task)
return FALSE;
if (!queue->task) {
* in task callbacks (including in the task's own task callback) and
* in multi-threaded environment in other threads as well.
*
+ * Note that generic tasks cannot be deleted using this function
+ * since generic tasks does not match any specific fd.
+ *
***/
void silc_schedule_task_del_by_fd(SilcSchedule schedule, uint32 fd);
int nhandles = 0, i;
MSG msg;
+ if (fds_count > MAXIMUM_WAIT_OBJECTS)
+ fds_count = MAXIMUM_WAIT_OBJECTS;
+
for (i = 0; i < fds_count; i++) {
if (!fds[i].events)
continue;