git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fixes #2064 (#2107)

* Fixes #2064 The unnecessary forward (client) and reverse (server) name resolution was impaired on OS X when IPv6 entries for localhost were missing in /etc/hosts The proposed patch remove this name resolution and makes psc-ide operation independent from name resolution proper configuration. * Added @kika to CONTRIBUTORS.md

commit102eb6a26843f650330bd22fae97c3215e6bbd70 authorKirill Pertsev <kika@kikap.com> dateTue 10 May 2016, 12:53 (10 years ago) parent8b01085
3 files changed+7−4
CONTRIBUTORS.md+1 psc-ide-client/Main.hs+1−1 psc-ide-server/Main.hs+5−3
CONTRIBUTORS.md+1
@@ -31,6 +31,7 @@ This file lists the contributors to the PureScript compiler project, and the ter
3131- [@jacereda](https://github.com/jacereda) (Jorge Acereda) My existing contributions and all future contributions until further notice are Copyright Jorge Acereda, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3232- [@japesinator](https://github.com/japesinator) (JP Smith) My existing contributions and all future contributions until further notice are Copyright JP Smith, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3333- [@joneshf](https://github.com/joneshf) (Hardy Jones) - My existing contributions and all future contributions until further notice are Copyright Hardy Jones, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license.
34+- [@kika](https://github.com/kika) (Kirill Pertsev) - My existing contributions and all future contributions until further notice are Copyright Kirill Pertsev, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license.
3435- [@kRITZCREEK](https://github.com/kRITZCREEK) (Christoph Hegemann) - My existing contributions and all future contributions until further notice are Copyright Christoph Hegemann, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license.
3536- [@L8D](https://github.com/L8D) (Tenor Biel) My existing contributions and all future contributions until further notice are Copyright Tenor Biel, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3637- [@leighman](http://github.com/leighman) (Jack Leigh) My existing contributions and all future contributions until further notice are Copyright Jack Leigh, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
psc-ide-client/Main.hs+1−1
@@ -35,7 +35,7 @@ main = do
3535client :: PortID -> IO ()
3636client port = do
3737 h <-
38− connectTo "localhost" port `catch`
38+ connectTo "127.0.0.1" port `catch`
3939 (\(SomeException e) ->
4040 putStrLn
4141 ("Couldn't connect to psc-ide-server on port: " ++
psc-ide-server/Main.hs+5−3
@@ -40,10 +40,10 @@ import Language.PureScript.Ide.Util
4040import Language.PureScript.Ide.Error
4141import Language.PureScript.Ide.Types
4242import Language.PureScript.Ide.Watcher
43−import Network hiding (socketPort)
43+import Network hiding (socketPort, accept)
4444import Network.BSD (getProtocolNumber)
4545import Network.Socket hiding (PortNumber, Type,
46− accept, sClose)
46+ sClose)
4747import Options.Applicative
4848import System.Directory
4949import System.FilePath
@@ -167,7 +167,9 @@ acceptCommand sock = do
167167 pure (cmd, h)
168168 where
169169 acceptConnection = liftIO $ do
170− (h,_,_) <- accept sock
170+ -- Use low level accept to prevent accidental reverse name resolution
171+ (s,_) <- accept sock
172+ h <- socketToHandle s ReadWriteMode
171173 hSetEncoding h utf8
172174 hSetBuffering h LineBuffering
173175 pure h