ViaQ / Relp

Native RELP protocol implementation in Ruby
MIT License
7 stars 4 forks source link

Rewrite of plugin to fully implement protocol #19

Closed onet-git closed 4 years ago

onet-git commented 4 years ago

This is a significant rewrite of the plugin to address several issues I encountered with the previous version.

1) Errors during the SSL handshake would cause the server to crash. 2) Every ~30s connections would be dropped due to SSL queuing issues. 3) Messages were being munged before being sent up to the callback. 4) The plugin was not providing information on the peer, making it unclear where messages are coming from when talking to multiple clients. 5) The implementation now does a proper length check on messages, addressing https://github.com/ViaQ/Relp/issues/16

I bumped the version number to 1.0.0 due to the change in both callback parameters and the change in what data is returned (i.e. it does not trim trailing new lines).

Unfortunately there are no unit tests and it has only been extensively tested against the rsyslog librelp implementation.

Assuming this looks good I will make a separate pull request for fluent-plugin-relp to use this version of the relp plugin.

onet-git commented 4 years ago

I added unit tests and cleaned up some of the parameters passing and close connection handling along the way. Update requirement to Ruby 2.1 to support keyword parameters with default values.

onet-git commented 4 years ago

@richm can you review this so that fluent-plugin-relp plugin can use this version? I hope that the unit test at least makes it easier to verify that this version is correct.