Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
irker
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iDB
irker
Commits
0b2d65bb
Commit
0b2d65bb
authored
Oct 5, 2012
by
Eric S. Raymond
Browse files
Options
Downloads
Patches
Plain Diff
Time out if IRCd fails during handshake.
parent
98d6fc1c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
irkerd
+8
-3
8 additions, 3 deletions
irkerd
with
8 additions
and
3 deletions
irkerd
+
8
−
3
View file @
0b2d65bb
...
...
@@ -30,6 +30,7 @@ PORT = 6659
NAMESTYLE
=
"
irker%03d
"
# IRC nick template - must contain '%d'
XMIT_TTL
=
(
3
*
60
*
60
)
# Time to live, seconds from last transmit
PING_TTL
=
(
15
*
60
)
# Time to live, seconds from last PING
HANDSHAKE_TIMEOUT
=
60
# Time to live, seconds from nick transmit
CHANNEL_TTL
=
(
3
*
60
*
60
)
# Time to live, seconds from last transmit
DISCONNECT_TTL
=
(
24
*
60
*
60
)
# Time to live, seconds from last connect
UNSEEN_TTL
=
60
# Time to live, seconds since first request
...
...
@@ -137,6 +138,7 @@ class Connection:
# Randomness prevents a malicious user or bot from antcipating the
# next trial name in order to block us from completing the handshake.
self
.
nick_trial
+=
random
.
randint
(
1
,
3
)
self
.
last_xmit
=
time
.
time
()
self
.
connection
.
nick
(
self
.
nickname
())
def
handle_disconnect
(
self
):
"
Server disconnected us for flooding or some other reason.
"
...
...
@@ -217,6 +219,9 @@ class Connection:
except
irc
.
client
.
ServerConnectionError
:
self
.
status
=
"
disconnected
"
elif
self
.
status
==
"
handshaking
"
:
if
time
.
time
()
>
self
.
last_xmit
+
HANDSHAKE_TTL
:
self
.
status
=
"
expired
"
else
:
# Don't buzz on the empty-queue test while we're
# handshaking
time
.
sleep
(
ANTI_BUZZ_DELAY
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment