Merge branch 'master' of git.c3d2.de:sic++

Conflicts:
	src/sicmain.cc
master
john stone 9 years ago
commit 921ac4f8ef

@ -10,7 +10,7 @@ std::string DynamicObjects::render_object_list(){
for (auto& it : this->m_thevec){
output += u8"<li>\n";
output += u8"<a href=\"" + m_merouterin->get_baseurl() + it.get_path() + u8"\">"; //we could include baseurl here?
output += u8"<a href=\"" + m_merouterin->get_baseurl() + it.get_filepath() + u8"\">"; //we could include baseurl here?
output += it.get_filename();
output += u8"</a> <span class=\"size\">";
output += it.get_pretty_sized();

@ -84,7 +84,7 @@ class SicccPersister
json_t *root = json_object();
json_object_set_new(root, "filename", get_json_from_string(so.get_filename()));
json_object_set_new(root, "filetype", get_json_from_string(so.get_filetype()));
json_object_set_new(root, "path", get_json_from_string(so.get_path()));
json_object_set_new(root, "path", get_json_from_string(so.get_filepath()));
json_object_set_new(root, "size", get_json_from_integer(so.get_size()));
std::string tmp = time_to_string(so.get_uploadtime());
json_object_set_new(root, "upload_time", get_json_from_string(tmp));
@ -110,7 +110,7 @@ class SicccPersister
struct dirent *entry = nullptr;
std::vector<Sicccobject> v;
json_error_t *error = nullptr;
if ((dir = opendir(merouter.get_persist_path().c_str())) == NULL) {
if ((dir = opendir(merouter.get_json_path().c_str())) == NULL) {
std::cerr << "Error could not open directory" << std::endl;
return v; // should throw exception instea1d
}
@ -155,7 +155,6 @@ class SicccPersister
int write_sicccfile(const Sicccobject&);
int write_sicccfile();
/* std::vector<Sicccobject> read_sicccdir(); */
Sicccobject read_json(const std::string&);
Sicccobject read_json() { return read_json(json_file_name); }

@ -17,7 +17,7 @@ int
SicccPersister::write_sicccfile()
{
assert(!json_file_name.empty());
std::string store_str = merouter.get_persist_path() + "/" + beautify_filename();
std::string store_str = merouter.get_json_path() + "/" + beautify_filename();
assert(root);
int ret = json_dump_file(root, store_str.c_str(), JSON_INDENT(4));
return ret;

@ -18,7 +18,7 @@ class Sicccobject {
const size_t sz)
: filename(file),
filetype(ftype),
path(fpath),
filepath(fpath),
size(sz)
{
upload_date = std::chrono::system_clock::now();
@ -30,7 +30,7 @@ class Sicccobject {
const size_t sz)
: filename(file),
filetype(ftype),
path(fpath),
filepath(fpath),
size(sz)
{
upload_date = std::chrono::system_clock::now();
@ -43,7 +43,7 @@ class Sicccobject {
const std::chrono::time_point<std::chrono::system_clock>& date)
: filename(file),
filetype(ftype),
path(fpath),
filepath(fpath),
size(sz),
upload_date(date) { }
@ -54,7 +54,7 @@ class Sicccobject {
std::string get_filename() const { return filename; }
std::string get_filetype() const { return filetype; }
std::string get_path() const { return path; }
std::string get_filepath() const { return filepath; }
size_t get_size() const { return size; }
std::chrono::time_point<std::chrono::system_clock>
get_uploadtime() const { return upload_date; }
@ -77,7 +77,7 @@ class Sicccobject {
private:
std::string filename;
std::string filetype;
std::string path;
std::string filepath;
size_t size;
std::chrono::time_point<std::chrono::system_clock> upload_date;
};

@ -29,7 +29,8 @@ class MongooseHandler{
listenport(listenport)
{
char portstring[8];
std::snprintf(portstring,8,"%d",this->listenport);
const char *options[] =
{"listening_ports",portstring,nullptr};

Loading…
Cancel
Save