Jun 16th update

This commit is contained in:
noam
2023-01-17 11:34:09 +02:00
parent 90bcc544a2
commit ad04b8d063
168 changed files with 64034 additions and 932 deletions

View File

@@ -16,7 +16,6 @@
#include <unistd.h>
#include <sstream>
#include <sys/socket.h>
#include <boost/algorithm/string.hpp>
#include "debug.h"
@@ -35,6 +34,18 @@ RestConn::~RestConn()
{
}
static bool
compareStringCaseInsensitive(const string &s1, const string &s2)
{
if (s1.size() != s2.size()) return false;
for (size_t index = 0; index < s1.size(); ++index) {
if (tolower(s1[index]) != tolower(s2[index])) return false;
}
return true;
}
void
RestConn::parseConn() const
{
@@ -69,7 +80,7 @@ RestConn::parseConn() const
os.str(line);
string head, data;
os >> head >> data;
if (boost::iequals(head, "Content-Length:")) {
if (compareStringCaseInsensitive(head, "Content-Length:")) {
try {
len = stoi(data, nullptr);
} catch (...) {

View File

@@ -22,7 +22,6 @@
#include "debug.h"
#include "rest_conn.h"
#include "i_rest_invoke.h"
#include "sasal.h"
#include <syslog.h>
@@ -33,8 +32,6 @@ USE_DEBUG_FLAG(D_API);
static const int listen_limit = 100;
static const chrono::milliseconds bind_retry_interval_msec = chrono::milliseconds(500);
SASAL_START // REST Server
#include <iostream>
class RestServer::Impl
@@ -257,5 +254,3 @@ RestServer::preload()
registerExpectedConfiguration<uint>("connection", "Nano service API Port Range start");
registerExpectedConfiguration<uint>("connection", "Nano service API Port Range end");
}
SASAL_END