jls-lumberjack 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lumberjack/server.rb +15 -3
- metadata +15 -13
data/lib/lumberjack/server.rb
CHANGED
@@ -44,7 +44,18 @@ module Lumberjack
|
|
44
44
|
|
45
45
|
def run(&block)
|
46
46
|
while true
|
47
|
-
|
47
|
+
# NOTE: This means ssl accepting is single-threaded.
|
48
|
+
begin
|
49
|
+
client = @ssl_server.accept
|
50
|
+
rescue EOFError, OpenSSL::SSL::SSLError, IOError
|
51
|
+
# ssl handshake failure or other issue, skip it.
|
52
|
+
# TODO(sissel): log the error
|
53
|
+
# TODO(sissel): try to identify what client was connecting that failed.
|
54
|
+
client.close rescue nil
|
55
|
+
next
|
56
|
+
end
|
57
|
+
|
58
|
+
Thread.new(client) do |fd|
|
48
59
|
Connection.new(fd).run(&block)
|
49
60
|
end
|
50
61
|
end
|
@@ -209,11 +220,12 @@ module Lumberjack
|
|
209
220
|
#send(event, *args)
|
210
221
|
end # feed
|
211
222
|
end # while true
|
212
|
-
rescue EOFError, OpenSSL::SSL::SSLError
|
223
|
+
rescue EOFError, OpenSSL::SSL::SSLError, IOError
|
213
224
|
# EOF or other read errors, only action is to shutdown which we'll do in
|
214
225
|
# 'ensure'
|
215
226
|
ensure
|
216
|
-
|
227
|
+
# Try to ensure it's closed, but if this fails I don't care.
|
228
|
+
@fd.close rescue nil
|
217
229
|
end # def run
|
218
230
|
|
219
231
|
def window_size(size)
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jls-lumberjack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.16
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jordan Sissel
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: lumberjack log transport library
|
15
15
|
email:
|
@@ -22,26 +22,28 @@ files:
|
|
22
22
|
- lib/lumberjack/client.rb
|
23
23
|
homepage: https://github.com/jordansissel/lumberjack
|
24
24
|
licenses: []
|
25
|
-
post_install_message:
|
25
|
+
post_install_message:
|
26
26
|
rdoc_options: []
|
27
27
|
require_paths:
|
28
28
|
- lib
|
29
29
|
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
30
|
requirements:
|
32
|
-
- -
|
31
|
+
- - ">="
|
33
32
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
35
|
-
|
33
|
+
version: !binary |-
|
34
|
+
MA==
|
36
35
|
none: false
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: !binary |-
|
41
|
+
MA==
|
42
|
+
none: false
|
41
43
|
requirements: []
|
42
|
-
rubyforge_project:
|
44
|
+
rubyforge_project:
|
43
45
|
rubygems_version: 1.8.24
|
44
|
-
signing_key:
|
46
|
+
signing_key:
|
45
47
|
specification_version: 3
|
46
48
|
summary: lumberjack log transport library
|
47
49
|
test_files: []
|