From: Steinar H. Gunderson Date: Thu, 11 Apr 2013 19:08:14 +0000 (+0200) Subject: Move version identification into a common place. X-Git-Tag: 1.0.0~148 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=742f56c25bdd54dc438b21cb5e422de520bc7231 Move version identification into a common place. --- diff --git a/httpinput.cpp b/httpinput.cpp index 1db4f91..012f5bc 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -23,6 +23,7 @@ #include "server.h" #include "serverpool.h" #include "parse.h" +#include "version.h" #include "state.pb.h" using namespace std; @@ -163,7 +164,7 @@ bool HTTPInput::parse_response(const std::string &request) // TODO: Make case-insensitive. // XXX: Use a Via: instead? if (parameters.count("Server") == 0) { - parameters.insert(make_pair("Server", "metacube/0.1")); + parameters.insert(make_pair("Server", SERVER_IDENTIFICATION)); } else { for (multimap::iterator it = parameters.begin(); it != parameters.end(); @@ -171,7 +172,7 @@ bool HTTPInput::parse_response(const std::string &request) if (it->first != "Server") { continue; } - it->second = "metacube/0.1 (reflecting: " + it->second + ")"; + it->second = SERVER_IDENTIFICATION " (reflecting: " + it->second + ")"; } } diff --git a/main.cpp b/main.cpp index 04d0d3d..e258c86 100644 --- a/main.cpp +++ b/main.cpp @@ -27,6 +27,7 @@ #include "input.h" #include "httpinput.h" #include "stats.h" +#include "version.h" #include "state.pb.h" using namespace std; @@ -323,7 +324,7 @@ void create_streams(const vector &config, int main(int argc, char **argv) { - fprintf(stderr, "\nCubemap starting.\n"); + fprintf(stderr, "\nCubemap " SERVER_VERSION " starting.\n"); struct timeval serialize_start; bool is_reexec = false; diff --git a/version.h b/version.h new file mode 100644 index 0000000..5b5596a --- /dev/null +++ b/version.h @@ -0,0 +1,9 @@ +#ifndef _VERSION_H +#define _VERSION_H + +// Version number. Don't expect this to change all that often. + +#define SERVER_VERSION "0.1" +#define SERVER_IDENTIFICATION "Cubemap/" SERVER_VERSION + +#endif // !defined(_VERSION_H)