This commit is contained in:
Adrien Beraud authored and Adrien Béraud committed 2017-10-17 19:00:53 +02:00
1 parent 2acdc1f1aa
commit 419fc24f1f
4 files changed
+65 -33

No files matched your search

+4 -3
View File
@@ -479,10 +479,10 @@ private:
};
int send(msgpack::sbuffer& msg, const Sp<Node>& node);
int send(msgpack::sbuffer& msg, const Node& node, const Sp<TcpSocket>& sock = {});
int sendUDP(msgpack::sbuffer& msg, const SockAddr& addr);
int send(const Blob& msg, int flags, const Sp<Node>& node, UdpSocket::OnSent&& cb);
int send(const Blob& msg, int flags, const Node& node, UdpSocket::OnSent&& cb);
void startTcp(const Sp<TcpSocket>& sock, const Sp<Node>& node = {});
@@ -519,7 +519,8 @@ private:
TransId tid,
uint16_t code,
const std::string& message,
bool include_id=false);
bool include_id=false,
const Sp<TcpSocket>& sock= {});
void deserializeNodes(ParsedMessage& msg, const SockAddr& from);
+7 -2
View File
@@ -53,7 +53,7 @@ struct Node {
Sp<TcpSocket> sock;
InfoHash last_known_pk;
//std::list<crypto::EcSecretKey>
//std::list<crypto::EcSecretKey>
Node(const InfoHash& id, const SockAddr& addr, const Sp<TcpSocket>& s = {}, bool client=false);
Node(const InfoHash& id, const sockaddr* sa, socklen_t salen)
@@ -70,6 +70,7 @@ struct Node {
std::string getAddrStr() const {
return addr.toString();
}
bool isClient() const { return is_client; }
bool isIncoming() { return time > reply_time; }
@@ -77,8 +78,12 @@ struct Node {
const time_point& getReplyTime() const { return reply_time; }
void setTime(const time_point& t) { time = t; }
SockAddr getAddress() const {
return canStream() ? sock->getPeerAddr() : addr;
}
void startTCP() {
}
/**