2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2010-2022 Mnemosyne LLC.
|
2022-08-08 18:05:39 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2011-03-11 04:19:01 +00:00
|
|
|
|
2017-11-14 20:21:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-08-11 18:11:55 +00:00
|
|
|
#ifndef LIBTRANSMISSION_ANNOUNCER_MODULE
|
2017-04-19 12:04:45 +00:00
|
|
|
#error only the libtransmission announcer module should #include this header.
|
2011-03-11 04:19:01 +00:00
|
|
|
#endif
|
|
|
|
|
2021-11-04 00:55:04 +00:00
|
|
|
#include <array>
|
2022-04-08 01:50:26 +00:00
|
|
|
#include <cstdint> // uint64_t
|
2022-07-27 21:53:39 +00:00
|
|
|
#include <optional>
|
2021-09-30 21:33:31 +00:00
|
|
|
#include <string>
|
2022-01-31 23:05:35 +00:00
|
|
|
#include <string_view>
|
2022-01-23 05:41:01 +00:00
|
|
|
#include <vector>
|
2021-09-30 21:33:31 +00:00
|
|
|
|
2021-11-04 00:55:04 +00:00
|
|
|
#include "transmission.h"
|
2021-12-15 21:25:42 +00:00
|
|
|
|
2022-10-21 18:15:14 +00:00
|
|
|
#include "announcer.h"
|
2021-12-23 17:16:05 +00:00
|
|
|
#include "interned-string.h"
|
2022-04-21 15:58:13 +00:00
|
|
|
#include "net.h"
|
2022-01-25 04:25:55 +00:00
|
|
|
#include "peer-mgr.h" // tr_pex
|
2022-08-06 01:37:21 +00:00
|
|
|
|
|
|
|
struct tr_url_parsed_t;
|
2011-03-11 04:19:01 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
void tr_tracker_http_scrape(
|
2022-09-06 17:52:58 +00:00
|
|
|
tr_session const* session,
|
2021-08-15 09:41:48 +00:00
|
|
|
tr_scrape_request const* req,
|
|
|
|
tr_scrape_response_func response_func,
|
2017-04-19 12:04:45 +00:00
|
|
|
void* user_data);
|
2011-03-11 04:19:01 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
void tr_tracker_http_announce(
|
2022-09-06 17:52:58 +00:00
|
|
|
tr_session const* session,
|
2021-08-15 09:41:48 +00:00
|
|
|
tr_announce_request const* req,
|
|
|
|
tr_announce_response_func response_func,
|
2017-04-19 12:04:45 +00:00
|
|
|
void* user_data);
|
2011-03-11 04:19:01 +00:00
|
|
|
|
2022-08-26 18:35:28 +00:00
|
|
|
void tr_announcerParseHttpAnnounceResponse(tr_announce_response& response, std::string_view benc, std::string_view log_name);
|
2022-01-25 04:25:55 +00:00
|
|
|
|
2022-08-26 18:35:28 +00:00
|
|
|
void tr_announcerParseHttpScrapeResponse(tr_scrape_response& response, std::string_view benc, std::string_view log_name);
|
2022-01-27 23:18:50 +00:00
|
|
|
|
2021-12-23 17:16:05 +00:00
|
|
|
tr_interned_string tr_announcerGetKey(tr_url_parsed_t const& parsed);
|