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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iDB
irker
Commits
e0dca73f
Commit
e0dca73f
authored
11 years ago
by
Eric S. Raymond
Browse files
Options
Downloads
Patches
Plain Diff
Added - option; irker ca now be used as a channel monitor.
parent
5095c7ae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NEWS
+3
-0
3 additions, 0 deletions
NEWS
irkerd
+14
-4
14 additions, 4 deletions
irkerd
irkerd.xml
+8
-0
8 additions, 0 deletions
irkerd.xml
with
25 additions
and
4 deletions
NEWS
+
3
−
0
View file @
e0dca73f
irker history
1.18
Added -l option; irker can now be used as a channel monitor.
1.17 @ 2013-02-03
Various minor fixes and bulletproofing.
...
...
This diff is collapsed.
Click to expand it.
irkerd
+
14
−
4
View file @
e0dca73f
...
...
@@ -391,6 +391,7 @@ class Irker:
self
.
irc
.
add_global_handler
(
"
featurelist
"
,
self
.
_handle_features
)
self
.
irc
.
add_global_handler
(
"
disconnect
"
,
self
.
_handle_disconnect
)
self
.
irc
.
add_global_handler
(
"
kick
"
,
self
.
_handle_kick
)
self
.
irc
.
add_global_handler
(
"
all_raw_messages
"
,
self
.
_handle_all_raw_messages
)
thread
=
threading
.
Thread
(
target
=
self
.
irc
.
process_forever
)
thread
.
setDaemon
(
True
)
self
.
irc
.
_thread
=
thread
...
...
@@ -425,7 +426,8 @@ class Irker:
arguments
=
arguments
()
for
lump
in
arguments
:
if
lump
.
startswith
(
"
DEAF=
"
):
connection
.
mode
(
cxt
.
nickname
(),
"
+
"
+
lump
[
5
:])
if
not
logfile
:
connection
.
mode
(
cxt
.
nickname
(),
"
+
"
+
lump
[
5
:])
elif
lump
.
startswith
(
"
MAXCHANNELS=
"
):
m
=
int
(
lump
[
12
:])
for
pref
in
"
#&+
"
:
...
...
@@ -453,13 +455,18 @@ class Irker:
def
_handle_kick
(
self
,
connection
,
event
):
"
Server hung up the connection.
"
target
=
event
.
target
# irclib 5.0 compatibility, because the maintainer continues
to be a
# fool.
# irclib 5.0 compatibility, because the maintainer continues
#
to be a
fool.
if
callable
(
target
):
target
=
target
()
self
.
debug
(
1
,
"
irker has been kicked from %s on %s
"
%
(
target
,
connection
.
server
))
if
connection
.
context
:
connection
.
context
.
handle_kick
(
target
)
def
_handle_all_raw_messages
(
self
,
connection
,
event
):
"
Log all messages when in watcher mode.
"
with
open
(
logfile
,
"
w
"
)
as
logfp
:
logfp
.
write
(
"
%03f|%s|%s
\n
"
%
\
(
time
.
time
(),
event
.
source
,
event
.
arguments
[
0
]))
def
handle
(
self
,
line
):
"
Perform a JSON relay request.
"
try
:
...
...
@@ -531,12 +538,15 @@ class IrkerUDPHandler(SocketServer.BaseRequestHandler):
if
__name__
==
'
__main__
'
:
debuglvl
=
0
(
options
,
arguments
)
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"
d:V
"
)
logfile
=
None
(
options
,
arguments
)
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"
d:V:l:
"
)
for
(
opt
,
val
)
in
options
:
if
opt
==
'
-d
'
:
# Enable debug/progress messages
debuglvl
=
int
(
val
)
if
debuglvl
>
1
:
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
elif
opt
==
'
-l
'
:
# Logfile mode - report traffic read in
logfile
=
val
elif
opt
==
'
-V
'
:
# Emit version and exit
sys
.
stdout
.
write
(
"
irkerd version %s
\n
"
%
version
)
sys
.
exit
(
0
)
...
...
This diff is collapsed.
Click to expand it.
irkerd.xml
+
8
−
0
View file @
e0dca73f
...
...
@@ -19,6 +19,7 @@
<cmdsynopsis>
<command>
irkerd
</command>
<arg>
-d
<replaceable>
debuglevel
</replaceable></arg>
<arg>
-l
<replaceable>
logfile
</replaceable></arg>
<arg>
-V
</arg>
</cmdsynopsis>
</refsynopsisdiv>
...
...
@@ -72,6 +73,13 @@ it. This option will generally only be of interest to developers;
consult the source code for details.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
-l
</term>
<listitem><para>
Takes a following filename, logs traffic to that file.
Each log line consists of three |-separated fields; a numeric
timestamp in Unix time, the fqdn of the sending server, and the
message data.
</para></listitem>
</varlistentry>
<varlistentry>
<term>
-V
</term>
<listitem><para>
Write the program version to stdout and
terminate.
</para></listitem>
...
...
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