From 451947b7bed5ba6c9c925ceb10df39c42a330614 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 1 Nov 2026 21:38:11 +0100 Subject: Live logging networks was defunc for a while, does not work with v6, so we remove it --- ot_http.c | 68 ++------------------------------------------------------------- 1 file changed, 2 insertions(+), 66 deletions(-) (limited to 'ot_http.c') diff --git a/ot_http.c b/ot_http.c index b0e1de3..980e256 100644 --- a/ot_http.c +++ b/ot_http.c @@ -292,7 +292,6 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c {"version", TASK_STATS_VERSION}, {"everything", TASK_STATS_EVERYTHING}, {"statedump", TASK_FULLSCRAPE_TRACKERSTATE}, - {"fulllog", TASK_STATS_FULLLOG}, {"woodpeckers", TASK_STATS_WOODPECKERS}, #ifdef WANT_LOG_NUMWANT {"numwants", TASK_STATS_NUMWANTS}, @@ -559,10 +558,7 @@ static ot_keywords keywords_announce[] = {{"port", 1}, {"left", 2}, {"event", #ifdef WANT_IP_FROM_QUERY_STRING {"ip", 7}, #endif -#ifdef WANT_FULLLOG_NETWORKS - {"lognet", 8}, -#endif - {"peer_id", 9}, {NULL, -3}}; + {"peer_id", 8}, {NULL, -3}}; static ot_keywords keywords_announce_event[] = {{"completed", 1}, {"stopped", 2}, {NULL, -3}}; /* For the replies that are one fixed string and nothing else, where the only @@ -687,43 +683,7 @@ static ssize_t http_handle_announce(const int64_t sock, struct ot_workstruct OT_SETIP(&ws->peer, tmp_buf1); } break; #endif -#ifdef WANT_FULLLOG_NETWORKS - case 8: /* matched "lognet" */ - { - // if( accesslist_is_blessed( cookie->ip, OT_PERMISSION_MAY_STAT ) ) { - char *tmp_buf = ws->reply; - ot_net net; - uint64_t value; - signed short parsed, bits; - - len = urlencoded_parse(&read_ptr, tmp_buf, SCAN_SEARCHPATH_VALUE); - tmp_buf[len] = 0; - if (len <= 0) - HTTPERROR_400_PARAM; - if (*tmp_buf == '-') { - loglist_reset(); - return ws->reply_size = reply_literal(ws, "Successfully removed.\n"); - } - parsed = ip_parse(tmp_buf, net.address); - if (!parsed) - HTTPERROR_400_PARAM; - if (tmp_buf[parsed++] != '/') - bits = 128; - else { - parsed = scan_uint(tmp_buf + parsed, &value, 128); - if (!parsed) - HTTPERROR_400_PARAM; - bits = (signed short)value; - if (ip_is_v4mapped(net.address)) - bits += 96; - } - net.bits = bits; - loglist_add_network(&net); - return ws->reply_size = reply_literal(ws, "Successfully added.\n"); - //} - } break; -#endif - case 9: /* matched "peer_id" */ + case 8: /* matched "peer_id" */ /* ignore this, when we have less than 20 bytes */ if (urlencoded_parse(&read_ptr, write_ptr = read_ptr, SCAN_SEARCHPATH_VALUE) != 20) HTTPERROR_400_PARAM; @@ -757,30 +717,6 @@ ssize_t http_handle_request(const int64_t sock, struct ot_workstruct *ws) { ssize_t reply_off, len; char *read_ptr = ws->request, *write_ptr; -#ifdef WANT_FULLLOG_NETWORKS - struct http_data *cookie = fdstate_cookie(sock); - if (loglist_check_address(cookie->ip)) { - ot_log *log = malloc(sizeof(ot_log)); - if (log) { - log->size = ws->request_size; - log->data = malloc(ws->request_size); - log->next = 0; - log->time = time_now_seconds(); - memcpy(log->ip, cookie->ip, sizeof(ot_ip6)); - if (log->data) { - memcpy(log->data, ws->request, ws->request_size); - if (!g_logchain_first) - g_logchain_first = g_logchain_last = log; - else { - g_logchain_last->next = log; - g_logchain_last = log; - } - } else - free(log); - } - } -#endif - #ifdef _DEBUG_HTTPERROR reply_off = ws->request_size; if (ws->request_size >= G_DEBUGBUF_SIZE) -- cgit v1.3