Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GNU Generation
GnuPaste
Commits
c428552e
Commit
c428552e
authored
Dec 25, 2020
by
Antoine Fontaine
🎱
Browse files
Pretty print the ip address
parent
b37e8127
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Paste/Handlers.hs
View file @
c428552e
...
...
@@ -106,7 +106,8 @@ processUpload pool pasteDir instanceUrl reqAddr mXForward multipData =
-- the database.
textifyAddress
::
SockAddr
-- ^ The address to 'Text'ify.
->
Text
textifyAddress
(
SockAddrInet
_
host
)
=
T
.
pack
.
show
.
hostAddressToTuple
$
host
textifyAddress
(
SockAddrInet
_
host
)
=
T
.
pack
.
showIpAddr
.
hostAddressToTuple
$
host
where
showIpAddr
(
a
,
b
,
c
,
d
)
=
show
a
++
"."
++
show
b
++
"."
++
show
c
++
"."
++
show
d
textifyAddress
(
SockAddrInet6
_
_
host
_
)
=
T
.
pack
.
show
$
host
textifyAddress
_
=
"Address not found"
...
...
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