mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
Fixing reseed
This commit is contained in:
parent
04cf2031ef
commit
11e11df5ca
15
Reseed.cpp
15
Reseed.cpp
@ -1,6 +1,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
#include "Reseed.h"
|
#include "Reseed.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@ -56,6 +57,7 @@ namespace data
|
|||||||
std::string tmpUrl;
|
std::string tmpUrl;
|
||||||
std::string filename;
|
std::string filename;
|
||||||
std::string ignoreFileSuffix = ".zip";
|
std::string ignoreFileSuffix = ".zip";
|
||||||
|
boost::filesystem::path root = i2p::util::filesystem::GetDataDir();
|
||||||
while (i != j)
|
while (i != j)
|
||||||
{
|
{
|
||||||
name = *i++;
|
name = *i++;
|
||||||
@ -65,9 +67,20 @@ namespace data
|
|||||||
tmpUrl = reseedHost;
|
tmpUrl = reseedHost;
|
||||||
tmpUrl.append(name);
|
tmpUrl.append(name);
|
||||||
routerInfo = i2p::util::http::httpRequest(tmpUrl);
|
routerInfo = i2p::util::http::httpRequest(tmpUrl);
|
||||||
filename = "netDb/r";
|
if (routerInfo.size()==0)
|
||||||
|
continue;
|
||||||
|
filename = root.string();
|
||||||
|
#ifndef _WIN32
|
||||||
|
filename += "/netDb/r";
|
||||||
|
#else
|
||||||
|
filename += "\\netDb\\r";
|
||||||
|
#endif
|
||||||
filename += name.at(11); // first char in id
|
filename += name.at(11); // first char in id
|
||||||
|
#ifndef _WIN32
|
||||||
filename.append("/");
|
filename.append("/");
|
||||||
|
#else
|
||||||
|
filename.append("\\");
|
||||||
|
#endif
|
||||||
filename.append(name.c_str());
|
filename.append(name.c_str());
|
||||||
std::ofstream outfile (filename, std::ios::binary);
|
std::ofstream outfile (filename, std::ios::binary);
|
||||||
outfile << routerInfo;
|
outfile << routerInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user