snapframework / io-streams-haproxy Goto Github PK
View Code? Open in Web Editor NEWHAProxy protocol v1.5 support for io-streams
License: BSD 3-Clause "New" or "Revised" License
HAProxy protocol v1.5 support for io-streams
License: BSD 3-Clause "New" or "Revised" License
A few dependency version bounds need to be bumped.
Windows 8.1 , 64bit, GHC 7.8.3
trying to build master
Failed to install io-streams-haproxy-1.0.0.0
Last 10 lines of the build log ( C:\Users\XXX\AppData\Roaming\cabal\logs\io-streams-haproxy-1.0.0.0.log ):
Not in scope: data constructor `N.SockAddrUnix'
Perhaps you meant one of these:
`N.SockAddrInet' (imported from Network.Socket),
`N.SockAddrInet6' (imported from Network.Socket)
src\System\IO\Streams\Network\HAProxy.hs:357:19:
Not in scope: data constructor `N.SockAddrUnix'
Perhaps you meant one of these:
`N.SockAddrInet' (imported from Network.Socket),
`N.SockAddrInet6' (imported from Network.Socket)
cabal: Error: some packages failed to install:
io-streams-haproxy-1.0.0.0 failed during the building phase. The exception
was:
ExitFailure 1
Hi!
test/blackbox_local
fails on mipsel with the following error:
HUnitFailure (Just (SrcLoc {srcLocPackage = "main", srcLocModule = "System.IO.Streams.Network.HAProxy.Tests", srcLocFile = "test/System/IO/Streams/Network/HAProxy/Tests.hs", srcLocStartLine = 178, srcLocStartCol = 9, srcLocEndLine = 178, srcLocEndCol = 36})) (ExpectedButGot (Just "type") "Stream" "Datagram")
You can find complete logs here. Please let me know if I can help debugging this.
GHC 7.8.3, Cabal 1.20, Haskell Platform 2014.2.0.0, Windows
Error:
Configuring io-streams-haproxy-1.0.0.0...
Building io-streams-haproxy-1.0.0.0...
Failed to install io-streams-haproxy-1.0.0.0
Build log ( C:\projects\snap\.sandbox\logs\io-streams-haproxy-1.0.0.0.log ):
Building io-streams-haproxy-1.0.0.0...
Preprocessing library io-streams-haproxy-1.0.0.0...
[2 of 2] Compiling System.IO.Streams.Network.HAProxy ( src\System\IO\Streams\Network\HAProxy.hs, dist\dist-sandbox-d77347ee\build\System\IO\Streams\Network\HAProxy.o )
src\System\IO\Streams\Network\HAProxy.hs:320:18:
Not in scope: data constructor `N.SockAddrUnix'
Perhaps you meant one of these:
`N.SockAddrInet' (imported from Network.Socket),
`N.SockAddrInet6' (imported from Network.Socket)
src\System\IO\Streams\Network\HAProxy.hs:321:18:
Not in scope: data constructor `N.SockAddrUnix'
Perhaps you meant one of these:
`N.SockAddrInet' (imported from Network.Socket),
`N.SockAddrInet6' (imported from Network.Socket)
src\System\IO\Streams\Network\HAProxy.hs:350:19:
Not in scope: data constructor `N.SockAddrUnix'
Perhaps you meant one of these:
`N.SockAddrInet' (imported from Network.Socket),
`N.SockAddrInet6' (imported from Network.Socket)
cabal.exe: Error: some packages failed to install:
io-streams-haproxy-1.0.0.0 failed during the building phase. The exception
was:
ExitFailure 1
The latest release requires base < 4.15
, so at least that bound needs to be relaxed.
As far as I can tell, io-streams-haproxy-1.0.1.0
is already buildable with GHC-9.2 when the upper bounds on base
and bytestring
are relaxed. Could you adjust these bounds?
AFAICT only the bound on base
needs to be bumped.
The following compile error occurs with GHC 7.2 (base-4.4), compilation with GHC 7.4 (base-4.5) is fine though:
[1 of 2] Compiling System.IO.Streams.Network.Internal.Address ( src/System/IO/Streams/Network/Internal/Address.hs, dist/dist-sandbox-f89bdc8f/build/System/IO/Streams/Network/Internal/Address.o )
[2 of 2] Compiling System.IO.Streams.Network.HAProxy ( src/System/IO/Streams/Network/HAProxy.hs, dist/dist-sandbox-f89bdc8f/build/System/IO/Streams/Network/HAProxy.o )
src/System/IO/Streams/Network/HAProxy.hs:44:62:
Module `Data.Bits' does not export `unsafeShiftR'
xcabal: Error: some packages failed to install:
io-streams-haproxy-1.0.0.0 failed during the building phase. The exception
was:
ExitFailure 1
I've edited in a base >= 4.5
bound at https://hackage.haskell.org/package/io-streams-haproxy-1.0.0.0/revisions/
I'm using code like the following, which causes problems with haproxy
s default keepalive check which consists in sending a PROXY
header and closing the connection right ahead:
(s,sa) <- accept sock
(inst,outst) <- socketToStreams s
localPInfo <- socketToProxyInfo s
The problem is that by the time getPeerName
is called, the connection is already closed, so the system calls fails.
However, if I there was a function which allowed me to pass in the sa
I already got from the accept
, i.e.
socketToProxyInfo :: N.Socket -> IO ProxyInfo
socketToProxyInfo s = socketToProxyInfoWithPeerName s =<< N.getPeerName s
socketToProxyInfoWithPeerName :: N.Socket -> N.SockAddr -> IO ProxyInfo
socketToProxyInfoWithPeerName s sa = do
da <- N.getSocketName s
let (N.MkSocket _ _ !sty _ _) = s
return $! makeProxyInfo sa da (addrFamily sa) sty
I can write the code like below and avoid calling getPeerName
(and thus avoid the failure):
(s,sa) <- accept sock
(inst,outst) <- socketToStreams s
localPInfo <- socketToProxyInfoWithPeerName s sa
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.