require gcc 4.9 because of incomplete regex support in gcc 4.8
This commit is contained in:
parent
63f0b61ea1
commit
118beffe71
3 changed files with 12 additions and 5 deletions
|
@ -14,7 +14,7 @@ Precise map-matching for public transit schedules (GTFS data).
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* `cmake`
|
* `cmake`
|
||||||
* `gcc >= 4.8` (or `clang >= 5.0`)
|
* `gcc >= 4.9` (or `clang >= 5.0`)
|
||||||
|
|
||||||
## Building and Installation
|
## Building and Installation
|
||||||
|
|
||||||
|
|
|
@ -110,11 +110,11 @@ void HttpServer::handle() {
|
||||||
answ = _handler->handle(req, connection);
|
answ = _handler->handle(req, connection);
|
||||||
answ.gzip = gzipSupport(req);
|
answ.gzip = gzipSupport(req);
|
||||||
} catch (HttpErr err) {
|
} catch (HttpErr err) {
|
||||||
answ = Answer{err.what(), err.what(), false, {}};
|
answ = Answer(err.what(), err.what());
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// catch everything to make sure the server continues running
|
// catch everything to make sure the server continues running
|
||||||
answ = Answer{
|
answ = Answer(
|
||||||
"500 Internal Server Error", "500 Internal Server Error", false, {}};
|
"500 Internal Server Error", "500 Internal Server Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
send(connection, &answ);
|
send(connection, &answ);
|
||||||
|
@ -151,7 +151,8 @@ Req HttpServer::getReq(int connection) {
|
||||||
int64_t curRcvd = 0;
|
int64_t curRcvd = 0;
|
||||||
HeaderState state = NONE;
|
HeaderState state = NONE;
|
||||||
Req ret{"", "", "", "", {}};
|
Req ret{"", "", "", "", {}};
|
||||||
char *tmp, *tmp2;
|
char *tmp = 0;
|
||||||
|
char *tmp2 = 0;
|
||||||
char* brk = 0;
|
char* brk = 0;
|
||||||
|
|
||||||
while ((curRcvd = read(connection, buf + rcvd, BSIZE - rcvd))) {
|
while ((curRcvd = read(connection, buf + rcvd, BSIZE - rcvd))) {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -62,6 +63,11 @@ struct Req {
|
||||||
* HTTP Answer
|
* HTTP Answer
|
||||||
*/
|
*/
|
||||||
struct Answer {
|
struct Answer {
|
||||||
|
Answer() : status(""), pl(""), gzip(false) {}
|
||||||
|
Answer(const std::string& status, const std::string& pl)
|
||||||
|
: status(status), pl(pl), gzip(false) {}
|
||||||
|
Answer(const std::string& status, const std::string& pl, bool gz)
|
||||||
|
: status(status), pl(pl), gzip(gz) {}
|
||||||
std::string status, pl;
|
std::string status, pl;
|
||||||
bool gzip;
|
bool gzip;
|
||||||
std::unordered_map<std::string, std::string> params;
|
std::unordered_map<std::string, std::string> params;
|
||||||
|
|
Loading…
Reference in a new issue