upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/tollgate_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/tollgate_api.c')
-rw-r--r--main/tollgate_api.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/main/tollgate_api.c b/main/tollgate_api.c
index 5ac0543..80fe6ed 100644
--- a/main/tollgate_api.c
+++ b/main/tollgate_api.c
@@ -6,9 +6,6 @@
6#include "captive_portal.h" 6#include "captive_portal.h"
7#include "firewall.h" 7#include "firewall.h"
8#include "lwip/dns.h" 8#include "lwip/dns.h"
9#include "lwip/netdb.h"
10#include "esp_http_client.h"
11#include "esp_crt_bundle.h"
12#include "esp_heap_caps.h" 9#include "esp_heap_caps.h"
13#include "nucula_wallet.h" 10#include "nucula_wallet.h"
14#include "mint_health.h" 11#include "mint_health.h"
@@ -734,19 +731,6 @@ static esp_err_t api_get_debug(httpd_req_t *req)
734 cJSON_AddStringToObject(root, "sta_ip", sta_ip_str); 731 cJSON_AddStringToObject(root, "sta_ip", sta_ip_str);
735 cJSON_AddStringToObject(root, "sta_gw", sta_gw_str); 732 cJSON_AddStringToObject(root, "sta_gw", sta_gw_str);
736 733
737 struct addrinfo hints = {0}, *res = NULL;
738 hints.ai_family = AF_INET;
739 int dns_rc = getaddrinfo("testnut-compat.mints.orangesync.tech", NULL, &hints, &res);
740 if (dns_rc == 0 && res) {
741 struct sockaddr_in *addr = (struct sockaddr_in *)res->ai_addr;
742 char resolved[16];
743 snprintf(resolved, sizeof(resolved), IPSTR, IP2STR(&(esp_ip4_addr_t){.addr=addr->sin_addr.s_addr}));
744 cJSON_AddStringToObject(root, "dns_resolve", resolved);
745 } else {
746 cJSON_AddStringToObject(root, "dns_resolve", dns_rc == 0 ? "no-addr" : "FAIL");
747 }
748 if (res) freeaddrinfo(res);
749
750 char *json = cJSON_PrintUnformatted(root); 734 char *json = cJSON_PrintUnformatted(root);
751 httpd_resp_set_type(req, "application/json"); 735 httpd_resp_set_type(req, "application/json");
752 httpd_resp_sendstr(req, json); 736 httpd_resp_sendstr(req, json);