Add concept of route yielding

This commit is contained in:
Alex Hultman
2019-01-22 18:30:25 +01:00
parent ed4e9f5c45
commit 9829f7fb37
4 changed files with 19 additions and 6 deletions
+10
View File
@@ -37,10 +37,20 @@ private:
std::string_view key, value;
} headers[MAX_HEADERS];
int querySeparator;
bool didYield;
std::pair<int, std::string_view *> currentParameters;
public:
bool getYield() {
return didYield;
}
/* If you do not want to handle this route */
void setYield(bool yield) {
didYield = yield;
}
std::string_view getHeader(std::string_view header) {
for (Header *h = headers; (++h)->key.length(); ) {
if (h->key.length() == header.length() && !strncmp(h->key.data(), header.data(), header.length())) {