Remove now obsolete todo's, spotted by BlindOracle.
This commit is contained in:
parent
a7f9b87644
commit
90788f2ba0
1 changed files with 0 additions and 22 deletions
|
@ -310,20 +310,17 @@ namespace {
|
|||
|
||||
config response;
|
||||
response.add_child("campaigns",campaign_list);
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(response, sock, true);
|
||||
} else if(const config* req = data.child("request_campaign")) {
|
||||
LOG_CS << "sending campaign '" << (*req)["name"] << "' to " << network::ip_address(sock) << "\n";
|
||||
config* const campaign = campaigns().find_child("campaign","name",(*req)["name"]);
|
||||
if(campaign == NULL) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error("Add-on '" + (*req)["name"] + "'not found."), sock, true);
|
||||
} else {
|
||||
config cfg;
|
||||
scoped_istream stream = istream_file((*campaign)["filename"]);
|
||||
read_compressed(cfg, *stream);
|
||||
add_license(cfg);
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(cfg, sock, true);
|
||||
|
||||
const int downloads = lexical_cast_default<int>((*campaign)["downloads"],0)+1;
|
||||
|
@ -332,7 +329,6 @@ namespace {
|
|||
|
||||
} else if(data.child("request_terms") != NULL) {
|
||||
LOG_CS << "sending terms " << network::ip_address(sock) << "\n";
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message("All add-ons uploaded to this server must be licensed under the terms of the GNU General Public License (GPL). By uploading content to this server, you certify that you have the right to place the content under the conditions of the GPL, and choose to do so."), sock, true);
|
||||
LOG_CS << " Done\n";
|
||||
} else if(config* upload = data.child("upload")) {
|
||||
|
@ -340,15 +336,12 @@ namespace {
|
|||
config* data = upload->child("data");
|
||||
config* campaign = campaigns().find_child("campaign","name",(*upload)["name"]);
|
||||
if(data == NULL) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
LOG_CS << "Upload aborted no data.\n";
|
||||
network::send_data(construct_error("No add-on data was supplied."), sock, true);
|
||||
} else if(campaign_name_legal((*upload)["name"]) == false) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
LOG_CS << "Upload aborted invalid name.\n";
|
||||
network::send_data(construct_error("The name of the add-on is invalid"), sock, true);
|
||||
} else if(check_names_legal(*data) == false) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
LOG_CS << "Upload aborted invalid file name.\n";
|
||||
network::send_data(construct_error("The add-on contains an illegal file or directory name."), sock, true);
|
||||
} else if(campaign != NULL && (*campaign)["passphrase"] != (*upload)["passphrase"]) {
|
||||
|
@ -381,11 +374,9 @@ namespace {
|
|||
file_size(filename));
|
||||
scoped_ostream cfgfile = ostream_file(file_);
|
||||
write(*cfgfile, cfg_);
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message(message), sock, true);
|
||||
|
||||
} else {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
LOG_CS << "Upload aborted invalid passphrase.\n";
|
||||
network::send_data(construct_error("The add-on already exists, and your passphrase was incorrect."), sock, true);
|
||||
}
|
||||
|
@ -439,7 +430,6 @@ namespace {
|
|||
file_size(filename));
|
||||
scoped_ostream cfgfile = ostream_file(file_);
|
||||
write(*cfgfile, cfg_);
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message(message), sock, true);
|
||||
|
||||
fire("hook_post_upload", (*upload)["name"]);
|
||||
|
@ -448,7 +438,6 @@ namespace {
|
|||
LOG_CS << "deleting campaign '" << (*erase)["name"] << "' requested from " << network::ip_address(sock) << "\n";
|
||||
config* const campaign = campaigns().find_child("campaign","name",(*erase)["name"]);
|
||||
if(campaign == NULL) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error("The add-on does not exist."), sock, true);
|
||||
continue;
|
||||
}
|
||||
|
@ -457,7 +446,6 @@ namespace {
|
|||
&& (campaigns()["master_password"] == ""
|
||||
|| campaigns()["master_password"] != (*erase)["passphrase"])) {
|
||||
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error("The passphrase is incorrect."), sock, true);
|
||||
continue;
|
||||
}
|
||||
|
@ -471,7 +459,6 @@ namespace {
|
|||
campaigns().remove_child("campaign",index);
|
||||
scoped_ostream cfgfile = ostream_file(file_);
|
||||
write(*cfgfile, cfg_);
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message("Add-on deleted."), sock, true);
|
||||
|
||||
fire("hook_post_erase", (*erase)["name"]);
|
||||
|
@ -479,33 +466,26 @@ namespace {
|
|||
} else if(const config* cpass = data.child("change_passphrase")) {
|
||||
config* campaign = campaigns().find_child("campaign","name",(*cpass)["name"]);
|
||||
if(campaign == NULL) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error("No add-on with that name exists."), sock, true);
|
||||
} else if((*campaign)["passphrase"] != (*cpass)["passphrase"]) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error("Your old passphrase was incorrect."), sock, true);
|
||||
} else if((const t_string)(*cpass)["new_passphrase"] == "") {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error("No new passphrase was supplied."), sock, true);
|
||||
} else {
|
||||
(*campaign)["passphrase"] = (*cpass)["new_passphrase"];
|
||||
scoped_ostream cfgfile = ostream_file(file_);
|
||||
write(*cfgfile, cfg_);
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message("Passphrase changed."), sock, true);
|
||||
}
|
||||
} else if(const config* cvalidate = data.child("validate_scripts")) {
|
||||
config* campaign = campaigns().find_child("campaign","name",(*cvalidate)["name"]);
|
||||
if(campaign == NULL) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error(
|
||||
"No add-on with that name exists."), sock, true);
|
||||
} else if(campaigns()["master_password"] == "") {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error(
|
||||
"Sever does not allow scripts."), sock, true);
|
||||
} else if (campaigns()["master_password"] != (*cvalidate)["master_password"]) {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_error(
|
||||
"Password was incorrect."), sock, true);
|
||||
} else {
|
||||
|
@ -519,11 +499,9 @@ namespace {
|
|||
scoped_ostream ostream = ostream_file((*campaign)["filename"]);
|
||||
write_compressed(*ostream, campaign_file);
|
||||
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message("The following scripts have been validated: " +
|
||||
scripts), sock, true);
|
||||
} else {
|
||||
//! @todo, maybe we should let the server send gzipped data.
|
||||
network::send_data(construct_message("No unchecked scripts found!"), sock, true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue