Kea 3.3.3
connection.cc
Go to the documentation of this file.
1// Copyright (C) 2017-2026 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
10#include <dhcp/iface_mgr.h>
11#include <http/connection.h>
13#include <http/http_log.h>
14#include <http/http_messages.h>
15#include <boost/make_shared.hpp>
16#include <functional>
17
18using namespace isc::asiolink;
19using namespace isc::dhcp;
20using namespace isc::util;
21namespace ph = std::placeholders;
22
23namespace {
24
28constexpr size_t MAX_LOGGED_MESSAGE_SIZE = 1024;
29
30}
31
32namespace isc {
33namespace http {
34
36 const HttpRequestPtr& request)
37 : request_(request ? request : response_creator->createNewHttpRequest()),
38 parser_(new HttpRequestParser(*request_)),
39 input_buf_(),
40 output_buf_(),
41 position_(0) {
42 parser_->initModel();
43}
44
47 return (boost::make_shared<Transaction>(response_creator));
48}
49
52 const TransactionPtr& transaction) {
53 if (transaction) {
54 return (boost::make_shared<Transaction>(response_creator,
55 transaction->getRequest()));
56 }
57 return (create(response_creator));
58}
59
60void
61HttpConnection::
62SocketCallback::operator()(boost::system::error_code ec, size_t length) {
63 if (ec.value() == boost::asio::error::operation_aborted) {
64 return;
65 }
66 callback_(ec, length);
67}
68
70 const HttpAcceptorPtr& acceptor,
71 const TlsContextPtr& tls_context,
72 HttpConnectionPoolPtr connection_pool,
73 const HttpResponseCreatorPtr& response_creator,
74 const HttpAcceptorCallback& callback,
75 const long request_timeout,
76 const long idle_timeout)
78 request_timeout_(request_timeout), tls_context_(tls_context),
79 idle_timeout_(idle_timeout), tcp_socket_(), tls_socket_(),
80 acceptor_(acceptor), connection_pool_(connection_pool),
81 response_creator_(response_creator), acceptor_callback_(callback),
83 closed_(false), registered_(false) {
84 if (!tls_context) {
86 } else {
88 tls_context));
89 }
90}
91
95
96void
98 use_external_ = use_external;
99}
100
101void
103 if (!request) {
104 // Should never happen.
105 return;
106 }
107
108 // Record the remote address.
109 request->setRemote(getRemoteEndpointAddressAsText());
110
111 // Record TLS parameters.
112 if (!tls_socket_) {
113 return;
114 }
115
116 // The connection uses HTTPS aka HTTP over TLS.
117 request->setTls(true);
118
119 // Record the first commonName of the subjectName of the client
120 // certificate when wanted.
122 request->setSubject(tls_socket_->getTlsStream().getSubject());
123 }
124
125 // Record the first commonName of the issuerName of the client
126 // certificate when wanted.
128 request->setIssuer(tls_socket_->getTlsStream().getIssuer());
129 }
130}
131
132void
133HttpConnection::shutdownCallback(const boost::system::error_code&) {
134 if (closed_) {
135 return;
136 }
137 if (registered_) {
140 registered_ = false;
141 }
142
143 tls_socket_->close();
144 closed_ = true;
145}
146
147void
149 if (closed_) {
150 return;
151 }
152 request_timer_.cancel();
153 if (tcp_socket_) {
154 if (registered_) {
157 registered_ = false;
158 }
159 tcp_socket_->close();
160 closed_ = true;
161 return;
162 }
163 if (tls_socket_) {
164 // Create instance of the callback to close the socket.
165 SocketCallback cb(std::bind(&HttpConnection::shutdownCallback,
166 shared_from_this(),
167 ph::_1)); // error_code
168 tls_socket_->shutdown(cb);
169 return;
170 }
171 // Not reachable?
172 isc_throw(Unexpected, "internal error: unable to shutdown the socket");
173}
174
175void
177 if (!watch_socket_) {
179 return;
180 }
181 try {
182 watch_socket_->markReady();
183 } catch (const std::exception& ex) {
185 .arg(ex.what());
186 }
187}
188
189void
191 if (!watch_socket_) {
193 return;
194 }
195 try {
196 watch_socket_->clearReady();
197 } catch (const std::exception& ex) {
199 .arg(ex.what());
200 }
201}
202
203void
205 if (!watch_socket_) {
207 return;
208 }
210 // Close watch socket and log errors if occur.
211 std::string watch_error;
212 if (!watch_socket_->closeSocket(watch_error)) {
214 .arg(watch_error);
215 }
216}
217
218void
220 if (defer_shutdown_) {
221 io_service_->post(std::bind([](HttpConnectionPtr c) { c->close(); }, shared_from_this()));
222 return;
223 }
224 if (closed_) {
225 return;
226 }
227 request_timer_.cancel();
228 if (tcp_socket_) {
229 if (registered_) {
232 registered_ = false;
233 }
234 tcp_socket_->close();
235 closed_ = true;
236 return;
237 }
238 if (tls_socket_) {
239 if (registered_) {
242 registered_ = false;
243 }
244 tls_socket_->close();
245 closed_ = true;
246 return;
247 }
248 // Not reachable?
249 isc_throw(Unexpected, "internal error: unable to close the socket");
250}
251
252void
254 auto connection_pool = connection_pool_.lock();
255 try {
259 if (connection_pool) {
260 connection_pool->shutdown(shared_from_this());
261 } else {
262 shutdown();
263 }
264 } catch (...) {
266 }
267}
268
269void
271 auto connection_pool = connection_pool_.lock();
272 if (closed_ && !connection_pool) {
273 return;
274 }
275 try {
279 if (connection_pool) {
280 connection_pool->stop(shared_from_this());
281 } else {
282 close();
283 }
284 } catch (...) {
286 }
287}
288
289void
291 // Create instance of the callback. It is safe to pass the local instance
292 // of the callback, because the underlying boost functions make copies
293 // as needed.
295 shared_from_this(),
296 ph::_1); // error
297 try {
298 HttpsAcceptorPtr tls_acceptor =
299 boost::dynamic_pointer_cast<HttpsAcceptor>(acceptor_);
300 if (!tls_acceptor) {
301 if (!tcp_socket_) {
302 isc_throw(Unexpected, "internal error: TCP socket is null");
303 }
304 acceptor_->asyncAccept(*tcp_socket_, cb);
305 } else {
306 if (!tls_socket_) {
307 isc_throw(Unexpected, "internal error: TLS socket is null");
308 }
309 tls_acceptor->asyncAccept(*tls_socket_, cb);
310 }
311 } catch (const std::exception& ex) {
312 isc_throw(HttpConnectionError, "unable to start accepting TCP "
313 "connections: " << ex.what());
314 }
315}
316
317void
319 // Skip the handshake if the socket is not a TLS one.
320 if (!tls_socket_) {
321 doRead();
322 return;
323 }
324
325 // Create instance of the callback. It is safe to pass the local instance
326 // of the callback, because the underlying boost functions make copies
327 // as needed.
328 SocketCallback cb(std::bind(&HttpConnection::handshakeCallback,
329 shared_from_this(),
330 ph::_1)); // error
331 try {
332 tls_socket_->handshake(cb);
333 if (registered_) {
335 }
336 } catch (const std::exception& ex) {
337 isc_throw(HttpConnectionError, "unable to perform TLS handshake: "
338 << ex.what());
339 }
340}
341
342void
344 try {
345 TCPEndpoint endpoint;
346
347 // Transaction hasn't been created if we are starting to read the
348 // new request.
349 if (!transaction) {
351 recordParameters(transaction->getRequest());
352 }
353
354 // Create instance of the callback. It is safe to pass the local instance
355 // of the callback, because the underlying std functions make copies
356 // as needed.
357 SocketCallback cb(std::bind(&HttpConnection::socketReadCallback,
358 shared_from_this(),
359 transaction,
360 ph::_1, // error
361 ph::_2)); //bytes_transferred
362 if (tcp_socket_) {
363 tcp_socket_->asyncReceive(static_cast<void*>(transaction->getInputBufData()),
364 transaction->getInputBufSize(),
365 0, &endpoint, cb);
366 return;
367 }
368 if (tls_socket_) {
369 tls_socket_->asyncReceive(static_cast<void*>(transaction->getInputBufData()),
370 transaction->getInputBufSize(),
371 0, &endpoint, cb);
372 return;
373 }
374 } catch (...) {
376 }
377}
378
379void
381 try {
382 if (transaction->outputDataAvail()) {
383 // Create instance of the callback. It is safe to pass the local instance
384 // of the callback, because the underlying std functions make copies
385 // as needed.
386 SocketCallback cb(std::bind(&HttpConnection::socketWriteCallback,
387 shared_from_this(),
388 transaction,
389 ph::_1, // error
390 ph::_2)); // bytes_transferred
391 if (tcp_socket_) {
392 tcp_socket_->asyncSend(transaction->getOutputBufData(),
393 transaction->getOutputBufSize(),
394 cb);
395 if (registered_) {
397 }
398 return;
399 }
400 if (tls_socket_) {
401 tls_socket_->asyncSend(transaction->getOutputBufData(),
402 transaction->getOutputBufSize(),
403 cb);
404 if (registered_) {
406 }
407 return;
408 }
409 } else {
410 // The isPersistent() function may throw if the request hasn't
411 // been created, i.e. the HTTP headers weren't parsed. We catch
412 // this exception below and close the connection since we're
413 // unable to tell if the connection should remain persistent
414 // or not. The default is to close it.
415 if (!transaction->getRequest()->isPersistent()) {
417
418 } else {
419 // The connection is persistent and we are done sending
420 // the previous response. Start listening for the next
421 // requests.
423 doRead();
424 }
425 }
426 } catch (...) {
428 }
429}
430
431void
433 TransactionPtr transaction) {
434 transaction->setOutputBuf(response->toString());
435 doWrite(transaction);
436}
437
438void
439HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
440 if (!acceptor_->isOpen()) {
441 return;
442 }
443
444 if (ec) {
446 }
447
449
450 if (!ec) {
451 if (!tls_context_) {
455 .arg(static_cast<unsigned>(request_timeout_/1000));
456 } else {
460 .arg(static_cast<unsigned>(request_timeout_/1000));
461 }
462
463 if (use_external_) {
464 registered_ = true;
465 auto& iface_mgr = IfaceMgr::instance();
466 if (tcp_socket_) {
467 iface_mgr.addExternalSocket(tcp_socket_->getNative(), 0);
468 }
469 if (tls_socket_) {
470 iface_mgr.addExternalSocket(tls_socket_->getNative(), 0);
471 }
472 watch_socket_.reset(new WatchSocket());
473 iface_mgr.addExternalSocket(watch_socket_->getSelectFd(), 0);
474 }
475
477 doHandshake();
478 }
479}
480
481void
482HttpConnection::handshakeCallback(const boost::system::error_code& ec) {
483 if (registered_) {
485 }
486 if (ec) {
489 .arg(ec.message());
491 } else {
495
496 doRead();
497 }
498}
499
500void
502 boost::system::error_code ec, size_t length) {
503 if (ec) {
504 // IO service has been stopped and the connection is probably
505 // going to be shutting down.
506 if (ec.value() == boost::asio::error::operation_aborted) {
507 return;
508
509 // EWOULDBLOCK and EAGAIN are special cases. Everything else is
510 // treated as fatal error.
511 } else if ((ec.value() != boost::asio::error::try_again) &&
512 (ec.value() != boost::asio::error::would_block)) {
514 return;
515
516 // We got EWOULDBLOCK or EAGAIN which indicate that we may be able to
517 // read something from the socket on the next attempt. Just make sure
518 // we don't try to read anything now in case there is any garbage
519 // passed in length.
520 } else {
521 length = 0;
522 }
523 }
524
525 // Receiving is in progress, so push back the timeout.
526 setupRequestTimer(transaction);
527
528 if (length != 0) {
531 .arg(length)
533
534 transaction->getParser()->postBuffer(static_cast<void*>(transaction->getInputBufData()),
535 length);
536 transaction->getParser()->poll();
537 }
538
539 if (transaction->getParser()->needData()) {
540 // The parser indicates that the some part of the message being
541 // received is still missing, so continue to read.
542 doRead(transaction);
543
544 } else {
545 try {
546 // The whole message has been received, so let's finalize it.
547 transaction->getRequest()->finalize();
548
552
556 .arg(transaction->getParser()->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE));
557
558 } catch (const std::exception& ex) {
562 .arg(ex.what());
563
567 .arg(transaction->getParser()->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE));
568 }
569
570 // Don't want to timeout if creation of the response takes long.
571 request_timer_.cancel();
572
573 defer_shutdown_ = true;
574
575 std::unique_ptr<HttpConnection, void (*)(HttpConnection*)> p(this, [](HttpConnection* c) {
576 c->defer_shutdown_ = false;
577 });
578
579 // Create the response from the received request using the custom
580 // response creator.
581 HttpResponsePtr response = response_creator_->createHttpResponse(transaction->getRequest());
584 .arg(response->toBriefString())
586
590 .arg(HttpMessageParserBase::logFormatHttpMessage(response->toString(),
591 MAX_LOGGED_MESSAGE_SIZE));
592
593 // Response created. Activate the timer again.
594 setupRequestTimer(transaction);
595
596 // Start sending the response.
597 asyncSendResponse(response, transaction);
598 }
599}
600
601void
603 boost::system::error_code ec, size_t length) {
604 if (registered_) {
606 }
607 if (ec) {
608 // IO service has been stopped and the connection is probably
609 // going to be shutting down.
610 if (ec.value() == boost::asio::error::operation_aborted) {
611 return;
612
613 // EWOULDBLOCK and EAGAIN are special cases. Everything else is
614 // treated as fatal error.
615 } else if ((ec.value() != boost::asio::error::try_again) &&
616 (ec.value() != boost::asio::error::would_block)) {
618 return;
619
620 // We got EWOULDBLOCK or EAGAIN which indicate that we may be able to
621 // write something to the socket on the next attempt. Make sure we
622 // don't consume any buffer in case there is any garbage passed in
623 // length.
624 } else {
625 length = 0;
626 }
627 }
628
629 // Since each transaction has its own output buffer, it is not really
630 // possible that the number of bytes written is larger than the size
631 // of the buffer. But, let's be safe and set the length to the size
632 // of the buffer if that unexpected condition occurs.
633 if (length > transaction->getOutputBufSize()) {
634 length = transaction->getOutputBufSize();
635 }
636
637 if (length <= transaction->getOutputBufSize()) {
638 // Sending is in progress, so push back the timeout.
639 setupRequestTimer(transaction);
640 }
641
642 // Eat the 'length' number of bytes from the output buffer and only
643 // leave the part of the response that hasn't been sent.
644 transaction->consumeOutputBuf(length);
645
646 // Schedule the write of the unsent data.
647 doWrite(transaction);
648}
649
650void
652 // Pass raw pointer rather than shared_ptr to this object,
653 // because IntervalTimer already passes shared pointer to the
654 // IntervalTimerImpl to make sure that the callback remains
655 // valid.
657 this, transaction),
659}
660
661void
667
668void
673
674 // We need to differentiate the transactions between a normal response and the
675 // timeout. We create new transaction from the current transaction. It is
676 // to preserve the request we're responding to.
677 auto spawned_transaction = Transaction::spawn(response_creator_, transaction);
678
679 // The new transaction inherits the request from the original transaction
680 // if such transaction exists.
681 auto request = spawned_transaction->getRequest();
682
683 // Depending on when the timeout occurred, the HTTP version of the request
684 // may or may not be available. Therefore we check if the HTTP version is
685 // set in the request. If it is not available, we need to create a dummy
686 // request with the default HTTP/1.0 version. This version will be used
687 // in the response.
688 if (request->context()->http_version_major_ == 0) {
689 request.reset(new HttpRequest(HttpRequest::Method::HTTP_POST, "/",
691 HostHttpHeader("dummy")));
692 request->finalize();
693 }
694
695 // Create the timeout response.
696 HttpResponsePtr response =
697 response_creator_->createStockHttpResponse(request,
699
700 // Send the HTTP 408 status.
701 asyncSendResponse(response, spawned_transaction);
702}
703
704void
709 // In theory we should shutdown first and stop/close after but
710 // it is better to put the connection management responsibility
711 // on the client... so simply drop idle connections.
713}
714
715std::string
717 try {
718 if (tcp_socket_) {
719 if (tcp_socket_->getASIOSocket().is_open()) {
720 return (tcp_socket_->getASIOSocket().remote_endpoint().address().to_string());
721 }
722 } else if (tls_socket_) {
723 if (tls_socket_->getASIOSocket().is_open()) {
724 return (tls_socket_->getASIOSocket().remote_endpoint().address().to_string());
725 }
726 }
727 } catch (...) {
728 }
729 return ("(unknown address)");
730}
731
732} // end of namespace isc::http
733} // end of namespace isc
A generic exception that is thrown when an unexpected error condition occurs.
void deleteExternalSocket(int socketfd)
Deletes external socket.
Definition iface_mgr.cc:398
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:52
Represents HTTP Host header.
Definition http_header.h:68
Generic error reported within HttpConnection class.
Definition connection.h:27
static TransactionPtr create(const HttpResponseCreatorPtr &response_creator)
Creates new transaction instance.
Definition connection.cc:46
Transaction(const HttpResponseCreatorPtr &response_creator, const HttpRequestPtr &request=HttpRequestPtr())
Constructor.
Definition connection.cc:35
static TransactionPtr spawn(const HttpResponseCreatorPtr &response_creator, const TransactionPtr &transaction)
Creates new transaction from the current transaction.
Definition connection.cc:51
void closeWatchSocket()
Close the watch socket.
virtual void socketReadCallback(TransactionPtr transaction, boost::system::error_code ec, size_t length)
Callback invoked when new data is received over the socket.
std::weak_ptr< HttpConnectionPool > connection_pool_
Connection pool holding this connection.
Definition connection.h:460
bool closed_
Flag which indicates if the connection was already closed to avoid multiple close calls.
Definition connection.h:482
asiolink::TlsContextPtr tls_context_
TLS context.
Definition connection.h:444
asiolink::IOServicePtr io_service_
The IO service used to handle events.
Definition connection.h:435
void markWatchSocketReady()
Mark the watch socket as ready.
void recordParameters(const HttpRequestPtr &request) const
Records connection parameters into the HTTP request.
void acceptorCallback(const boost::system::error_code &ec)
Local callback invoked when new connection is accepted.
boost::shared_ptr< Transaction > TransactionPtr
Shared pointer to the Transaction.
Definition connection.h:87
void setupIdleTimer()
Reset timer for detecting idle timeout in persistent connections.
void clearWatchSocket()
Clear the watch socket's ready marker.
bool registered_
Flag which indicates if the connection file descriptor was registered as an external socket.
Definition connection.h:486
virtual void socketWriteCallback(TransactionPtr transaction, boost::system::error_code ec, size_t length)
Callback invoked when data is sent over the socket.
void doHandshake()
Asynchronously performs TLS handshake.
void asyncSendResponse(const ConstHttpResponsePtr &response, TransactionPtr transaction)
Sends HTTP response asynchronously.
virtual void doRead(TransactionPtr transaction=TransactionPtr())
Starts asynchronous read from the socket.
HttpAcceptorPtr acceptor_
Pointer to the TCP acceptor used to accept new connections.
Definition connection.h:457
std::unique_ptr< asiolink::TLSSocket< SocketCallback > > tls_socket_
TLS socket used by this connection.
Definition connection.h:454
virtual void doWrite(TransactionPtr transaction)
Starts asynchronous write to the socket.
bool defer_shutdown_
Flag which indicates if the connection shutdown should be deferred until the connection is no longer ...
Definition connection.h:478
void setupRequestTimer(TransactionPtr transaction=TransactionPtr())
Reset timer for detecting request timeouts.
void shutdown()
Shutdown the socket.
void shutdownCallback(const boost::system::error_code &ec)
Callback invoked when TLS shutdown is performed.
void close()
Closes the socket.
void stopThisConnection()
Stops current connection.
HttpConnection(const asiolink::IOServicePtr &io_service, const HttpAcceptorPtr &acceptor, const asiolink::TlsContextPtr &tls_context, std::shared_ptr< HttpConnectionPool > connection_pool, const HttpResponseCreatorPtr &response_creator, const HttpAcceptorCallback &callback, const long request_timeout, const long idle_timeout)
Constructor.
Definition connection.cc:69
std::string getRemoteEndpointAddressAsText() const
Returns remote address in textual form.
bool use_external_
Use external sockets flag.
Definition connection.h:470
void handshakeCallback(const boost::system::error_code &ec)
Local callback invoked when TLS handshake is performed.
HttpResponseCreatorPtr response_creator_
Pointer to the HttpResponseCreator object used to create HTTP responses.
Definition connection.h:464
long idle_timeout_
Timeout after which the persistent HTTP connection is shut down by the server.
Definition connection.h:448
void asyncAccept()
Asynchronously accepts new connection.
std::unique_ptr< asiolink::TCPSocket< SocketCallback > > tcp_socket_
TCP socket used by this connection.
Definition connection.h:451
void requestTimeoutCallback(TransactionPtr transaction)
Callback invoked when the HTTP Request Timeout occurs.
void addExternalSockets(bool use_external=false)
Use external sockets flag.
Definition connection.cc:97
asiolink::IntervalTimer request_timer_
Timer used to detect Request Timeout.
Definition connection.h:438
HttpAcceptorCallback acceptor_callback_
External TCP acceptor callback.
Definition connection.h:467
util::WatchSocketPtr watch_socket_
Pointer to watch socket instance used to signal that the socket is ready for read or write when use e...
Definition connection.h:474
long request_timeout_
Configured Request Timeout in milliseconds.
Definition connection.h:441
void shutdownConnection()
Shuts down current connection.
virtual ~HttpConnection()
Destructor.
Definition connection.cc:92
static std::string logFormatHttpMessage(const std::string &message, const size_t limit=0)
Formats provided HTTP message for logging.
A generic parser for HTTP requests.
Represents HTTP request message.
Definition request.h:57
static bool recordIssuer_
Record issuer name.
Definition request.h:255
static bool recordSubject_
Access control parameters: Flags which indicate what information to record.
Definition request.h:252
Provides an IO "ready" semaphore for use with select() or poll() WatchSocket exposes a single open fi...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
Definition macros.h:32
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
Definition macros.h:20
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
Definition macros.h:14
const isc::log::MessageID HTTP_CONNECTION_SHUTDOWN
const isc::log::MessageID HTTP_CONNECTION_WATCH_SOCKET_CLOSE_ERROR
const isc::log::MessageID HTTP_CONNECTION_HANDSHAKE_START
const isc::log::MessageID HTTP_CONNECTION_SHUTDOWN_FAILED
boost::shared_ptr< const HttpResponse > ConstHttpResponsePtr
Pointer to the const HttpResponse object.
Definition response.h:85
const isc::log::MessageID HTTP_IDLE_CONNECTION_TIMEOUT_OCCURRED
const isc::log::MessageID HTTP_DATA_RECEIVED
const isc::log::MessageID HTTP_BAD_CLIENT_REQUEST_RECEIVED_DETAILS
const isc::log::MessageID HTTP_SERVER_RESPONSE_SEND_DETAILS
const isc::log::MessageID HTTP_CONNECTION_STOP_FAILED
isc::log::Logger http_logger("http")
Defines the logger used within libkea-http library.
Definition http_log.h:18
const isc::log::MessageID HTTP_CLIENT_REQUEST_RECEIVED
const isc::log::MessageID HTTP_CLIENT_REQUEST_TIMEOUT_OCCURRED
const isc::log::MessageID HTTPS_REQUEST_RECEIVE_START
const isc::log::MessageID HTTP_CONNECTION_STOP
std::shared_ptr< HttpConnectionPool > HttpConnectionPoolPtr
Pointer to the HttpConnectionPool.
const isc::log::MessageID HTTP_CONNECTION_HANDSHAKE_FAILED
boost::shared_ptr< HttpResponseCreator > HttpResponseCreatorPtr
Pointer to the HttpResponseCreator object.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
Definition response.h:82
const isc::log::MessageID HTTP_REQUEST_RECEIVE_START
const isc::log::MessageID HTTP_CLIENT_REQUEST_RECEIVED_DETAILS
const isc::log::MessageID HTTP_CONNECTION_WATCH_SOCKET_CLEAR_ERROR
std::function< void(const boost::system::error_code &)> HttpAcceptorCallback
Type of the callback for the TCP acceptor used in this library.
boost::shared_ptr< HttpConnection > HttpConnectionPtr
Pointer to the HttpConnection.
Definition connection.h:41
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
Definition request.h:30
boost::shared_ptr< HttpAcceptor > HttpAcceptorPtr
Type of shared pointer to TCP acceptors.
boost::shared_ptr< HttpsAcceptor > HttpsAcceptorPtr
Type of shared pointer to TLS acceptors.
const isc::log::MessageID HTTP_CONNECTION_WATCH_SOCKET_MARK_READY_ERROR
const isc::log::MessageID HTTP_BAD_CLIENT_REQUEST_RECEIVED
const isc::log::MessageID HTTP_SERVER_RESPONSE_SEND
const int DBGLVL_TRACE_BASIC
Trace basic operations.
const int DBGLVL_TRACE_DETAIL_DATA
Trace data associated with detailed operations.
const int DBGLVL_TRACE_BASIC_DATA
Trace data associated with the basic operations.
const int DBGLVL_TRACE_DETAIL
Trace detailed operations.
Defines the logger used by the top-level component of kea-lfc.
static const HttpVersion & HTTP_10()
HTTP version 1.0.
Definition http_types.h:53