31 Commits

Author SHA1 Message Date
Johannes Schmidt
82bb636d2b Use WaitGroup to wait for or abort HTTP requests
The wait group gets passed to HttpServerConnection, then down to the
HttpHandlers. For those handlers that modify the program state, the
wait group is locked so ApiListener will wait on Stop() for the
request to complete. If the request iterates over config objects,
a further check on the state of the wait group is added to abort early
and not delay program shutdown. In that case, 503 responses will be
sent to the client.

Additionally, in HttpServerConnection, no further requests than the
one already started will be allowed once the wait group is joining.
2025-06-13 14:48:15 +02:00
Alexander A. Klimov
c2ddd20ef3 Fix compiler warnings by (copy-)constructing loop variables explicitly
for (const T& needle : haystack) creates the illusion that haystack is a
container of T and we're just borrowing needle. In these cases that's not true.
2025-04-22 13:55:49 +02:00
Alexander A. Klimov
9376a311ea Fix file endings
git ls-files -z \
	|grep -zEe '^lib/' \
	|grep -zEe '\.[ch]pp$' \
	|xargs -0 perl -p0i -e 's/\n*(?!(?:.|\n))/\n/'
2023-05-17 18:05:13 +02:00
Alexander A. Klimov
99c2d69dc8 Handle boost::beast::http::basic_fields#operator[]() signature change (v1.81)
Use always working std::string(x), not broken x.to_string().
(x is a return value.)
2023-01-05 11:18:20 +01:00
Yonas Habteab
488e6bfb67 HTTP Request: Log an exception message if an error occurs 2020-11-02 15:01:48 +01:00
Michael Friedrich
f419efd778 API: Handle permission exceptions soon enough, returning 404
fixes #7513
2019-09-23 09:48:50 +02:00
Alexander A. Klimov
c284cf0b68 HttpServerConnection: encapsulate streaming start indicator 2019-04-02 17:37:29 +02:00
Alexander A. Klimov
fd239ba3fe Adjust /v1/events, too 2019-04-01 11:40:14 +02:00
Alexander A. Klimov
9ae1d732af HttpServerConnection: actually handle requests 2019-04-01 11:40:14 +02:00
Michael Friedrich
d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
d073a807b0 API: Add 'pretty' parameter for beautified JSON response bodies
fixes #5877
2018-01-08 20:55:36 +01:00
Michael Insel
158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Gunnar Beutner
3c60fbf75d Use std::vector::emplace_back instead of std::vector::push_back 2017-11-30 17:47:09 +01:00
Michael Friedrich
b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner
288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner
429d11daa8 Fix compiler warnings
fixes #12534
2016-08-24 20:33:34 +02:00
Michael Friedrich
9a88185b12 API: Fix error handling for invalid JSON request body
fixes #11757
2016-05-10 15:16:35 +02:00
Gunnar Beutner
599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Gunnar Beutner
fa034a96f8 Improve error message for 404s
refs #9447
2015-11-09 10:48:24 +01:00
Michael Friedrich
f498ce39f3 Improve api error handling
refs #10194
2015-09-28 16:08:14 +02:00
Jean-Marcel Flach
5ef4204d06 Improve API error handling and fix some whitespace
fixes #10194
2015-09-25 13:57:28 +02:00
Gunnar Beutner
49fd5b582d Fix: HttpHandler is calling HttpResponse::Finish twice for 404s
fixes #10024
2015-08-28 09:49:31 +02:00
Gunnar Beutner
73b72544ee Fix URL handlers
refs #9768
2015-08-11 09:31:56 +02:00
Gunnar Beutner
890694e629 Implement support for filters
fixes #9077
2015-07-28 13:57:59 +02:00
Michael Friedrich
43ff15cf86 Fix problem with child nodes in http url registry
fixes #9703
2015-07-22 12:27:07 +02:00
Gunnar Beutner
ceea8a24d3 Add missing HTTP response headers
refs #9594
2015-07-13 08:29:48 +02:00
Michael Friedrich
269e79647f Rename HttpRequest.Url to HttpRequest.RequestUrl
Otherwise gcc will break with the Url class, clang works.

refs #9447
2015-07-09 17:32:19 +02:00
Michael Friedrich
8bf949852a API: Implement password- and certificate-based authentication
fixes #9086
fixes #9085
refs #9594
2015-07-09 15:27:14 +02:00
Michael Friedrich
14baa4a79b Build fix
refs #9447
2015-07-09 12:28:15 +02:00
Gunnar Beutner
b357012ded Implement HTTP support
refs #9447
2015-07-09 11:42:34 +02:00