Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Cool Fire
pfsense-ident-proxy
Commits
51f1e253
Commit
51f1e253
authored
Aug 11, 2014
by
Cool Fire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warpped the whole thing in a try-catch as an extra failsafe
parent
105689f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
52 deletions
+58
-52
identproxy.rb
identproxy.rb
+58
-52
No files found.
identproxy.rb
View file @
51f1e253
...
...
@@ -41,6 +41,7 @@ end
# Main server loop
loop
do
begin
# New client connected
client
=
server
.
accept
...
...
@@ -48,6 +49,8 @@ loop do
input
=
client
.
gets
input
.
strip!
puts
"Request:
#{
input
}
"
sane
=
true
p1
=
0
p2
=
0
...
...
@@ -55,7 +58,7 @@ loop do
# Check if it's something that looks like an ident response
if
(
input
=~
/^(\d+)(|\s),(|\s)(\d+)$/
)
p1
=
$1
.
to_i
p2
=
$
3
.
to_i
p2
=
$
4
.
to_i
else
sane
=
false
end
...
...
@@ -92,8 +95,11 @@ loop do
next
end
puts
"Response:
#{
result
}
"
client
.
puts
result
# Close connection and wait for the next request
client
.
close
rescue
Exception
=>
e
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment