robustness fixes
This commit is contained in:
parent
9e4bf9eba4
commit
8a88306070
1 changed files with 5 additions and 4 deletions
|
|
@ -82,7 +82,10 @@ end
|
||||||
|
|
||||||
def quit
|
def quit
|
||||||
@thr.exit
|
@thr.exit
|
||||||
|
begin
|
||||||
super
|
super
|
||||||
|
rescue EOFError
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private :sendka
|
private :sendka
|
||||||
|
|
@ -131,6 +134,7 @@ def initialize(nntpservers, groupname, newsrc="~/.newsrc")
|
||||||
set_skip_ids(server, @connections[server]["newsrc"].marked_articles(@group))
|
set_skip_ids(server, @connections[server]["newsrc"].marked_articles(@group))
|
||||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT
|
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT
|
||||||
print "Connection to #{server} failed: #{$!}\n"
|
print "Connection to #{server} failed: #{$!}\n"
|
||||||
|
@connections[server]["nntp"].quit
|
||||||
del_server(server)
|
del_server(server)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
@ -140,9 +144,6 @@ def reconnect(server)
|
||||||
retries = 0
|
retries = 0
|
||||||
begin
|
begin
|
||||||
@connections[server]["nntp"].quit
|
@connections[server]["nntp"].quit
|
||||||
# helpt dit in geheugen gebruik? : Volgens mij niet
|
|
||||||
#@connections[server].delete("nntp")
|
|
||||||
#GC.start
|
|
||||||
rescue Errno::EPIPE, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT
|
rescue Errno::EPIPE, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
|
|
@ -152,7 +153,7 @@ def reconnect(server)
|
||||||
@connections[server]["nntp"] = Net::KANNTP.new(server)
|
@connections[server]["nntp"] = Net::KANNTP.new(server)
|
||||||
end
|
end
|
||||||
resp = @connections[server]["nntp"].mode_reader
|
resp = @connections[server]["nntp"].mode_reader
|
||||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError
|
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError, Errno::ECONNREFUSED
|
||||||
print "Reconnect to #{server} failed: #{$!}\n"
|
print "Reconnect to #{server} failed: #{$!}\n"
|
||||||
if retries > 1
|
if retries > 1
|
||||||
del_server(server)
|
del_server(server)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue