mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 12:01:05 +00:00
Avoid updating IPv4 MS entry if it failed to register
This commit is contained in:
parent
a75fbd229e
commit
19500742d2
1 changed files with 25 additions and 19 deletions
|
@ -486,20 +486,23 @@ int
|
|||
HMS_unlist (void)
|
||||
{
|
||||
struct HMS_buffer *hms;
|
||||
int ok;
|
||||
int ok = 0;
|
||||
|
||||
hms = HMS_connect(PROTO_V4, "servers/%s/unlist", hms_server_token);
|
||||
if (hms_server_token)
|
||||
{
|
||||
hms = HMS_connect(PROTO_V4, "servers/%s/unlist", hms_server_token);
|
||||
|
||||
if (! hms)
|
||||
return 0;
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
|
||||
ok = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
ok = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
|
||||
free(hms_server_token);
|
||||
free(hms_server_token);
|
||||
}
|
||||
|
||||
#ifndef NO_IPV6
|
||||
if (hms_server_token_ipv6 && hms_allow_ipv6)
|
||||
|
@ -526,18 +529,13 @@ int
|
|||
HMS_update (void)
|
||||
{
|
||||
struct HMS_buffer *hms;
|
||||
int ok;
|
||||
int ok = 0;
|
||||
|
||||
char post[256];
|
||||
|
||||
char *title;
|
||||
|
||||
hms = HMS_connect(PROTO_V4, "servers/%s/update", hms_server_token);
|
||||
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
title = curl_easy_escape(hms->curl, cv_servername.string, 0);
|
||||
title = curl_easy_escape(NULL, cv_servername.string, 0);
|
||||
|
||||
snprintf(post, sizeof post,
|
||||
"title=%s",
|
||||
|
@ -546,10 +544,18 @@ HMS_update (void)
|
|||
|
||||
curl_free(title);
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS, post);
|
||||
if (hms_server_token)
|
||||
{
|
||||
hms = HMS_connect(PROTO_V4, "servers/%s/update", hms_server_token);
|
||||
|
||||
ok = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS, post);
|
||||
|
||||
ok = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
}
|
||||
|
||||
#ifndef NO_IPV6
|
||||
if (hms_server_token_ipv6 && hms_allow_ipv6)
|
||||
|
|
Loading…
Reference in a new issue