mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
fixed compilation error and potentil memory corruption
This commit is contained in:
parent
bf2e8d2350
commit
ca1e1c4896
8
util.cpp
8
util.cpp
@ -91,7 +91,6 @@ namespace filesystem
|
|||||||
{
|
{
|
||||||
const boost::filesystem::path &GetDataDir()
|
const boost::filesystem::path &GetDataDir()
|
||||||
{
|
{
|
||||||
|
|
||||||
static boost::filesystem::path path;
|
static boost::filesystem::path path;
|
||||||
|
|
||||||
if (i2p::util::config::mapArgs.count("-datadir")) {
|
if (i2p::util::config::mapArgs.count("-datadir")) {
|
||||||
@ -106,7 +105,8 @@ namespace filesystem
|
|||||||
if (!boost::filesystem::create_directory( path ))
|
if (!boost::filesystem::create_directory( path ))
|
||||||
{
|
{
|
||||||
LogPrint("Failed to create data directory!");
|
LogPrint("Failed to create data directory!");
|
||||||
return "";
|
path = "";
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!boost::filesystem::is_directory(path)) {
|
if (!boost::filesystem::is_directory(path)) {
|
||||||
@ -181,7 +181,9 @@ namespace http
|
|||||||
{
|
{
|
||||||
i2p::util::http::url u(address);
|
i2p::util::http::url u(address);
|
||||||
boost::asio::ip::tcp::iostream site;
|
boost::asio::ip::tcp::iostream site;
|
||||||
site.expires_from_now (boost::posix_time::seconds(30));
|
// please don't uncomment following line because it's not compatible with boost 1.46
|
||||||
|
// 1.46 is default boost for Ubuntu 12.04 LTS
|
||||||
|
//site.expires_from_now (boost::posix_time::seconds(30));
|
||||||
site.connect(u.host_, "http");
|
site.connect(u.host_, "http");
|
||||||
if (site)
|
if (site)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user