Merge branch 'master' of git://github.com/wesnoth/wesnoth
This commit is contained in:
commit
d3fb787196
2 changed files with 15 additions and 11 deletions
|
@ -18,7 +18,7 @@ def CheckPango(context, backend, require_version = None):
|
|||
env["ENV"]["PKG_CONFIG_PATH"] = environ.get("PKG_CONFIG_PATH")
|
||||
version_arg = ""
|
||||
if require_version:
|
||||
version_arg = " \\>= " + require_version
|
||||
version_arg = env["ESCAPE"](" >= ") + require_version
|
||||
env.ParseConfig("pkg-config --libs --cflags $PKGCONFIG_FLAGS pango" + backend + version_arg)
|
||||
context.Result("yes")
|
||||
return True
|
||||
|
|
|
@ -48,8 +48,11 @@
|
|||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
static lg::log_domain log_network("network");
|
||||
#define LOG_CS if(lg::err.dont_log(log_network)) ; else lg::err(log_network, false)
|
||||
static lg::log_domain log_campaignd("campaignd");
|
||||
#define DBG_CS LOG_STREAM(debug, log_campaignd)
|
||||
#define LOG_CS LOG_STREAM(info, log_campaignd)
|
||||
#define WRN_CS LOG_STREAM(warn, log_campaignd)
|
||||
#define ERR_CS LOG_STREAM(err, log_campaignd)
|
||||
|
||||
//compatibility code for MS compilers
|
||||
#ifndef SIGHUP
|
||||
|
@ -177,7 +180,7 @@ void server::load_blacklist()
|
|||
blacklist_.read(blcfg);
|
||||
LOG_CS << "using blacklist from " << blacklist_file_ << '\n';
|
||||
} catch(const config::error&) {
|
||||
LOG_CS << "ERROR: failed to read blacklist from " << blacklist_file_ << ", blacklist disabled\n";
|
||||
ERR_CS << "failed to read blacklist from " << blacklist_file_ << ", blacklist disabled\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,13 +203,13 @@ void server::fire(const std::string& hook, const std::string& addon)
|
|||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
LOG_CS << "ERROR: Tried to execute a script on an unsupported platform" << std::endl;
|
||||
ERR_CS << "Tried to execute a script on an unsupported platform\n";
|
||||
return;
|
||||
#else
|
||||
pid_t childpid;
|
||||
|
||||
if((childpid = fork()) == -1) {
|
||||
LOG_CS << "ERROR: fork failed while updating campaign " << addon << std::endl;
|
||||
ERR_CS << "fork failed while updating campaign " << addon << '\n';
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -238,7 +241,7 @@ void server::send_error(const std::string& msg, network::connection sock)
|
|||
{
|
||||
config cfg;
|
||||
cfg.add_child("error")["message"] = msg;
|
||||
LOG_CS << "ERROR [" << network::ip_address(sock) << "]: " << msg << '\n';
|
||||
ERR_CS << "[" << network::ip_address(sock) << "]: " << msg << '\n';
|
||||
network::send_data(cfg, sock);
|
||||
}
|
||||
|
||||
|
@ -298,7 +301,7 @@ void server::run()
|
|||
}
|
||||
} catch(network::error& e) {
|
||||
if(!e.socket) {
|
||||
LOG_CS << "fatal network error: " << e.message << "\n";
|
||||
ERR_CS << "fatal network error: " << e.message << "\n";
|
||||
throw;
|
||||
} else {
|
||||
LOG_CS << "client disconnect: " << e.message << " " << network::ip_address(e.socket) << "\n";
|
||||
|
@ -317,7 +320,7 @@ void server::run()
|
|||
}
|
||||
|
||||
if(err_sock) {
|
||||
LOG_CS << "client disconnect due to exception: " << e.what() << " " << network::ip_address(err_sock) << "\n";
|
||||
ERR_CS << "client disconnect due to exception: " << e.what() << " " << network::ip_address(err_sock) << "\n";
|
||||
network::disconnect(err_sock);
|
||||
} else {
|
||||
throw;
|
||||
|
@ -445,7 +448,7 @@ void server::handle_request_campaign(const server::request& req)
|
|||
|
||||
if(size < 0) {
|
||||
std::cerr << " size: <unknown> KiB\n";
|
||||
LOG_CS << "File size unknown, aborting send.\n";
|
||||
ERR_CS << "File size unknown, aborting send.\n";
|
||||
send_error("Add-on '" + req.cfg["name"].str() + "' could not be read by the server.", req.sock);
|
||||
return;
|
||||
}
|
||||
|
@ -655,7 +658,7 @@ void server::handle_delete(const server::request& req)
|
|||
// Erase the campaign.
|
||||
write_file(campaign["filename"], std::string());
|
||||
if(remove(campaign["filename"].str().c_str()) != 0) {
|
||||
LOG_CS << "failed to delete archive for campaign '" << erase["name"]
|
||||
ERR_CS << "failed to delete archive for campaign '" << erase["name"]
|
||||
<< "' (" << campaign["filename"] << "): " << strerror(errno)
|
||||
<< '\n';
|
||||
}
|
||||
|
@ -710,6 +713,7 @@ int main(int argc, char**argv)
|
|||
{
|
||||
game_config::path = get_cwd();
|
||||
|
||||
lg::set_log_domain_severity("campaignd", lg::info);
|
||||
lg::timestamps(true);
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue