fluent-plugin-out_rawtcp-godel 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ac98fca307be8afc4521cb113cf14d1dc9c81881891ea351f852ef446b634bd
4
- data.tar.gz: 7df50e082ded41cb759db2418aabb7cbfd252008d4d8f6709596f4efe0fd0235
3
+ metadata.gz: 4b99bb4bfc70013d384a47dbd2ba53d29969b1b5c0a39e6881060285d72e6531
4
+ data.tar.gz: 2aeb907d263b69005c21768038e71d5d923ae5361379d7c0d8c7df6bee376c2e
5
5
  SHA512:
6
- metadata.gz: 9d20edd31ff244e08e87b5d37c39eea13a9a5f0119ba502371a41334b2c6883cf81b435a1bc6c4fc2cb320ba689a8ec756d7f2faa59a3e539d4c78388206491e
7
- data.tar.gz: 25087e0530f2773f6dd5c61981f18e67d05ad104df35020fdc408ffda3c27f24b8d902f38f26d0ae7c71e4973f608fdd8f890cf6d776e861e56853bbf052d328
6
+ metadata.gz: 1f82e1dfff69280199d5dcf5b0436fd95ec17dac97b2b1b47a065bdd5a00afdc0366b7489397a0eadb9f8de7970d7055505a2a2004dd04dbf720ba1251dc694f
7
+ data.tar.gz: dd6682db60bba5b50ce86ad611e6fa1709f74e917edb80ab644fa0e88e5bfb3c97ae10a109e5b241bb6bc53f506a66751af204dd9688a70d1194756046b46f00
@@ -2,12 +2,12 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "fluent-plugin-out_rawtcp-godel"
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
  s.authors = ["lxfontes"]
7
7
  s.email = ["lxfontes+rawtcp@gmail.com"]
8
8
  s.description = %q{Raw tcp output plugin for Fluentd}
9
9
  s.summary = %q{output plugin for fluentd}
10
- s.homepage = "https://github.com/juspay/fluent-plugin-out_rawtcp"
10
+ s.homepage = "https://github.com/puneetpahuja/fluent-plugin-out_rawtcp"
11
11
  s.license = 'MIT'
12
12
 
13
13
  s.files = `git ls-files`.split($/)
@@ -8,7 +8,7 @@ module Fluent
8
8
  require 'socket'
9
9
  require 'timeout'
10
10
  require 'fileutils'
11
- @nodes = [] #=> [Node]
11
+ @sockets = [] #=> [Socket]
12
12
  end
13
13
 
14
14
  config_param :send_timeout, :time, :default => 60
@@ -31,8 +31,12 @@ module Fluent
31
31
  unless name
32
32
  name = "#{host}:#{port}"
33
33
  end
34
-
35
- @nodes << RawNode.new(name, host, port)
34
+ sock = connect(RawNode.new(name, host, port))
35
+ opt = [1, @send_timeout.to_i].pack('I!I!') # { int l_onoff; int l_linger; }
36
+ sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, opt)
37
+ opt = [@send_timeout.to_i, 0].pack('L!L!') # struct timeval
38
+ sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, opt)
39
+ @sockets << sock
36
40
  log.info "adding forwarding server '#{name}'", :host=>host, :port=>port
37
41
  end
38
42
  end
@@ -54,19 +58,12 @@ module Fluent
54
58
 
55
59
  error = nil
56
60
 
57
- @nodes.each do |node|
61
+ @sockets.each do |sock|
58
62
  begin
59
- sock = connect(node)
60
- opt = [1, @send_timeout.to_i].pack('I!I!') # { int l_onoff; int l_linger; }
61
- sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, opt)
62
- opt = [@send_timeout.to_i, 0].pack('L!L!') # struct timeval
63
- sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, opt)
64
- send_data(node, chunk, sock)
63
+ send_data(sock, chunk)
65
64
  return
66
65
  rescue
67
66
  error = $!
68
- ensure
69
- sock.close
70
67
  end
71
68
  end
72
69
 
@@ -75,7 +72,7 @@ module Fluent
75
72
  end
76
73
 
77
74
  private
78
- def send_data(node, chunk, sock)
75
+ def send_data(sock, chunk)
79
76
  begin
80
77
  chunk.msgpack_each do |tag, time, record|
81
78
  next unless record.is_a? Hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-out_rawtcp-godel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - lxfontes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-16 00:00:00.000000000 Z
11
+ date: 2019-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -70,7 +70,7 @@ files:
70
70
  - test/helper.rb
71
71
  - test/plugin/test_out_rawtcp.rb
72
72
  - test/plugin/test_pure_json_output.rb
73
- homepage: https://github.com/juspay/fluent-plugin-out_rawtcp
73
+ homepage: https://github.com/puneetpahuja/fluent-plugin-out_rawtcp
74
74
  licenses:
75
75
  - MIT
76
76
  metadata: {}