add MODE READER command
This commit is contained in:
parent
1369e6ac4f
commit
bb4ae13cfa
2 changed files with 9 additions and 3 deletions
|
|
@ -229,6 +229,10 @@ class NNTP
|
||||||
return shortcmd("SLAVE")
|
return shortcmd("SLAVE")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mode_reader()
|
||||||
|
return shortcmd("MODE READER")
|
||||||
|
end
|
||||||
|
|
||||||
def xhdr(hdr, str)
|
def xhdr(hdr, str)
|
||||||
pat = Regexp.new '^([0-9]+) ?(.*)\n?'
|
pat = Regexp.new '^([0-9]+) ?(.*)\n?'
|
||||||
resp, lines = longcmd "XHDR #{hdr} #{str}"
|
resp, lines = longcmd "XHDR #{hdr} #{str}"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# $Dwarf: article.rb,v 1.93 2004/10/15 13:48:04 ward Exp $
|
# $Dwarf: article.rb,v 1.94 2004/11/21 14:21:03 ward Exp $
|
||||||
# $Source$
|
# $Source$
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2002, 2003, 2004 Ward Wouts <ward@wouts.nl>
|
# Copyright (c) 2002, 2003, 2004, 2005 Ward Wouts <ward@wouts.nl>
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, and distribute this software for any
|
# Permission to use, copy, modify, and distribute this software for any
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
@ -56,6 +56,7 @@ def initialize(nntpservers, groupname, newsrc="~/.newsrc")
|
||||||
timeout(60) do
|
timeout(60) do
|
||||||
@connections[server]["nntp"] = Net::NNTP.new(server)
|
@connections[server]["nntp"] = Net::NNTP.new(server)
|
||||||
end
|
end
|
||||||
|
resp = @connections[server]["nntp"].mode_reader
|
||||||
rescue TimeoutError
|
rescue TimeoutError
|
||||||
sleep 3
|
sleep 3
|
||||||
retry
|
retry
|
||||||
|
|
@ -86,6 +87,7 @@ def reconnect(server)
|
||||||
timeout(60) do
|
timeout(60) do
|
||||||
@connections[server]["nntp"] = Net::NNTP.new(server)
|
@connections[server]["nntp"] = Net::NNTP.new(server)
|
||||||
end
|
end
|
||||||
|
resp = @connections[server]["nntp"].mode_reader
|
||||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError
|
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError
|
||||||
print "Reconnect to #{server} failed: #{$!}\n"
|
print "Reconnect to #{server} failed: #{$!}\n"
|
||||||
if retries > 1
|
if retries > 1
|
||||||
|
|
@ -753,7 +755,7 @@ end
|
||||||
|
|
||||||
def rechunk_runlist(runlist)
|
def rechunk_runlist(runlist)
|
||||||
return nil if runlist == nil
|
return nil if runlist == nil
|
||||||
chunksize = 1000
|
chunksize = 500
|
||||||
blalist = runlist.split(',')
|
blalist = runlist.split(',')
|
||||||
|
|
||||||
# hmmm, als het aantal articles wat tussen de komma's ligt < pak um beet 3
|
# hmmm, als het aantal articles wat tussen de komma's ligt < pak um beet 3
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue