mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
shared pointers for streams
This commit is contained in:
@@ -73,7 +73,7 @@ namespace api
|
||||
i2p::data::netdb.RequestDestination (remote, true, dest->GetTunnelPool ());
|
||||
}
|
||||
|
||||
i2p::stream::Stream * CreateStream (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote)
|
||||
std::shared_ptr<i2p::stream::Stream> CreateStream (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote)
|
||||
{
|
||||
auto leaseSet = i2p::data::netdb.FindLeaseSet (remote);
|
||||
if (leaseSet)
|
||||
@@ -95,7 +95,7 @@ namespace api
|
||||
dest->AcceptStreams (acceptor);
|
||||
}
|
||||
|
||||
void DestroyStream (i2p::stream::Stream * stream)
|
||||
void DestroyStream (std::shared_ptr<i2p::stream::Stream> stream)
|
||||
{
|
||||
if (stream)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef API_H__
|
||||
#define API_H__
|
||||
|
||||
#include <memory>
|
||||
#include "Identity.h"
|
||||
#include "Destination.h"
|
||||
#include "Streaming.h"
|
||||
@@ -16,14 +17,14 @@ namespace api
|
||||
|
||||
// destinations
|
||||
i2p::client::ClientDestination * CreateLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true);
|
||||
i2p::client::ClientDestination * CreateLocalDestination (bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_DSA_SHA1); // transient destinations usually not published
|
||||
i2p::client::ClientDestination * CreateLocalDestination (bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256); // transient destinations usually not published
|
||||
void DestoroyLocalDestination (i2p::client::ClientDestination * dest);
|
||||
|
||||
// streams
|
||||
void RequestLeaseSet (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote);
|
||||
i2p::stream::Stream * CreateStream (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote);
|
||||
std::shared_ptr<i2p::stream::Stream> CreateStream (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote);
|
||||
void AcceptStream (i2p::client::ClientDestination * dest, const i2p::stream::StreamingDestination::Acceptor& acceptor);
|
||||
void DestroyStream (i2p::stream::Stream * stream);
|
||||
void DestroyStream (std::shared_ptr<i2p::stream::Stream> stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user