hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
152 stars 83 forks source link

SocketListener error java.lang.StringIndexOutOfBoundsException #57

Open alexmuntean opened 5 years ago

alexmuntean commented 5 years ago

Hi,

With latest udpate from homekit on my appleTv I got a new error which I don't know how to fix. All devices become inactive with "no response" status and in my logs I see this:

Exception in thread "SocketListener(amuntean-Z68X-UD3H-B3.local.)" java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1967) at javax.jmdns.impl.ServiceInfoImpl.decodeQualifiedNameMapForType(ServiceInfoImpl.java:291) at javax.jmdns.impl.JmDNSImpl.registerServiceType(JmDNSImpl.java:1074) at javax.jmdns.impl.JmDNSImpl.handleRecord(JmDNSImpl.java:1383) at javax.jmdns.impl.JmDNSImpl.handleResponse(JmDNSImpl.java:1412) at javax.jmdns.impl.SocketListener.run(SocketListener.java:60) I also don't have a very stable connection here...

Thanks, Alex

alexmuntean commented 5 years ago

I actually found the bug... https://github.com/jmdns/jmdns/blob/jmdns-3.4.1/src/main/java/javax/jmdns/impl/ServiceInfoImpl.java When I have time I'll try to fix it and do a pull request

I'll update this lib and see if the issue persists