Optimized controller API responses.

This commit is contained in:
Thulinma 2014-01-07 17:16:55 +01:00
parent fadde8c546
commit ad5929c603

View file

@ -398,7 +398,7 @@ int main(int argc, char ** argv){
uplink->H.Clean(); uplink->H.Clean();
uplink->H.SetBody("command=" + HTTP::Parser::urlencode(Response.toString())); uplink->H.SetBody("command=" + HTTP::Parser::urlencode(Response.toString()));
uplink->H.BuildRequest(); uplink->H.BuildRequest();
uplink->C.Send(uplink->H.BuildResponse("200", "OK")); uplink->H.SendResponse("200", "OK", uplink->C);
uplink->H.Clean(); uplink->H.Clean();
//Controller::Log("UPLK", "Sending server data to uplink."); //Controller::Log("UPLK", "Sending server data to uplink.");
}else{ }else{
@ -526,7 +526,7 @@ int main(int argc, char ** argv){
it->H.Clean(); it->H.Clean();
it->H.SetBody("command=" + HTTP::Parser::urlencode(Response.toString())); it->H.SetBody("command=" + HTTP::Parser::urlencode(Response.toString()));
it->H.BuildRequest(); it->H.BuildRequest();
it->C.Send(it->H.BuildResponse("200", "OK")); it->H.SendResponse("200", "OK", it->C);
it->H.Clean(); it->H.Clean();
Controller::Log("UPLK", "Attempting login to uplink."); Controller::Log("UPLK", "Attempting login to uplink.");
} }
@ -632,7 +632,7 @@ int main(int argc, char ** argv){
}else{ }else{
it->H.SetBody(jsonp + "(" + Response.toString() + ");\n\n"); it->H.SetBody(jsonp + "(" + Response.toString() + ");\n\n");
} }
it->C.Send(it->H.BuildResponse("200", "OK")); it->H.SendResponse("200", "OK", it->C);
it->H.Clean(); it->H.Clean();
} }
} }