Kea: request_parser.cc Source File

| Kea 3.2.0-git

request_parser.cc
Go to the documentation of this file.
1// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#include <config.h>
8
9#include <http/request_parser.h>
10#include <functional>
11#include <iostream>
12
13using namespace isc::util;
14
15namespace isc {
16namespace http {
17
18const int HttpRequestParser::RECEIVE_START_ST;
19const int HttpRequestParser::HTTP_METHOD_ST;
20const int HttpRequestParser::HTTP_URI_ST;
21const int HttpRequestParser::HTTP_VERSION_H_ST;
22const int HttpRequestParser::HTTP_VERSION_T1_ST;
23const int HttpRequestParser::HTTP_VERSION_T2_ST;
24const int HttpRequestParser::HTTP_VERSION_P_ST;
25const int HttpRequestParser::HTTP_VERSION_SLASH_ST;
26const int HttpRequestParser::HTTP_VERSION_MAJOR_START_ST;
27const int HttpRequestParser::HTTP_VERSION_MAJOR_ST;
28const int HttpRequestParser::HTTP_VERSION_MINOR_START_ST;
29const int HttpRequestParser::HTTP_VERSION_MINOR_ST;
30const int HttpRequestParser::EXPECTING_NEW_LINE1_ST;
31const int HttpRequestParser::HEADER_LINE_START_ST;
32const int HttpRequestParser::HEADER_LWS_ST;
33const int HttpRequestParser::HEADER_NAME_ST;
34const int HttpRequestParser::SPACE_BEFORE_HEADER_VALUE_ST;
35const int HttpRequestParser::HEADER_VALUE_ST;
36const int HttpRequestParser::EXPECTING_NEW_LINE2_ST;
37const int HttpRequestParser::EXPECTING_NEW_LINE3_ST;
38const int HttpRequestParser::HTTP_BODY_ST;
39
40HttpRequestParser::HttpRequestParser(HttpRequest& request)
41 : HttpMessageParserBase(request), request_(request),
42 context_(request_.context()) {
43}
44
45void
46HttpRequestParser::initModel() {
47 // Initialize dictionaries of events and states.
48 initDictionaries();
49
50 // Set the current state to starting state and enter the run loop.
51 setState(RECEIVE_START_ST);
52
53 // Parsing starts from here.
54 postNextEvent(START_EVT);
55}
56
57void
58 HttpRequestParser::defineStates() {
59 // Call parent class implementation first.
60 HttpMessageParserBase::defineStates();
61
62 // Define HTTP parser specific states.
63 defineState(RECEIVE_START_ST, "RECEIVE_START_ST",
64 std::bind(&HttpRequestParser::receiveStartHandler, this));
65
66 defineState(HTTP_METHOD_ST, "HTTP_METHOD_ST",
67 std::bind(&HttpRequestParser::httpMethodHandler, this));
68
69 defineState(HTTP_URI_ST, "HTTP_URI_ST",
70 std::bind(&HttpRequestParser::uriHandler, this));
71
72 defineState(HTTP_VERSION_H_ST, "HTTP_VERSION_H_ST",
73 std::bind(&HttpRequestParser::versionHTTPHandler, this, 'H',
74 HTTP_VERSION_T1_ST));
75
76 defineState(HTTP_VERSION_T1_ST, "HTTP_VERSION_T1_ST",
77 std::bind(&HttpRequestParser::versionHTTPHandler, this, 'T',
78 HTTP_VERSION_T2_ST));
79
80 defineState(HTTP_VERSION_T2_ST, "HTTP_VERSION_T2_ST",
81 std::bind(&HttpRequestParser::versionHTTPHandler, this, 'T',
82 HTTP_VERSION_P_ST));
83
84 defineState(HTTP_VERSION_P_ST, "HTTP_VERSION_P_ST",
85 std::bind(&HttpRequestParser::versionHTTPHandler, this, 'P',
86 HTTP_VERSION_SLASH_ST));
87
88 defineState(HTTP_VERSION_SLASH_ST, "HTTP_VERSION_SLASH_ST",
89 std::bind(&HttpRequestParser::versionHTTPHandler, this, '/',
90 HTTP_VERSION_MAJOR_ST));
91
92 defineState(HTTP_VERSION_MAJOR_START_ST, "HTTP_VERSION_MAJOR_START_ST",
93 std::bind(&HttpRequestParser::versionNumberStartHandler, this,
94 HTTP_VERSION_MAJOR_ST,
95 &context_->http_version_major_));
96
97 defineState(HTTP_VERSION_MAJOR_ST, "HTTP_VERSION_MAJOR_ST",
98 std::bind(&HttpRequestParser::versionNumberHandler, this,
99 '.', HTTP_VERSION_MINOR_START_ST,
100 &context_->http_version_major_));
101
102 defineState(HTTP_VERSION_MINOR_START_ST, "HTTP_VERSION_MINOR_START_ST",
103 std::bind(&HttpRequestParser::versionNumberStartHandler, this,
104 HTTP_VERSION_MINOR_ST,
105 &context_->http_version_minor_));
106
107 defineState(HTTP_VERSION_MINOR_ST, "HTTP_VERSION_MINOR_ST",
108 std::bind(&HttpRequestParser::versionNumberHandler, this,
109 '\r', EXPECTING_NEW_LINE1_ST,
110 &context_->http_version_minor_));
111
112 defineState(EXPECTING_NEW_LINE1_ST, "EXPECTING_NEW_LINE1_ST",
113 std::bind(&HttpRequestParser::expectingNewLineHandler, this,
114 HEADER_LINE_START_ST));
115
116 defineState(HEADER_LINE_START_ST, "HEADER_LINE_START_ST",
117 std::bind(&HttpRequestParser::headerLineStartHandler, this));
118
119 defineState(HEADER_LWS_ST, "HEADER_LWS_ST",
120 std::bind(&HttpRequestParser::headerLwsHandler, this));
121
122 defineState(HEADER_NAME_ST, "HEADER_NAME_ST",
123 std::bind(&HttpRequestParser::headerNameHandler, this));
124
125 defineState(SPACE_BEFORE_HEADER_VALUE_ST, "SPACE_BEFORE_HEADER_VALUE_ST",
126 std::bind(&HttpRequestParser::spaceBeforeHeaderValueHandler, this));
127
128 defineState(HEADER_VALUE_ST, "HEADER_VALUE_ST",
129 std::bind(&HttpRequestParser::headerValueHandler, this));
130
131 defineState(EXPECTING_NEW_LINE2_ST, "EXPECTING_NEW_LINE2",
132 std::bind(&HttpRequestParser::expectingNewLineHandler, this,
133 HEADER_LINE_START_ST));
134
135 defineState(EXPECTING_NEW_LINE3_ST, "EXPECTING_NEW_LINE3_ST",
136 std::bind(&HttpRequestParser::expectingNewLineHandler, this,
137 HTTP_PARSE_OK_ST));
138
139 defineState(HTTP_BODY_ST, "HTTP_BODY_ST",
140 std::bind(&HttpRequestParser::bodyHandler, this));
141}
142
143void
144HttpRequestParser::receiveStartHandler() {
145 std::string bytes;
146 getNextFromBuffer(bytes);
147 if (getNextEvent() != NEED_MORE_DATA_EVT) {
148 switch(getNextEvent()) {
149 case START_EVT:
150 // The first byte should contain a first character of the
151 // HTTP method name.
152 if (!isChar(bytes[0]) || isCtl(bytes[0]) || isSpecial(bytes[0])) {
153 parseFailure("invalid first character " + std::string(1, bytes[0]) +
154 " in HTTP method name");
155
156 } else {
157 context_->method_.push_back(bytes[0]);
158 transition(HTTP_METHOD_ST, DATA_READ_OK_EVT);
159 }
160 break;
161
162 default:
163 invalidEventError("receiveStartHandler", getNextEvent());
164 }
165 }
166}
167
168void
169HttpRequestParser::httpMethodHandler() {
170 stateWithReadHandler("httpMethodHandler", [this](const char c) {
171 // Space character terminates the HTTP method name. Next thing
172 // is the URI.
173 if (c == ' ') {
174 transition(HTTP_URI_ST, DATA_READ_OK_EVT);
175
176 } else if (!isChar(c) || isCtl(c) || isSpecial(c)) {
177 parseFailure("invalid character " + std::string(1, c) +
178 " in HTTP method name");
179
180 } else {
181 // Still parsing the method. Append the next character to the
182 // method name.
183 context_->method_.push_back(c);
184 transition(getCurrState(), DATA_READ_OK_EVT);
185 }
186 });
187}
188
189void
190HttpRequestParser::uriHandler() {
191 stateWithReadHandler("uriHandler", [this](const char c) {
192 // Space character terminates the URI.
193 if (c == ' ') {
194 transition(HTTP_VERSION_H_ST, DATA_READ_OK_EVT);
195
196 } else if (isCtl(c)) {
197 parseFailure("control character found in HTTP URI");
198
199 } else {
200 // Still parsing the URI. Append the next character to the
201 // method name.
202 context_->uri_.push_back(c);
203 transition(HTTP_URI_ST, DATA_READ_OK_EVT);
204 }
205 });
206}
207
208void
209HttpRequestParser::versionHTTPHandler(const char expected_letter,
210 const unsigned int next_state) {
211 stateWithReadHandler("versionHTTPHandler",
212 [this, expected_letter, next_state](const char c) {
213 // We're handling one of the letters: 'H', 'T' or 'P'.
214 if (c == expected_letter) {
215 // The HTTP version is specified as "HTTP/X.Y". If the current
216 // character is a slash we're starting to parse major HTTP version
217 // number. Let's reset the version numbers.
218 if (c == '/') {
219 context_->http_version_major_ = 0;
220 context_->http_version_minor_ = 0;
221 }
222 // In all cases, let's transition to next specified state.
223 transition(next_state, DATA_READ_OK_EVT);
224
225 } else {
226 // Unexpected character found. Parsing fails.
227 parseFailure("unexpected character " + std::string(1, c) +
228 " in HTTP version string");
229 }
230 });
231}
232
233void
234HttpRequestParser::versionNumberStartHandler(const unsigned int next_state,
235 unsigned int* storage) {
236 stateWithReadHandler("versionNumberStartHandler",
237 [this, next_state, storage](const char c) mutable {
238 // HTTP version number must be a digit.
239 if (isdigit(c)) {
240 // Update the version number using new digit being parsed.
241 *storage = *storage * 10 + c - '0';
242 transition(next_state, DATA_READ_OK_EVT);
243
244 } else {
245 parseFailure("expected digit in HTTP version, found " +
246 std::string(1, c));
247 }
248 });
249}
250
251void
252HttpRequestParser::versionNumberHandler(const char following_character,
253 const unsigned int next_state,
254 unsigned int* const storage) {
255 stateWithReadHandler("versionNumberHandler",
256 [this, following_character, next_state, storage](const char c)
257 mutable {
258 // We're getting to the end of the version number, let's transition
259 // to next state.
260 if (c == following_character) {
261 transition(next_state, DATA_READ_OK_EVT);
262
263 } else if (isdigit(c)) {
264 // Current character is a digit, so update the version number.
265 *storage = *storage * 10 + c - '0';
266
267 } else {
268 parseFailure("expected digit in HTTP version, found " +
269 std::string(1, c));
270 }
271 });
272}
273
274void
275HttpRequestParser::expectingNewLineHandler(const unsigned int next_state) {
276 stateWithReadHandler("expectingNewLineHandler", [this, next_state](const char c) {
277 // Only a new line character is allowed in this state.
278 if (c == '\n') {
279 // If next state is HTTP_PARSE_OK_ST it means that we're
280 // parsing 3rd new line in the HTTP request message. This
281 // terminates the HTTP request (if there is no body) or marks the
282 // beginning of the body.
283 if (next_state == HTTP_PARSE_OK_ST) {
284 // Whether there is a body in this message or not, we should
285 // parse the HTTP headers to validate it and to check if there
286 // is "Content-Length" specified. The "Content-Length" is
287 // required for parsing body.
288 request_.create();
289 try {
290 // This will throw exception if there is no Content-Length.
291 uint64_t content_length =
292 request_.getHeaderValueAsUint64("Content-Length");
293 if (content_length > 0) {
294 // There is body in this request, so let's parse it.
295 transition(HTTP_BODY_ST, DATA_READ_OK_EVT);
296 } else {
297 transition(HTTP_PARSE_OK_ST, HTTP_PARSE_OK_EVT);
298 }
299 } catch (const std::exception& ex) {
300 // There is no body in this message. If the body is required
301 // parsing fails.
302 if (request_.requiresBody()) {
303 parseFailure("HTTP message lacks a body");
304
305 } else {
306 // Body not required so simply terminate parsing.
307 transition(HTTP_PARSE_OK_ST, HTTP_PARSE_OK_EVT);
308 }
309 }
310
311 } else {
312 // This is 1st or 2nd new line, so let's transition to the
313 // next state required by this handler.
314 transition(next_state, DATA_READ_OK_EVT);
315 }
316 } else {
317 parseFailure("expecting new line after CR, found " +
318 std::string(1, c));
319 }
320 });
321}
322
323void
324HttpRequestParser::headerLineStartHandler() {
325 stateWithReadHandler("headerLineStartHandler", [this](const char c) {
326 // If we're parsing HTTP headers and we found CR it marks the
327 // end of headers section.
328 if (c == '\r') {
329 transition(EXPECTING_NEW_LINE3_ST, DATA_READ_OK_EVT);
330
331 } else if (!context_->headers_.empty() && ((c == ' ') || (c == '\t'))) {
332 // New line in headers section followed by space or tab is an LWS,
333 // a line break within header value.
334 transition(HEADER_LWS_ST, DATA_READ_OK_EVT);
335
336 } else if (!isChar(c) || isCtl(c) || isSpecial(c)) {
337 parseFailure("invalid character " + std::string(1, c) +
338 " in header name");
339
340 } else {
341 // Update header name with the parse letter.
342 context_->headers_.push_back(HttpHeaderContext());
343 context_->headers_.back().name_.push_back(c);
344 transition(HEADER_NAME_ST, DATA_READ_OK_EVT);
345 }
346 });
347}
348
349void
350HttpRequestParser::headerLwsHandler() {
351 stateWithReadHandler("headerLwsHandler", [this](const char c) {
352 if (c == '\r') {
353 // Found CR during parsing a header value. Next value
354 // should be new line.
355 transition(EXPECTING_NEW_LINE2_ST, DATA_READ_OK_EVT);
356
357 } else if ((c == ' ') || (c == '\t')) {
358 // Space and tab is used to mark LWS. Simply swallow
359 // this character.
360 transition(getCurrState(), DATA_READ_OK_EVT);
361
362 } else if (isCtl(c)) {
363 parseFailure("control character found in the HTTP header " +
364 context_->headers_.back().name_);
365
366 } else {
367 // We're parsing header value, so let's update it.
368 context_->headers_.back().value_.push_back(c);
369 transition(HEADER_VALUE_ST, DATA_READ_OK_EVT);
370 }
371 });
372}
373
374void
375HttpRequestParser::headerNameHandler() {
376 stateWithReadHandler("headerNameHandler", [this](const char c) {
377 // Colon follows header name and it has its own state.
378 if (c == ':') {
379 transition(SPACE_BEFORE_HEADER_VALUE_ST, DATA_READ_OK_EVT);
380
381 } else if (!isChar(c) || isCtl(c) || isSpecial(c)) {
382 parseFailure("invalid character " + std::string(1, c) +
383 " found in the HTTP header name");
384
385 } else {
386 // Parsing a header name, so update it.
387 context_->headers_.back().name_.push_back(c);
388 transition(getCurrState(), DATA_READ_OK_EVT);
389 }
390 });
391}
392
393void
394HttpRequestParser::spaceBeforeHeaderValueHandler() {
395 stateWithReadHandler("spaceBeforeHeaderValueHandler", [this](const char c) {
396 if (c == ' ') {
397 // Remove leading whitespace from the header value.
398 transition(getCurrState(), DATA_READ_OK_EVT);
399
400 } else if (c == '\r') {
401 // If CR found during parsing header value, it marks the end
402 // of this value.
403 transition(EXPECTING_NEW_LINE2_ST, DATA_READ_OK_EVT);
404
405 } else if (isCtl(c)) {
406 parseFailure("control character found in the HTTP header "
407 + context_->headers_.back().name_);
408
409 } else {
410 // Still parsing the value, so let's update it.
411 context_->headers_.back().value_.push_back(c);
412 transition(HEADER_VALUE_ST, DATA_READ_OK_EVT);
413 }
414 });
415}
416
417void
418HttpRequestParser::headerValueHandler() {
419 stateWithReadHandler("headerValueHandler", [this](const char c) {
420 // If CR found during parsing header value, it marks the end
421 // of this value.
422 if (c == '\r') {
423 transition(EXPECTING_NEW_LINE2_ST, DATA_READ_OK_EVT);
424
425 } else if (isCtl(c)) {
426 parseFailure("control character found in the HTTP header "
427 + context_->headers_.back().name_);
428
429 } else {
430 // Still parsing the value, so let's update it.
431 context_->headers_.back().value_.push_back(c);
432 transition(HEADER_VALUE_ST, DATA_READ_OK_EVT);
433 }
434 });
435}
436
437void
438HttpRequestParser::bodyHandler() {
439 stateWithMultiReadHandler("bodyHandler", [this](const std::string& body) {
440 // We don't validate the body at this stage. Simply record the
441 // number of characters specified within "Content-Length".
442 context_->body_ += body;
443 size_t content_length = request_.getHeaderValueAsUint64("Content-Length");
444 if (context_->body_.length() < content_length) {
445 transition(HTTP_BODY_ST, DATA_READ_OK_EVT);
446
447 } else {
448 // If there was some extraneous data, ignore it.
449 if (context_->body_.length() > content_length) {
450 context_->body_.resize(content_length);
451 }
452 transition(HTTP_PARSE_OK_ST, HTTP_PARSE_OK_EVT);
453 }
454 });
455}
456
457} // namespace http
458} // namespace isc
isc::http::HttpMessageParserBase::getNextFromBuffer
void getNextFromBuffer(std::string &bytes, const size_t limit=1)
Retrieves next bytes of data from the buffer.
Definition http_message_parser_base.cc:187
isc::http::HttpMessageParserBase::DATA_READ_OK_EVT
static const int DATA_READ_OK_EVT
Chunk of data successfully read and parsed.
Definition http_message_parser_base.h:85
isc::http::HttpMessageParserBase::NEED_MORE_DATA_EVT
static const int NEED_MORE_DATA_EVT
Unable to proceed with parsing until new data is provided.
Definition http_message_parser_base.h:88
isc::http::HttpMessageParserBase::isSpecial
bool isSpecial(const signed char c) const
Checks if specified value is a special character.
Definition http_message_parser_base.cc:274
isc::http::HttpMessageParserBase::parseFailure
void parseFailure(const std::string &error_msg)
Transition parser to failure state.
Definition http_message_parser_base.cc:174
isc::http::HttpMessageParserBase::isChar
bool isChar(const signed char c) const
Checks if specified value is a character.
Definition http_message_parser_base.cc:264
isc::http::HttpMessageParserBase::stateWithReadHandler
void stateWithReadHandler(const std::string &handler_name, std::function< void(const char c)> after_read_logic)
Generic parser handler which reads a single byte of data and parses it using specified callback funct...
Definition http_message_parser_base.cc:136
isc::http::HttpMessageParserBase::invalidEventError
void invalidEventError(const std::string &handler_name, const unsigned int event)
This method is called when invalid event occurred in a particular parser state.
Definition http_message_parser_base.cc:223
isc::http::HttpMessageParserBase::HTTP_PARSE_OK_ST
static const int HTTP_PARSE_OK_ST
Parsing successfully completed.
Definition http_message_parser_base.h:73
isc::http::HttpMessageParserBase::HttpMessageParserBase
HttpMessageParserBase(HttpMessage &message)
Constructor.
Definition http_message_parser_base.cc:28
isc::http::HttpMessageParserBase::stateWithMultiReadHandler
void stateWithMultiReadHandler(const std::string &handler_name, std::function< void(const std::string &)> after_read_logic)
Generic parser handler which reads multiple bytes of data and parses it using specified callback func...
Definition http_message_parser_base.cc:155
isc::http::HttpMessageParserBase::isCtl
bool isCtl(const signed char c) const
Checks if specified value is a control value.
Definition http_message_parser_base.cc:269
isc::http::HttpMessageParserBase::HTTP_PARSE_OK_EVT
static const int HTTP_PARSE_OK_EVT
Parsing HTTP request successful.
Definition http_message_parser_base.h:94
isc::http::HttpMessageParserBase::defineStates
virtual void defineStates() override
Defines states of the parser.
Definition http_message_parser_base.cc:124
isc::http::HttpRequestParser::EXPECTING_NEW_LINE1_ST
static const int EXPECTING_NEW_LINE1_ST
Parsing first new line (after HTTP version number).
Definition request_parser.h:98
isc::http::HttpRequestParser::HTTP_URI_ST
static const int HTTP_URI_ST
Parsing URI.
Definition request_parser.h:68
isc::http::HttpRequestParser::HTTP_VERSION_MAJOR_ST
static const int HTTP_VERSION_MAJOR_ST
Parsing major HTTP version number.
Definition request_parser.h:89
isc::http::HttpRequestParser::HTTP_VERSION_SLASH_ST
static const int HTTP_VERSION_SLASH_ST
Parsing slash character in "HTTP/Y.X".
Definition request_parser.h:83
isc::http::HttpRequestParser::SPACE_BEFORE_HEADER_VALUE_ST
static const int SPACE_BEFORE_HEADER_VALUE_ST
Parsing space before header value.
Definition request_parser.h:111
isc::http::HttpRequestParser::HTTP_BODY_ST
static const int HTTP_BODY_ST
Parsing body of a HTTP message.
Definition request_parser.h:123
isc::http::HttpRequestParser::HTTP_VERSION_MAJOR_START_ST
static const int HTTP_VERSION_MAJOR_START_ST
Starting to parse major HTTP version number.
Definition request_parser.h:86
isc::http::HttpRequestParser::EXPECTING_NEW_LINE3_ST
static const int EXPECTING_NEW_LINE3_ST
Expecting second new line marking end of HTTP headers.
Definition request_parser.h:120
isc::http::HttpRequestParser::HEADER_NAME_ST
static const int HEADER_NAME_ST
Parsing header name.
Definition request_parser.h:108
isc::http::HttpRequestParser::RECEIVE_START_ST
static const int RECEIVE_START_ST
State indicating a beginning of parsing.
Definition request_parser.h:62
isc::http::HttpRequestParser::initModel
void initModel()
Initialize the state model for parsing.
Definition request_parser.cc:46
isc::http::HttpRequestParser::HEADER_LWS_ST
static const int HEADER_LWS_ST
Parsing LWS (Linear White Space), i.e.
Definition request_parser.h:105
isc::http::HttpRequestParser::HTTP_VERSION_MINOR_ST
static const int HTTP_VERSION_MINOR_ST
Parsing minor HTTP version number.
Definition request_parser.h:95
isc::http::HttpRequestParser::HEADER_LINE_START_ST
static const int HEADER_LINE_START_ST
Starting to parse a header line.
Definition request_parser.h:101
isc::http::HttpRequestParser::HTTP_VERSION_H_ST
static const int HTTP_VERSION_H_ST
Parsing letter "H" of "HTTP".
Definition request_parser.h:71
isc::http::HttpRequestParser::HTTP_VERSION_MINOR_START_ST
static const int HTTP_VERSION_MINOR_START_ST
Starting to parse minor HTTP version number.
Definition request_parser.h:92
isc::http::HttpRequestParser::HTTP_METHOD_ST
static const int HTTP_METHOD_ST
Parsing HTTP method, e.g. GET, POST etc.
Definition request_parser.h:65
isc::http::HttpRequestParser::HEADER_VALUE_ST
static const int HEADER_VALUE_ST
Parsing header value.
Definition request_parser.h:114
isc::http::HttpRequestParser::HttpRequestParser
HttpRequestParser(HttpRequest &request)
Constructor.
Definition request_parser.cc:40
isc::http::HttpRequestParser::EXPECTING_NEW_LINE2_ST
static const int EXPECTING_NEW_LINE2_ST
Expecting new line after parsing header value.
Definition request_parser.h:117
isc::http::HttpRequestParser::HTTP_VERSION_P_ST
static const int HTTP_VERSION_P_ST
Parsing letter "P" in "HTTP".
Definition request_parser.h:80
isc::http::HttpRequestParser::HTTP_VERSION_T2_ST
static const int HTTP_VERSION_T2_ST
Parsing second occurrence of "T" in "HTTP".
Definition request_parser.h:77
isc::http::HttpRequestParser::HTTP_VERSION_T1_ST
static const int HTTP_VERSION_T1_ST
Parsing first occurrence of "T" in "HTTP".
Definition request_parser.h:74
isc::http::HttpRequest
Represents HTTP request message.
Definition request.h:57
isc::util::StateModel::initDictionaries
void initDictionaries()
Initializes the event and state dictionaries.
Definition state_model.cc:144
isc::util::StateModel::START_EVT
static const int START_EVT
Event issued to start the model execution.
Definition state_model.h:295
isc::util::StateModel::getCurrState
int getCurrState() const
Fetches the model's current state.
Definition state_model.cc:355
isc::util::StateModel::setState
void setState(int state)
Sets the current state to the given state value.
Definition state_model.cc:291
isc::util::StateModel::defineState
void defineState(int value, const std::string &label, StateHandler handler, const StatePausing &state_pausing=STATE_PAUSE_NEVER)
Adds an state value and associated label to the set of states.
Definition state_model.cc:196
isc::util::StateModel::transition
void transition(int state, int event)
Sets up the model to transition into given state with a given event.
Definition state_model.cc:264
isc::util::StateModel::getNextEvent
int getNextEvent() const
Fetches the model's next event.
Definition state_model.cc:373
isc::util::StateModel::postNextEvent
void postNextEvent(int event)
Sets the next event to the given event value.
Definition state_model.cc:320
isc::http
Definition auth_config.h:19
isc::util
Definition time_utils.cc:43
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
request_parser.h