rfctester/test-*.so
testsuite/*.so
testsuite/ctrlproxyrc.torture
+testsuite/torture
General
-------
+The core of ctrlproxy is in the top source directory, standard module
+are in mods/.
+Writing Modules
+---------------
As has been said in the introduction, ctrlproxy
is easily extendible. At the time of writing, there
are nine modules available.
g_assert(client->nick);
g_assert(client->network);
- g_assert(client->network->state);
-
- if (g_strcasecmp(client->nick, client->network->state->me.nick)) {
- /* Tell the client our his/her real nick */
- char *tmp = g_strdup_printf("%s!~%s@%s",
- client->nick,
- client->username,
- client->hostname);
- client_send_args_ex(client, tmp, "NICK", client->network->state->me.nick, NULL);
- g_free(tmp);
-
- /* Try to get the nick the client specified */
- if (!client->network->config->ignore_first_nick) {
- network_send_args(client->network, "NICK", client->nick, NULL);
+
+ if (client->network->state) {
+ if (g_strcasecmp(client->nick, client->network->state->me.nick)) {
+ /* Tell the client our his/her real nick */
+ char *tmp = g_strdup_printf("%s!~%s@%s",
+ client->nick,
+ client->username,
+ client->hostname);
+ client_send_args_ex(client, tmp, "NICK", client->network->state->me.nick, NULL);
+ g_free(tmp);
+
+ /* Try to get the nick the client specified */
+ if (!client->network->config->ignore_first_nick) {
+ network_send_args(client->network, "NICK", client->nick, NULL);
+ }
}
}
- g_free(client->nick);
- client->nick = NULL;
-
if(!new_client_hook_execute(client)) {
disconnect_client(client, "Refused by client connect hook");
return FALSE;
static gboolean none_replicate(struct client *c, void *userdata)
{
- client_send_state(c, c->network->state);
+ if (c->network->state)
+ client_send_state(c, c->network->state);
return TRUE;
}
static void change_nick(struct client *c, const char *newnick)
{
- struct line *l = irc_parse_line_args(c->network->state->me.hostmask, "NICK", newnick, NULL);
+ struct line *l;
+ g_assert(c);
+ g_assert(newnick);
+
+ g_assert(c->network->state);
+
+ l = irc_parse_line_args(c->network->state->me.hostmask, "NICK", newnick, NULL);
client_send_line(c, l);
free_line(l);
}
m = g_hash_table_lookup(simple_backlog, c->network);
ns = linestack_get_state(c->network, m);
- client_send_state(c, ns);
- change_nick(c, ns->me.nick);
+ if (ns) {
+ client_send_state(c, ns);
+ change_nick(c, ns->me.nick);
+ }
free_network_state(ns);
linestack_send(c->network, m, NULL, c);
return TRUE;
-Welcome to the ControlProxy!
+Welcome to the ControlProxy!
+URL: http://ctrlproxy.vernstok.nl/
-(C) 2002-2005 by Jelmer Vernooij <jelmer@vernstok.nl> and others
- for a list of contributions, see AUTHORS
+(C) 2002-2005 by Jelmer Vernooij <jelmer@vernstok.nl> and others.
+For a list of contributions, see AUTHORS.
Use /CTRLPROXY HELP or /MSG CTRLPROXY HELP to get
a list of available commands.
/*
ctrlproxy: A modular IRC proxy
- mux: Send numerics to the right places
+ Send numerics to the right places
(c) 2002-2005 Jelmer Vernooij <jelmer@nl.linux.org>
This program is free software; you can redistribute it and/or modify
void free_network_state(struct network_state *state)
{
+ if (state == NULL)
+ return;
+
while(state->channels)
{
free_channel((struct channel_state *)state->channels->data);