mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 03:06:31 -04:00
Add I2P BOB support to libretroashare and RetroShare GUI
This commit is contained in:
parent
9ff81b9e93
commit
a3ee85a30d
31 changed files with 4150 additions and 959 deletions
31
libretroshare/src/pqi/pqissli2pbob.cpp
Normal file
31
libretroshare/src/pqi/pqissli2pbob.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "pqissli2pbob.h"
|
||||
|
||||
bool pqissli2pbob::connect_parameter(uint32_t type, const std::string &value)
|
||||
{
|
||||
if (type == NET_PARAM_CONNECT_DOMAIN_ADDRESS)
|
||||
{
|
||||
RS_STACK_MUTEX(mSslMtx);
|
||||
// a new line must be appended!
|
||||
mI2pAddr = value + '\n';
|
||||
return true;
|
||||
}
|
||||
|
||||
return pqissl::connect_parameter(type, value);
|
||||
}
|
||||
|
||||
int pqissli2pbob::Basic_Connection_Complete()
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = pqissl::Basic_Connection_Complete()) != 1)
|
||||
{
|
||||
// basic connection not complete.
|
||||
return ret;
|
||||
}
|
||||
|
||||
// send addr. (new line is already appended)
|
||||
ret = send(sockfd, mI2pAddr.c_str(), mI2pAddr.length(), 0);
|
||||
if (ret != (int)mI2pAddr.length())
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue