tDocument switch to libcurl - vaccinewars - be a doctor and try to vaccinate the world | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 911e3d0b81eaa0cfb2ec75a3d8394906cff257c5 | |
parent 826c6ac4c313c45fad652728ea9002483507ef9a | |
Author: Ben Webb | |
Date: Mon, 2 Nov 2020 23:52:15 -0800 Document switch to libcurl Diffstat: M ChangeLog | 7 +++++++ M doc/configfile.html | 54 ++++--------------------------- M doc/example-igneous | 2 -- M doc/metaserver.html | 11 ++--------- M src/dopewars.c | 37 +++---------------------------- M src/dopewars.h | 4 ---- M src/gui_client/optdialog.c | 12 ------------ M src/serverside.c | 43 ------------------------------ 8 files changed, 19 insertions(+), 151 deletions(-) --- | |
diff --git a/ChangeLog b/ChangeLog | |
t@@ -7,6 +7,13 @@ SVN of these libraries to build dopewars. - Update metaserver to work with new SourceForge; older versions can no longer successfully register with the metaserver. + - Switch to using libcurl to talk to the metaserver (this supports https, + unlike the old internal code). The metaserver configuration has changed + accordingly; MetaServer.Name, MetaServer.Port and MetaServer.Path are + replaced with MetaServer.URL, and MetaServer.Auth, MetaServer.Proxy*, + and MetaServer.UseSocks are removed (set the https_proxy environment + variable instead, as per + https://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Environment) - Fix for a DOS against the server using the REQUESTJET message type (thanks to Doug Prostko for reporting the problem). | |
diff --git a/doc/configfile.html b/doc/configfile.html | |
t@@ -202,31 +202,13 @@ is replaced by FALSE the server will not report to the metaserver. This setting, if set to TRUE, can be overridden by the -S command line option. - Basic configuration: places in the game | |
diff --git a/doc/example-igneous b/doc/example-igneous | |
t@@ -1,7 +1,5 @@ ServerMOTD = "Welcome All, Play for as long as you like. !- MAKE SURE TO PAY OFF YOUR DEBT NOW -!" Port = 7902 -MetaServer.Port = 80 -MetaServer.ProxyPort = 0 MetaServer.Comment = "Igneous\'s MOD" NumTurns = 0 NumLocation = 87 | |
diff --git a/doc/metaserver.html b/doc/metaserver.html | |
t@@ -55,15 +55,8 @@ and so there is at least a good chance that the servers listed there will be working. | |
diff --git a/src/dopewars.c b/src/dopewars.c | |
t@@ -210,13 +210,12 @@ struct BITCH Bitch = { #ifdef NETWORKING struct METASERVER MetaServer = { - FALSE, NULL, NULL, 0, NULL, NULL, - NULL, FALSE, NULL, NULL, NULL, NULL + FALSE, NULL, NULL, NULL, NULL }; struct METASERVER DefaultMetaServer = { - TRUE, "https://dopewars.sourceforge.io/metaserver.php", "", 8080, - "", "", "dopewars server", FALSE, "", "", "", "" + TRUE, "https://dopewars.sourceforge.io/metaserver.php", "", + "", "dopewars server" }; SocksServer Socks = { NULL, 0, 0, FALSE, NULL, NULL, NULL }; t@@ -280,12 +279,6 @@ struct GLOBALS Globals[] = { {NULL, NULL, NULL, &MetaServer.URL, NULL, "MetaServer.URL", N_("Metaserver URL to report/get server details to/from"), NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {NULL, NULL, NULL, &MetaServer.ProxyName, NULL, "MetaServer.ProxyName", - N_("Name of a proxy for metaserver communication"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {&MetaServer.ProxyPort, NULL, NULL, NULL, NULL, "MetaServer.ProxyPort", - N_("Port for communicating with the proxy server"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 65535}, {NULL, NULL, NULL, &MetaServer.LocalName, NULL, "MetaServer.LocalName", N_("Preferred hostname of your server machine"), NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, t@@ -295,23 +288,6 @@ struct GLOBALS Globals[] = { {NULL, NULL, NULL, &MetaServer.Comment, NULL, "MetaServer.Comment", N_("Server description, reported to the metaserver"), NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {NULL, &MetaServer.UseSocks, NULL, NULL, NULL, "MetaServer.UseSocks", - N_("If TRUE, use SOCKS for metaserver communication"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {NULL, NULL, NULL, &MetaServer.authuser, NULL, "MetaServer.Auth.User", - N_("Username for HTTP Basic authentication"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {NULL, NULL, NULL, &MetaServer.authpassword, NULL, - "MetaServer.Auth.Password", - N_("Password for HTTP Basic authentication"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {NULL, NULL, NULL, &MetaServer.proxyuser, NULL, "MetaServer.Proxy.User", - N_("Username for HTTP Basic proxy authentication"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, - {NULL, NULL, NULL, &MetaServer.proxypassword, NULL, - "MetaServer.Proxy.Password", - N_("Password for HTTP Basic proxy authentication"), - NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 0}, #endif /* NETWORKING */ #ifdef CYGWIN {NULL, &MinToSysTray, NULL, NULL, NULL, "MinToSysTray", t@@ -1676,17 +1652,10 @@ void CopyNames(struct NAMES *dest, struct NAMES *src) void CopyMetaServer(struct METASERVER *dest, struct METASERVER *src) { dest->Active = src->Active; - dest->ProxyPort = src->ProxyPort; - dest->UseSocks = src->UseSocks; AssignName(&dest->URL, src->URL); - AssignName(&dest->ProxyName, src->ProxyName); AssignName(&dest->LocalName, src->LocalName); AssignName(&dest->Password, src->Password); AssignName(&dest->Comment, src->Comment); - AssignName(&dest->authuser, src->authuser); - AssignName(&dest->authpassword, src->authpassword); - AssignName(&dest->proxyuser, src->proxyuser); - AssignName(&dest->proxypassword, src->proxypassword); } #endif | |
diff --git a/src/dopewars.h b/src/dopewars.h | |
t@@ -101,11 +101,7 @@ struct SOUNDS { struct METASERVER { gboolean Active; gchar *URL; - gchar *ProxyName; - unsigned ProxyPort; gchar *LocalName, *Password, *Comment; - gboolean UseSocks; - gchar *authuser, *authpassword, *proxyuser, *proxypassword; }; #endif | |
diff --git a/src/gui_client/optdialog.c b/src/gui_client/optdialog.c | |
t@@ -920,18 +920,6 @@ void OptDialog(GtkWidget *widget, gpointer data) entry = NewConfigEntry("MetaServer.URL"); gtk_table_attach_defaults(GTK_TABLE(table), entry, 1, 4, 1, 2); - label = gtk_label_new(_("Web proxy hostname")); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, - GTK_SHRINK, GTK_SHRINK, 0, 0); - entry = NewConfigEntry("MetaServer.ProxyName"); - gtk_table_attach_defaults(GTK_TABLE(table), entry, 1, 2, 2, 3); - - label = gtk_label_new(_("Port")); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 2, 3, - GTK_SHRINK, GTK_SHRINK, 0, 0); - entry = NewConfigEntry("MetaServer.ProxyPort"); - gtk_table_attach_defaults(GTK_TABLE(table), entry, 3, 4, 2, 3); - label = gtk_label_new(_("Comment")); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_SHRINK, GTK_SHRINK, 0, 0); | |
diff --git a/src/serverside.c b/src/serverside.c | |
t@@ -168,49 +168,6 @@ void log_meta_headers(gpointer data, gpointer user_data) if (*header) dopelog(4, LF_SERVER, _("MetaServer: %s"), header); } - -static void ServerHttpAuth(HttpConnection *conn, gboolean proxyauth, - gchar *realm, gpointer data) -{ - gchar *user = NULL, *password = NULL; - - if (proxyauth) { - if (MetaServer.proxyuser[0] && MetaServer.proxypassword[0]) { - user = MetaServer.proxyuser; - password = MetaServer.proxypassword; - dopelog(3, LF_SERVER, - _("Using MetaServer.Proxy.User and " - "MetaServer.Proxy.Password for HTTP proxy authentication")); - } else { - dopelog(0, LF_SERVER, - _("Unable to authenticate with HTTP proxy; please " - "set MetaServer.Proxy.User and " - "MetaServer.Proxy.Password variables")); - } - } else { - if (MetaServer.authuser[0] && MetaServer.authpassword[0]) { - user = MetaServer.authuser; - password = MetaServer.authpassword; - dopelog(3, LF_SERVER, - _("Using MetaServer.Auth.User and MetaServer.Auth.Password " - "for HTTP authentication")); - } else { - dopelog(0, LF_SERVER, - _("Unable to authenticate with HTTP server; please set " - "MetaServer.Auth.User and " - "MetaServer.Auth.Password variables")); - } - } - SetHttpAuthentication(conn, proxyauth, user, password); -} - -static void ServerNetBufAuth(NetworkBuffer *netbuf, gpointer data) -{ - dopelog(3, LF_SERVER, - _("Using Socks.Auth.User and Socks.Auth.Password " - "for SOCKS5 authentication")); - SendSocks5UserPasswd(netbuf, Socks.authuser, Socks.authpassword); -} #endif /* |