Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WebSocket support #427

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ ircd/ircd_lexer.c
ircd/version.c
ircd/version.c.last
ssld/ssld
wsockd/wsockd
testsuite/ircd.pid.*
tools/solanum-mkpasswd
tools/solanum-mkfingerprint
Expand Down
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ endif

SUBDIRS += ircd \
ssld \
wsockd \
authd \
bandb \
tests \
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ bolded warnings in the full release notes below.
be disconnected on registration

### misc
- **Breaking:** WebSocket support has been removed.
- **Breaking:** WEBIRC now processes the "secure" option as specified by IRCv3. Web gateways that
do not set this option will need to be updated or their connections will show as insecure.
- Successfully changing IP with WEBIRC now drops an identd username
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ AC_CONFIG_FILES( \
authd/Makefile \
bandb/Makefile \
ssld/Makefile \
wsockd/Makefile \
extensions/Makefile \
ircd/Makefile \
modules/Makefile \
Expand Down
6 changes: 0 additions & 6 deletions doc/ircd.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ listen {
#host = "2001:db8:2::6";
#port = 5000, 6665 .. 6669;
#sslport = 6697;

/* wsock: listeners defined with this option enabled will be websocket listeners,
* and will not accept normal clients.
*/
wsock = yes;
sslport = 9999;
};

/* auth {}: allow users to connect to the ircd (OLD I:)
Expand Down
6 changes: 0 additions & 6 deletions doc/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,6 @@ listen {
host = "2001:db8:2::6";
port = 7002;
sslport = 9002;

/* wsock: listeners defined with this option enabled will be websocket listeners,
* and will not accept normal clients.
*/
wsock = yes;
sslport = 9999;
};

/* auth {}: allow users to connect to the ircd (OLD I:) */
Expand Down
2 changes: 0 additions & 2 deletions include/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ struct LocalUser;
struct PreClient;
struct ListClient;
struct scache_entry;
struct ws_ctl;

typedef int SSL_OPEN_CB(struct Client *, int status);

Expand Down Expand Up @@ -264,7 +263,6 @@ struct LocalUser

struct _ssl_ctl *ssl_ctl; /* which ssl daemon we're associate with */
struct _ssl_ctl *z_ctl; /* second ctl for ssl+zlib */
struct ws_ctl *ws_ctl; /* ctl for wsockd */
SSL_OPEN_CB *ssl_callback; /* ssl connection is now open */
uint32_t localflags;
uint16_t cork_count; /* used for corking/uncorking connections */
Expand Down
5 changes: 2 additions & 3 deletions include/listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ struct Listener
int ssl; /* ssl listener */
int defer_accept; /* use TCP_DEFER_ACCEPT */
bool sctp; /* use SCTP */
int wsock; /* wsock listener */
struct rb_sockaddr_storage addr[2];
char vhost[(HOSTLEN * 2) + 1]; /* virtual name of listener */
};

extern void add_tcp_listener(int port, const char *vaddr_ip, int family, int ssl, int defer_accept, int wsock);
extern void add_sctp_listener(int port, const char *vaddr_ip1, const char *vaddr_ip2, int ssl, int wsock);
extern void add_tcp_listener(int port, const char *vaddr_ip, int family, int ssl, int defer_accept);
extern void add_sctp_listener(int port, const char *vaddr_ip1, const char *vaddr_ip2, int ssl);
extern void close_listener(struct Listener *listener);
extern void close_listeners(void);
extern const char *get_listener_name(const struct Listener *listener);
Expand Down
1 change: 0 additions & 1 deletion include/s_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ struct server_info
char *ssl_dh_params;
char *ssl_cipher_list;
int ssld_count;
int wsockd_count;
};

struct admin_info
Expand Down
44 changes: 0 additions & 44 deletions include/wsproc.h

This file was deleted.

4 changes: 2 additions & 2 deletions ircd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ libircd_la_SOURCES = \
supported.c \
tgchange.c \
version.c \
whowas.c \
wsproc.c
whowas.c

libircd_la_LDFLAGS = $(EXTRA_FLAGS) -avoid-version -no-undefined
libircd_la_LIBADD = @LIBLTDL@ -L$(top_srcdir)/librb/src -lrb
libircd_LTLIBRARIES = libircd.la
Expand Down
4 changes: 0 additions & 4 deletions ircd/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include "scache.h"
#include "rb_dictionary.h"
#include "sslproc.h"
#include "wsproc.h"
#include "s_assert.h"

#define DEBUG_EXITED_CLIENTS
Expand Down Expand Up @@ -307,9 +306,6 @@ free_local_client(struct Client *client_p)

rb_free(client_p->localClient->cipher_string);

if (client_p->localClient->ws_ctl != NULL)
wsockd_decrement_clicount(client_p->localClient->ws_ctl);

rb_bh_free(lclient_heap, client_p->localClient);
client_p->localClient = NULL;
}
Expand Down
2 changes: 0 additions & 2 deletions ircd/ircd.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#include "patchlevel.h"
#include "serno.h"
#include "sslproc.h"
#include "wsproc.h"
#include "chmode.h"
#include "privilege.h"
#include "bandbi.h"
Expand Down Expand Up @@ -668,7 +667,6 @@ solanum_main(int argc, char * const argv[])

init_bandb();
init_ssld();
init_wsockd();

rehash_bans();

Expand Down
27 changes: 2 additions & 25 deletions ircd/listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "reject.h"
#include "hostmask.h"
#include "sslproc.h"
#include "wsproc.h"
#include "hash.h"
#include "s_assert.h"
#include "logger.h"
Expand Down Expand Up @@ -285,7 +284,7 @@ find_listener(struct rb_sockaddr_storage *addr, int sctp)
* the format "255.255.255.255"
*/
void
add_tcp_listener(int port, const char *vhost_ip, int family, int ssl, int defer_accept, int wsock)
add_tcp_listener(int port, const char *vhost_ip, int family, int ssl, int defer_accept)
{
struct Listener *listener;
struct rb_sockaddr_storage vaddr[ARRAY_SIZE(listener->addr)];
Expand Down Expand Up @@ -347,7 +346,6 @@ add_tcp_listener(int port, const char *vhost_ip, int family, int ssl, int defer_
listener->ssl = ssl;
listener->defer_accept = defer_accept;
listener->sctp = 0;
listener->wsock = wsock;

if (inetport(listener)) {
listener->active = 1;
Expand All @@ -362,7 +360,7 @@ add_tcp_listener(int port, const char *vhost_ip, int family, int ssl, int defer_
* vhost_ip1/2 - if non-null must contain a valid IP address string
*/
void
add_sctp_listener(int port, const char *vhost_ip1, const char *vhost_ip2, int ssl, int wsock)
add_sctp_listener(int port, const char *vhost_ip1, const char *vhost_ip2, int ssl)
{
struct Listener *listener;
struct rb_sockaddr_storage vaddr[ARRAY_SIZE(listener->addr)];
Expand Down Expand Up @@ -417,7 +415,6 @@ add_sctp_listener(int port, const char *vhost_ip1, const char *vhost_ip2, int ss
listener->ssl = ssl;
listener->defer_accept = 0;
listener->sctp = 1;
listener->wsock = wsock;

if (inetport(listener)) {
listener->active = 1;
Expand Down Expand Up @@ -538,26 +535,6 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, str
SetSecure(new_client);
}

if (listener->wsock)
{
rb_fde_t *xF[2];
if(rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming wsockd Connection") == -1)
{
SetIOError(new_client);
exit_client(new_client, new_client, new_client, "Fatal Error");
return;
}
new_client->localClient->ws_ctl = start_wsockd_accept(F, xF[1], connid_get(new_client)); /* this will close F for us */
if(new_client->localClient->ws_ctl == NULL)
{
SetIOError(new_client);
exit_client(new_client, new_client, new_client, "Service Unavailable");
return;
}
F = xF[0];
new_client->localClient->F = F;
}

new_client->localClient->listener = listener;

++listener->ref_count;
Expand Down
19 changes: 4 additions & 15 deletions ircd/newconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@
#include "ircd.h"
#include "snomask.h"
#include "sslproc.h"
#include "wsproc.h"
#include "privilege.h"
#include "chmode.h"
#include "certfp.h"

#define CF_TYPE(x) ((x) & CF_MTYPE)

static int yy_defer_accept = 1;
static int yy_wsock = 0;

struct TopConf *conf_cur_block;
static char *conf_cur_block_name = NULL;
Expand Down Expand Up @@ -890,7 +888,6 @@ conf_begin_listen(struct TopConf *tc)
rb_free(listener_address[i]);
listener_address[i] = NULL;
}
yy_wsock = 0;
yy_defer_accept = 0;
return 0;
}
Expand All @@ -902,7 +899,6 @@ conf_end_listen(struct TopConf *tc)
rb_free(listener_address[i]);
listener_address[i] = NULL;
}
yy_wsock = 0;
yy_defer_accept = 0;
return 0;
}
Expand All @@ -913,12 +909,6 @@ conf_set_listen_defer_accept(void *data)
yy_defer_accept = *(unsigned int *) data;
}

static void
conf_set_listen_wsock(void *data)
{
yy_wsock = *(unsigned int *) data;
}

static void
conf_set_listen_port_both(void *data, int ssl, int sctp)
{
Expand All @@ -935,8 +925,8 @@ conf_set_listen_port_both(void *data, int ssl, int sctp)
if (sctp) {
conf_report_error("listener::sctp_port has no addresses -- ignoring.");
} else {
add_tcp_listener(args->v.number, NULL, AF_INET, ssl, ssl || yy_defer_accept, yy_wsock);
add_tcp_listener(args->v.number, NULL, AF_INET6, ssl, ssl || yy_defer_accept, yy_wsock);
add_tcp_listener(args->v.number, NULL, AF_INET, ssl, ssl || yy_defer_accept);
add_tcp_listener(args->v.number, NULL, AF_INET6, ssl, ssl || yy_defer_accept);
}
}
else
Expand All @@ -949,12 +939,12 @@ conf_set_listen_port_both(void *data, int ssl, int sctp)

if (sctp) {
#ifdef HAVE_LIBSCTP
add_sctp_listener(args->v.number, listener_address[0], listener_address[1], ssl, yy_wsock);
add_sctp_listener(args->v.number, listener_address[0], listener_address[1], ssl);
#else
conf_report_error("Warning -- ignoring listener::sctp_port -- SCTP support not available.");
#endif
} else {
add_tcp_listener(args->v.number, listener_address[0], family, ssl, ssl || yy_defer_accept, yy_wsock);
add_tcp_listener(args->v.number, listener_address[0], family, ssl, ssl || yy_defer_accept);
}
}
}
Expand Down Expand Up @@ -2851,7 +2841,6 @@ newconf_init()

add_top_conf("listen", conf_begin_listen, conf_end_listen, NULL);
add_conf_item("listen", "defer_accept", CF_YESNO, conf_set_listen_defer_accept);
add_conf_item("listen", "wsock", CF_YESNO, conf_set_listen_wsock);
add_conf_item("listen", "port", CF_INT | CF_FLIST, conf_set_listen_port);
add_conf_item("listen", "sslport", CF_INT | CF_FLIST, conf_set_listen_sslport);
add_conf_item("listen", "sctp_port", CF_INT | CF_FLIST, conf_set_listen_sctp_port);
Expand Down
10 changes: 0 additions & 10 deletions ircd/s_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include "cache.h"
#include "privilege.h"
#include "sslproc.h"
#include "wsproc.h"
#include "bandbi.h"
#include "operhash.h"
#include "chmode.h"
Expand Down Expand Up @@ -907,9 +906,6 @@ validate_conf(void)
if(ServerInfo.ssld_count < 1)
ServerInfo.ssld_count = 1;

/* XXX: configurable? */
ServerInfo.wsockd_count = 1;

if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
{
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
Expand All @@ -926,12 +922,6 @@ validate_conf(void)
start_ssldaemon(start);
}

if(ServerInfo.wsockd_count > get_wsockd_count())
{
int start = ServerInfo.wsockd_count - get_wsockd_count();
start_wsockd(start);
}

/* General conf */
if (ConfigFileEntry.default_operstring == NULL)
ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator");
Expand Down
Loading
Loading