Moar edits
This commit is contained in:
parent
9526cdc995
commit
0e8b8932e7
2 changed files with 7 additions and 4 deletions
|
@ -4,10 +4,11 @@ OUT = DDV_Controller
|
|||
INCLUDES =
|
||||
DEBUG = 4
|
||||
OPTIMIZE = -g
|
||||
VERSION = 0.5
|
||||
COMPILED_USERNAME = testuser
|
||||
COMPILED_PASSWORD = 179ad45c6ce2cb97cf1029e212046e81
|
||||
#COMPILED_PASSWORD = testpass
|
||||
CCFLAGS = -Wall -Wextra -funsigned-char $(OPTIMIZE) -DDEBUG=$(DEBUG) -DCOMPILED_USERNAME=$(COMPILED_USERNAME) -DCOMPILED_PASSWORD=$(COMPILED_PASSWORD)
|
||||
CCFLAGS = -Wall -Wextra -funsigned-char $(OPTIMIZE) -DDEBUG=$(DEBUG) -DCOMPILED_USERNAME=$(COMPILED_USERNAME) -DCOMPILED_PASSWORD=$(COMPILED_PASSWORD) -DVERSION=$(VERSION)
|
||||
CC = $(CROSS)g++
|
||||
LD = $(CROSS)ld
|
||||
AR = $(CROSS)ar
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
#define UPLINK_INTERVAL 30
|
||||
|
||||
#define defstr(x) #x ///< converts a define name to string
|
||||
#define STRINGIFY(x) #x
|
||||
#define TOSTRING(x) STRINGIFY(x)
|
||||
|
||||
/// Needed for base64_encode function
|
||||
static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
@ -239,6 +240,7 @@ void CheckConfig(Json::Value & in, Json::Value & out){
|
|||
}
|
||||
}
|
||||
out = in;
|
||||
out["version"] = TOSTRING(VERSION);
|
||||
}
|
||||
|
||||
void CheckStreams(Json::Value & in, Json::Value & out){
|
||||
|
@ -353,8 +355,8 @@ int main(int argc, char ** argv){
|
|||
Log("UPLK", "Max login attempts passed - dropping connection to uplink.");
|
||||
it->C.close();
|
||||
}else{
|
||||
Response["authorize"]["username"] = defstr(COMPILED_USERNAME);
|
||||
Response["authorize"]["password"] = md5(defstr(COMPILED_PASSWORD) + Request["authorize"]["challenge"].asString());
|
||||
Response["authorize"]["username"] = TOSTRING(COMPILED_USERNAME);
|
||||
Response["authorize"]["password"] = md5(TOSTRING(COMPILED_PASSWORD) + Request["authorize"]["challenge"].asString());
|
||||
it->H.Clean();
|
||||
it->H.SetBody("command="+HTTP::Parser::urlencode(Response.toStyledString()));
|
||||
it->H.BuildRequest();
|
||||
|
|
Loading…
Add table
Reference in a new issue