ktor icon indicating copy to clipboard operation
ktor copied to clipboard

KTOR-4695 Fix UnixSocketAddress.path

Open ptitjes opened this issue 2 years ago • 4 comments

Subsystem ktor-network

Motivation Fixes a regression in the JVM version of UnixSocketAddress (cf KTOR-4695)

Solution Simply give the right object to the call to getPath.invoke().

ptitjes avatar Jul 28 '22 15:07 ptitjes

I think, that may be ktor-team need to setup testing all ktor codebase on JDK 8, 11 and 17 (not sure, if it's possible on infra). ping @e5l

whyoleg avatar Jul 28 '22 19:07 whyoleg

Thanks, will take a look!

e5l avatar Jul 29 '22 07:07 e5l

Whoops, looks like this is my fault. Silly mistake when moving the code and I forgot to change this. I am not sure why the tests didn't pick this up when I modified this, or maybe there isn't a test for this. Also not using the unix sockets myself so didn't notice in my own tests. Sorry for the inconvenience. The PR looks good to me.

Thomas-Vos avatar Aug 03 '22 22:08 Thomas-Vos

@Thomas-Vos Well, it happens! :)

There is a coarse testEchoOverUnixSockets test in ktor-network/jvmAndNix/test/io/ktor/network/sockets/tests/TcpSocketTest.kt that only runs on JDK 16+ (as it is guarded by an if (!supportsUnixDomainSockets())). But it doesn't seem to run on the CI.

Also, there are no simple unit test for the creation of SocketAddress objects, nor for the access of their properties. @e5l should I add some?

ptitjes avatar Aug 08 '22 09:08 ptitjes