Kea 3.1.8
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 parser_->initModel();
42}
43
46 return (boost::make_shared<Transaction>(response_creator));
47}
48
51 const TransactionPtr& transaction) {
52 if (transaction) {
53 return (boost::make_shared<Transaction>(response_creator,
54 transaction->getRequest()));
55 }
56 return (create(response_creator));
57}
58
59void
60HttpConnection::
61SocketCallback::operator()(boost::system::error_code ec, size_t length) {
62 if (ec.value() == boost::asio::error::operation_aborted) {
63 return;
64 }
65 callback_(ec, length);
66}
67
69 const HttpAcceptorPtr& acceptor,
70 const TlsContextPtr& tls_context,
71 HttpConnectionPoolPtr connection_pool,
72 const HttpResponseCreatorPtr& response_creator,
73 const HttpAcceptorCallback& callback,
74 const long request_timeout,
75 const long idle_timeout)
77 request_timeout_(request_timeout), tls_context_(tls_context),
78 idle_timeout_(idle_timeout), tcp_socket_(), tls_socket_(),
79 acceptor_(acceptor), connection_pool_(connection_pool),
80 response_creator_(response_creator), acceptor_callback_(callback),
82 closed_(false) {
83 if (!tls_context) {
85 } else {
87 tls_context));
88 }
89}
90
94
95void
97 use_external_ = use_external;
98}
99
100void
102 if (!request) {
103 // Should never happen.
104 return;
105 }
106
107 // Record the remote address.
108 request->setRemote(getRemoteEndpointAddressAsText());
109
110 // Record TLS parameters.
111 if (!tls_socket_) {
112 return;
113 }
114
115 // The connection uses HTTPS aka HTTP over TLS.
116 request->setTls(true);
117
118 // Record the first commonName of the subjectName of the client
119 // certificate when wanted.
121 request->setSubject(tls_socket_->getTlsStream().getSubject());
122 }
123
124 // Record the first commonName of the issuerName of the client
125 // certificate when wanted.
127 request->setIssuer(tls_socket_->getTlsStream().getIssuer());
128 }
129}
130
131void
132HttpConnection::shutdownCallback(const boost::system::error_code&) {
133 if (closed_) {
134 return;
135 }
136 if (use_external_) {
139 use_external_ = false;
140 }
141
142 tls_socket_->close();
143 closed_ = true;
144}
145
146void
148 if (closed_) {
149 return;
150 }
151 request_timer_.cancel();
152 if (tcp_socket_) {
153 if (use_external_) {
156 use_external_ = false;
157 }
158 tcp_socket_->close();
159 closed_ = true;
160 return;
161 }
162 if (tls_socket_) {
163 // Create instance of the callback to close the socket.
164 SocketCallback cb(std::bind(&HttpConnection::shutdownCallback,
165 shared_from_this(),
166 ph::_1)); // error_code
167 tls_socket_->shutdown(cb);
168 return;
169 }
170 // Not reachable?
171 isc_throw(Unexpected, "internal error: unable to shutdown the socket");
172}
173
174void
176 if (!watch_socket_) {
178 return;
179 }
180 try {
181 watch_socket_->markReady();
182 } catch (const std::exception& ex) {
184 .arg(ex.what());
185 }
186}
187
188void
190 if (!watch_socket_) {
192 return;
193 }
194 try {
195 watch_socket_->clearReady();
196 } catch (const std::exception& ex) {
198 .arg(ex.what());
199 }
200}
201
202void
204 if (!watch_socket_) {
206 return;
207 }
209 // Close watch socket and log errors if occur.
210 std::string watch_error;
211 if (!watch_socket_->closeSocket(watch_error)) {
213 .arg(watch_error);
214 }
215}
216
217void
219 if (defer_shutdown_) {
220 io_service_->post(std::bind([](HttpConnectionPtr c) { c->close(); }, shared_from_this()));
221 return;
222 }
223 if (closed_) {
224 return;
225 }
226 request_timer_.cancel();
227 if (tcp_socket_) {
228 if (use_external_) {
231 use_external_ = false;
232 }
233 tcp_socket_->close();
234 closed_ = true;
235 return;
236 }
237 if (tls_socket_) {
238 if (use_external_) {
241 use_external_ = false;
242 }
243 tls_socket_->close();
244 closed_ = true;
245 return;
246 }
247 // Not reachable?
248 isc_throw(Unexpected, "internal error: unable to close the socket");
249}
250
251void
253 auto connection_pool = connection_pool_.lock();
254 try {
258 if (connection_pool) {
259 connection_pool->shutdown(shared_from_this());
260 } else {
261 shutdown();
262 }
263 } catch (...) {
265 }
266}
267
268void
270 auto connection_pool = connection_pool_.lock();
271 if (closed_ && !connection_pool) {
272 return;
273 }
274 try {
278 if (connection_pool) {
279 connection_pool->stop(shared_from_this());
280 } else {
281 close();
282 }
283 } catch (...) {
285 }
286}
287
288void
290 // Create instance of the callback. It is safe to pass the local instance
291 // of the callback, because the underlying boost functions make copies
292 // as needed.
294 shared_from_this(),
295 ph::_1); // error
296 try {
297 HttpsAcceptorPtr tls_acceptor =
298 boost::dynamic_pointer_cast<HttpsAcceptor>(acceptor_);
299 if (!tls_acceptor) {
300 if (!tcp_socket_) {
301 isc_throw(Unexpected, "internal error: TCP socket is null");
302 }
303 acceptor_->asyncAccept(*tcp_socket_, cb);
304 } else {
305 if (!tls_socket_) {
306 isc_throw(Unexpected, "internal error: TLS socket is null");
307 }
308 tls_acceptor->asyncAccept(*tls_socket_, cb);
309 }
310 } catch (const std::exception& ex) {
311 isc_throw(HttpConnectionError, "unable to start accepting TCP "
312 "connections: " << ex.what());
313 }
314}
315
316void
318 // Skip the handshake if the socket is not a TLS one.
319 if (!tls_socket_) {
320 doRead();
321 return;
322 }
323
324 // Create instance of the callback. It is safe to pass the local instance
325 // of the callback, because the underlying boost functions make copies
326 // as needed.
327 SocketCallback cb(std::bind(&HttpConnection::handshakeCallback,
328 shared_from_this(),
329 ph::_1)); // error
330 try {
331 tls_socket_->handshake(cb);
332 if (use_external_) {
334 }
335 } catch (const std::exception& ex) {
336 isc_throw(HttpConnectionError, "unable to perform TLS handshake: "
337 << ex.what());
338 }
339}
340
341void
343 try {
344 TCPEndpoint endpoint;
345
346 // Transaction hasn't been created if we are starting to read the
347 // new request.
348 if (!transaction) {
350 recordParameters(transaction->getRequest());
351 }
352
353 // Create instance of the callback. It is safe to pass the local instance
354 // of the callback, because the underlying std functions make copies
355 // as needed.
356 SocketCallback cb(std::bind(&HttpConnection::socketReadCallback,
357 shared_from_this(),
358 transaction,
359 ph::_1, // error
360 ph::_2)); //bytes_transferred
361 if (tcp_socket_) {
362 tcp_socket_->asyncReceive(static_cast<void*>(transaction->getInputBufData()),
363 transaction->getInputBufSize(),
364 0, &endpoint, cb);
365 return;
366 }
367 if (tls_socket_) {
368 tls_socket_->asyncReceive(static_cast<void*>(transaction->getInputBufData()),
369 transaction->getInputBufSize(),
370 0, &endpoint, cb);
371 return;
372 }
373 } catch (...) {
375 }
376}
377
378void
380 try {
381 if (transaction->outputDataAvail()) {
382 // Create instance of the callback. It is safe to pass the local instance
383 // of the callback, because the underlying std functions make copies
384 // as needed.
385 SocketCallback cb(std::bind(&HttpConnection::socketWriteCallback,
386 shared_from_this(),
387 transaction,
388 ph::_1, // error
389 ph::_2)); // bytes_transferred
390 if (tcp_socket_) {
391 tcp_socket_->asyncSend(transaction->getOutputBufData(),
392 transaction->getOutputBufSize(),
393 cb);
394 if (use_external_) {
396 }
397 return;
398 }
399 if (tls_socket_) {
400 tls_socket_->asyncSend(transaction->getOutputBufData(),
401 transaction->getOutputBufSize(),
402 cb);
403 if (use_external_) {
405 }
406 return;
407 }
408 } else {
409 // The isPersistent() function may throw if the request hasn't
410 // been created, i.e. the HTTP headers weren't parsed. We catch
411 // this exception below and close the connection since we're
412 // unable to tell if the connection should remain persistent
413 // or not. The default is to close it.
414 if (!transaction->getRequest()->isPersistent()) {
416
417 } else {
418 // The connection is persistent and we are done sending
419 // the previous response. Start listening for the next
420 // requests.
422 doRead();
423 }
424 }
425 } catch (...) {
427 }
428}
429
430void
432 TransactionPtr transaction) {
433 transaction->setOutputBuf(response->toString());
434 doWrite(transaction);
435}
436
437void
438HttpConnection::acceptorCallback(const boost::system::error_code& ec) {
439 if (!acceptor_->isOpen()) {
440 return;
441 }
442
443 if (ec) {
445 }
446
448
449 if (!ec) {
450 if (!tls_context_) {
454 .arg(static_cast<unsigned>(request_timeout_/1000));
455 } else {
459 .arg(static_cast<unsigned>(request_timeout_/1000));
460 }
461
462 if (use_external_) {
463 auto& iface_mgr = IfaceMgr::instance();
464 if (tcp_socket_) {
465 iface_mgr.addExternalSocket(tcp_socket_->getNative(), 0);
466 }
467 if (tls_socket_) {
468 iface_mgr.addExternalSocket(tls_socket_->getNative(), 0);
469 }
470 watch_socket_.reset(new WatchSocket());
471 iface_mgr.addExternalSocket(watch_socket_->getSelectFd(), 0);
472 }
473
475 doHandshake();
476 }
477}
478
479void
480HttpConnection::handshakeCallback(const boost::system::error_code& ec) {
481 if (use_external_) {
483 }
484 if (ec) {
487 .arg(ec.message());
489 } else {
493
494 doRead();
495 }
496}
497
498void
500 boost::system::error_code ec, size_t length) {
501 if (ec) {
502 // IO service has been stopped and the connection is probably
503 // going to be shutting down.
504 if (ec.value() == boost::asio::error::operation_aborted) {
505 return;
506
507 // EWOULDBLOCK and EAGAIN are special cases. Everything else is
508 // treated as fatal error.
509 } else if ((ec.value() != boost::asio::error::try_again) &&
510 (ec.value() != boost::asio::error::would_block)) {
512
513 // We got EWOULDBLOCK or EAGAIN which indicate that we may be able to
514 // read something from the socket on the next attempt. Just make sure
515 // we don't try to read anything now in case there is any garbage
516 // passed in length.
517 } else {
518 length = 0;
519 }
520 }
521
522 // Receiving is in progress, so push back the timeout.
523 setupRequestTimer(transaction);
524
525 if (length != 0) {
528 .arg(length)
530
531 transaction->getParser()->postBuffer(static_cast<void*>(transaction->getInputBufData()),
532 length);
533 transaction->getParser()->poll();
534 }
535
536 if (transaction->getParser()->needData()) {
537 // The parser indicates that the some part of the message being
538 // received is still missing, so continue to read.
539 doRead(transaction);
540
541 } else {
542 try {
543 // The whole message has been received, so let's finalize it.
544 transaction->getRequest()->finalize();
545
549
553 .arg(transaction->getParser()->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE));
554
555 } catch (const std::exception& ex) {
559 .arg(ex.what());
560
564 .arg(transaction->getParser()->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE));
565 }
566
567 // Don't want to timeout if creation of the response takes long.
568 request_timer_.cancel();
569
570 defer_shutdown_ = true;
571
572 std::unique_ptr<HttpConnection, void (*)(HttpConnection*)> p(this, [](HttpConnection* c) {
573 c->defer_shutdown_ = false;
574 });
575
576 // Create the response from the received request using the custom
577 // response creator.
578 HttpResponsePtr response = response_creator_->createHttpResponse(transaction->getRequest());
581 .arg(response->toBriefString())
583
587 .arg(HttpMessageParserBase::logFormatHttpMessage(response->toString(),
588 MAX_LOGGED_MESSAGE_SIZE));
589
590 // Response created. Activate the timer again.
591 setupRequestTimer(transaction);
592
593 // Start sending the response.
594 asyncSendResponse(response, transaction);
595 }
596}
597
598void
600 boost::system::error_code ec, size_t length) {
601 if (use_external_) {
603 }
604 if (ec) {
605 // IO service has been stopped and the connection is probably
606 // going to be shutting down.
607 if (ec.value() == boost::asio::error::operation_aborted) {
608 return;
609
610 // EWOULDBLOCK and EAGAIN are special cases. Everything else is
611 // treated as fatal error.
612 } else if ((ec.value() != boost::asio::error::try_again) &&
613 (ec.value() != boost::asio::error::would_block)) {
615
616 // We got EWOULDBLOCK or EAGAIN which indicate that we may be able to
617 // read something from the socket on the next attempt.
618 } else {
619 // Sending is in progress, so push back the timeout.
620 setupRequestTimer(transaction);
621
622 doWrite(transaction);
623 }
624 }
625
626 // Since each transaction has its own output buffer, it is not really
627 // possible that the number of bytes written is larger than the size
628 // of the buffer. But, let's be safe and set the length to the size
629 // of the buffer if that unexpected condition occurs.
630 if (length > transaction->getOutputBufSize()) {
631 length = transaction->getOutputBufSize();
632 }
633
634 if (length <= transaction->getOutputBufSize()) {
635 // Sending is in progress, so push back the timeout.
636 setupRequestTimer(transaction);
637 }
638
639 // Eat the 'length' number of bytes from the output buffer and only
640 // leave the part of the response that hasn't been sent.
641 transaction->consumeOutputBuf(length);
642
643 // Schedule the write of the unsent data.
644 doWrite(transaction);
645}
646
647void
649 // Pass raw pointer rather than shared_ptr to this object,
650 // because IntervalTimer already passes shared pointer to the
651 // IntervalTimerImpl to make sure that the callback remains
652 // valid.
654 this, transaction),
656}
657
658void
664
665void
670
671 // We need to differentiate the transactions between a normal response and the
672 // timeout. We create new transaction from the current transaction. It is
673 // to preserve the request we're responding to.
674 auto spawned_transaction = Transaction::spawn(response_creator_, transaction);
675
676 // The new transaction inherits the request from the original transaction
677 // if such transaction exists.
678 auto request = spawned_transaction->getRequest();
679
680 // Depending on when the timeout occurred, the HTTP version of the request
681 // may or may not be available. Therefore we check if the HTTP version is
682 // set in the request. If it is not available, we need to create a dummy
683 // request with the default HTTP/1.0 version. This version will be used
684 // in the response.
685 if (request->context()->http_version_major_ == 0) {
686 request.reset(new HttpRequest(HttpRequest::Method::HTTP_POST, "/",
688 HostHttpHeader("dummy")));
689 request->finalize();
690 }
691
692 // Create the timeout response.
693 HttpResponsePtr response =
694 response_creator_->createStockHttpResponse(request,
696
697 // Send the HTTP 408 status.
698 asyncSendResponse(response, spawned_transaction);
699}
700
701void
706 // In theory we should shutdown first and stop/close after but
707 // it is better to put the connection management responsibility
708 // on the client... so simply drop idle connections.
710}
711
712std::string
714 try {
715 if (tcp_socket_) {
716 if (tcp_socket_->getASIOSocket().is_open()) {
717 return (tcp_socket_->getASIOSocket().remote_endpoint().address().to_string());
718 }
719 } else if (tls_socket_) {
720 if (tls_socket_->getASIOSocket().is_open()) {
721 return (tls_socket_->getASIOSocket().remote_endpoint().address().to_string());
722 }
723 }
724 } catch (...) {
725 }
726 return ("(unknown address)");
727}
728
729} // end of namespace isc::http
730} // 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:361
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:49
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:45
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:50
void closeWatchSocket()
Close the watch socket.
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:447
bool closed_
Flag which indicates if the connection was already closed to avoid multiple close calls.
Definition connection.h:469
asiolink::TlsContextPtr tls_context_
TLS context.
Definition connection.h:431
asiolink::IOServicePtr io_service_
The IO service used to handle events.
Definition connection.h:422
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.
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.
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:444
std::unique_ptr< asiolink::TLSSocket< SocketCallback > > tls_socket_
TLS socket used by this connection.
Definition connection.h:441
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:465
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:68
std::string getRemoteEndpointAddressAsText() const
Returns remote address in textual form.
bool use_external_
Use external sockets flag.
Definition connection.h:457
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:451
long idle_timeout_
Timeout after which the persistent HTTP connection is shut down by the server.
Definition connection.h:435
void asyncAccept()
Asynchronously accepts new connection.
std::unique_ptr< asiolink::TCPSocket< SocketCallback > > tcp_socket_
TCP socket used by this connection.
Definition connection.h:438
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:96
asiolink::IntervalTimer request_timer_
Timer used to detect Request Timeout.
Definition connection.h:425
HttpAcceptorCallback acceptor_callback_
External TCP acceptor callback.
Definition connection.h:454
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:461
long request_timeout_
Configured Request Timeout in milliseconds.
Definition connection.h:428
void shutdownConnection()
Shuts down current connection.
virtual ~HttpConnection()
Destructor.
Definition connection.cc:91
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:84
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:81
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