Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup old code (HTTP, Cluster) #7196

Merged
merged 10 commits into from
May 29, 2019
Merged

Cleanup old code (HTTP, Cluster) #7196

merged 10 commits into from
May 29, 2019

Conversation

dnsmichi
Copy link
Contributor

@dnsmichi dnsmichi commented May 23, 2019

  • SocketEngine*
  • TlsStream
  • JsonRpc::{Send,Read}Message
  • HttpRequest/Response, HttpClientConnection, ApiClient
  • Some features are also using the NetworkStream class which requires the TcpSocket class, this should be rewritten too.

Maybe it also is possible to rewrite the unix socket parts too.

@dnsmichi dnsmichi added this to the 2.11.0 milestone May 24, 2019
@dnsmichi dnsmichi added the core/quality Improve code, libraries, algorithms, inline docs label May 24, 2019
Michael Friedrich added 2 commits May 27, 2019 15:09
The connection handling and code isn't really good, but not
really actively maintained either.

Besides that, the "telnet" method doesn't allow for TLS,
this needs a general rewrite against their HTTP API.

I've also added function documentation where applicable.
This commit changes the reconnect priority to high.

Also add function docs.
@dnsmichi
Copy link
Contributor Author

LivestatusListener uses Unix/TcpSockets with object inheritance on the Socket class, I'd like to get rid of this as well.

ExternalCommandListener uses a plain socket for the pipe, not sure if it is worth the hassle since this will be removed in 2.12 anyways.

@dnsmichi
Copy link
Contributor Author

StreamReadContext with Netstring is something I'd like to get rid of as well, but likely in a separate attempt.

michi@mbpmif ~/dev/icinga/icinga2 (feature/network-cleanup>) $ grep -r StreamReadContext lib/
lib//compat/externalcommandlistener.cpp:		StreamReadContext src;
lib//cli/variableutility.cpp:	StreamReadContext src;
lib//cli/variableutility.cpp:	StreamReadContext src;
lib//cli/objectlistcommand.cpp:	StreamReadContext src;
lib//cli/troubleshootcommand.cpp:	StreamReadContext src;
lib//livestatus/livestatuslistener.cpp:	StreamReadContext context;
lib//base/configobject.cpp:	StreamReadContext src;
lib//base/stream.hpp:struct StreamReadContext
lib//base/stream.hpp:	~StreamReadContext()
lib//base/stream.hpp:	StreamReadStatus ReadLine(String *line, StreamReadContext& context, bool may_wait = false);
lib//base/netstring.cpp:StreamReadStatus NetString::ReadStringFromStream(const Stream::Ptr& stream, String *str, StreamReadContext& context,
lib//base/stream.cpp:StreamReadStatus Stream::ReadLine(String *line, StreamReadContext& context, bool may_wait)
lib//base/stream.cpp:bool StreamReadContext::FillFromStream(const Stream::Ptr& stream, bool may_wait)
lib//base/stream.cpp:void StreamReadContext::DropData(size_t count)
lib//base/netstring.hpp:	static StreamReadStatus ReadStringFromStream(const Stream::Ptr& stream, String *message, StreamReadContext& context,
lib//remote/apilistener.cpp:			StreamReadContext src;
lib//remote/httpchunkedencoding.hpp:	StreamReadContext& StreamContext;
lib//remote/httpchunkedencoding.hpp:	ChunkReadContext(StreamReadContext& scontext)
lib//remote/httpchunkedencoding.cpp:	StreamReadContext& scontext = context.StreamContext;

Michael Friedrich added 2 commits May 28, 2019 13:46
@dnsmichi
Copy link
Contributor Author

Livestatus is a mess to rewrite, I'm leaving this for now in a WIP branch.

@dnsmichi dnsmichi changed the title WIP: Cleanup old code (HTTP, Cluster) Cleanup old code (HTTP, Cluster) May 29, 2019
@dnsmichi dnsmichi merged commit 99bb7fa into master May 29, 2019
@dnsmichi dnsmichi deleted the feature/network-cleanup branch July 16, 2019 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/quality Improve code, libraries, algorithms, inline docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant