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

Introduce server plugin helpers #1312

Merged
merged 29 commits into from
Nov 28, 2016
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a01883a
make sure to mark as loop not running
tagomoris Nov 15, 2016
6874665
add server plugin helper
tagomoris Nov 16, 2016
1e7b78f
migrate plugins to v0.14 APIs with server plugin helper
tagomoris Nov 16, 2016
5c6ffce
update implementation using serever plugin helper
tagomoris Nov 16, 2016
9fb9c3d
fix buggy test code
tagomoris Nov 16, 2016
cca6e9a
On windows, @socket_manager_path is a port number
tagomoris Nov 16, 2016
faa3137
close-on-exec is unavailable on windows
tagomoris Nov 16, 2016
ebc8087
fix not to set close-on-exec, because it's set by ruby
tagomoris Nov 16, 2016
6dca048
remove mixin not required anymore
tagomoris Nov 16, 2016
45ac6a6
set do_not_reverse_lookup to sockets to listen and after accepted
tagomoris Nov 17, 2016
d4d5f35
return watcher when attached, and detach watchers attached by plugin …
tagomoris Nov 22, 2016
d766ecd
break #shutdown by timeout if any event watcher blocks infinitly
tagomoris Nov 22, 2016
faa51a8
add argument checks
tagomoris Nov 22, 2016
48fe5e6
show protocol of created servers in dump
tagomoris Nov 22, 2016
84d82b7
remove all callbacks for udp server, add established connection handling
tagomoris Nov 22, 2016
93b5e00
add tests of server plugin helper
tagomoris Nov 22, 2016
93e5c1e
show tests which be stuck
tagomoris Nov 22, 2016
3493bb9
update serverengine dependency to fix IPv6 support on Windows
tagomoris Nov 22, 2016
c12758e
fix not to use power_assert to avoid SystemStackError on this assertion
tagomoris Nov 22, 2016
f29de3e
fix to assert hostname directly for environments which does not have …
tagomoris Nov 22, 2016
5a97f75
update ServerEngine not to crash for IPv6 & Windows
tagomoris Nov 24, 2016
f1f5dc5
refer both of source_hostname_key and source_host_key (as optional pa…
tagomoris Nov 24, 2016
89ebb46
simplify code and inspect objects for errors
tagomoris Nov 24, 2016
6497319
add helper method to get unused UDP ports
tagomoris Nov 24, 2016
742b79f
revert verbose testing option for CI services
tagomoris Nov 24, 2016
cf763b9
removed debugging message
tagomoris Nov 24, 2016
a29481f
separate setting socket options to share it with socket plugin helper
tagomoris Nov 25, 2016
ecc0959
rescue Errno::ECONNRESET for cases ICMP has trouble (for getting host…
tagomoris Nov 25, 2016
4e63ef4
require top level ServerEngine
tagomoris Nov 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
show protocol of created servers in dump
  • Loading branch information
tagomoris committed Nov 28, 2016
commit 48fe5e6b62bab948b919e5ebf2e867d0a33639be
18 changes: 13 additions & 5 deletions lib/fluent/plugin_helper/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def server_create_connection(title, port, proto: :tcp, bind: '0.0.0.0', shared:
raise "unknown protocol #{proto}"
end

server_attach(title, port, bind, shared, server)
server_attach(title, proto, port, bind, shared, server)
end

# server_create(:title, @port) do |data|
Expand Down Expand Up @@ -148,7 +148,7 @@ def server_create(title, port, proto: :tcp, bind: '0.0.0.0', shared: true, certo
raise "BUG: unknown protocol #{proto}"
end

server_attach(title, port, bind, shared, server)
server_attach(title, proto, port, bind, shared, server)
end

def server_create_tcp(title, port, **kwargs, &callback)
Expand All @@ -159,10 +159,18 @@ def server_create_udp(title, port, **kwargs, &callback)
server_create(title, port, proto: :udp, **kwargs, &callback)
end

ServerInfo = Struct.new(:title, :port, :bind, :shared, :server)
def server_create_tls(title, port, **kwargs, &callback)
server_create(title, port, proto: :tls, **kwargs, &callback)
end

def server_create_unix(title, port, **kwargs, &callback)
server_create(title, port, proto: :unix, **kwargs, &callback)
end

ServerInfo = Struct.new(:title, :proto, :port, :bind, :shared, :server)

def server_attach(title, port, bind, shared, server)
@_servers << ServerInfo.new(title, port, bind, shared, server)
def server_attach(title, proto, port, bind, shared, server)
@_servers << ServerInfo.new(title, proto, port, bind, shared, server)
event_loop_attach(server)
end

Expand Down