2023-11-01 21:11:11 +00:00
|
|
|
// This file Copyright © 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.
|
2008-06-07 21:26:41 +00:00
|
|
|
|
2017-11-14 20:21:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
2008-11-24 20:17:36 +00:00
|
|
|
#ifndef __TRANSMISSION__
|
2017-04-19 12:04:45 +00:00
|
|
|
#error only libtransmission should #include this header.
|
2008-11-24 20:17:36 +00:00
|
|
|
#endif
|
|
|
|
|
2024-04-02 14:31:20 +00:00
|
|
|
#include <memory>
|
2021-10-07 13:33:55 +00:00
|
|
|
#include <string_view>
|
2008-06-07 21:26:41 +00:00
|
|
|
|
2023-07-08 15:24:03 +00:00
|
|
|
#include "libtransmission/transmission.h"
|
|
|
|
|
|
|
|
#include "libtransmission/peer-common.h"
|
2008-06-07 21:26:41 +00:00
|
|
|
|
2023-08-01 14:56:26 +00:00
|
|
|
using tr_peer_callback_webseed = tr_peer_callback_generic;
|
|
|
|
|
2024-04-02 14:31:20 +00:00
|
|
|
class tr_webseed : public tr_peer
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
explicit tr_webseed(tr_torrent& tor_in)
|
|
|
|
: tr_peer{ tor_in }
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
[[nodiscard]] static std::unique_ptr<tr_webseed> create(
|
|
|
|
tr_torrent& torrent,
|
|
|
|
std::string_view,
|
|
|
|
tr_peer_callback_webseed callback,
|
|
|
|
void* callback_data);
|
|
|
|
|
|
|
|
[[nodiscard]] virtual tr_webseed_view get_view() const = 0;
|
|
|
|
};
|