Remove mosqitto code

This commit is contained in:
Inex Code 2021-04-27 16:10:07 +00:00
parent c4f1fb760a
commit 6478ccacb7

View file

@ -278,35 +278,6 @@ void handle_signal(int s)
cmd = EExit;
}
/*
void message_callback(struct mosquitto* mosq, void* obj, const struct mosquitto_message* message)
{
bool match = 0;
printf("got message '%.*s' for topic '%s'\n", message->payloadlen, (char*)message->payload, message->topic);
mosquitto_topic_matches_sub("/pooh/height", message->topic, &match);
if (match) {
std::cout << "Going up!" << std::endl;
mtx.lock();
targetH = std::atof((char*)message->payload);
mtx.unlock();
}
mosquitto_topic_matches_sub("/pooh/land", message->topic, &match);
if (match) {
std::cout << "Going down!" << std::endl;
mtx.lock();
targetH = 0.;
mtx.unlock();
}
mosquitto_topic_matches_sub("/pooh/quit", message->topic, &match);
if (match) {
std::cout << "Exiting!" << std::endl;
cmd = EExit;
}
}*/
bool is_authentificated(http_request message) {
auto headers = message.headers();
if (message.headers().find("Authorization") == headers.end()) return false;