Bug of doing NAT against TPLink TL-WR840N

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug of doing NAT against TPLink TL-WR840N

shawn
Hi developers, I'm using Cling to do an NAT work but failed. The modal of my router is TL-WR840N, made in China. When running UpnpService service = new UpnpServiceImpl(listener); and service.getControlPoint().search(); cling-core-1.0.5 throws an exception, telling "Invalid URLBase". I traced the networking packets and found the router response a null URLBase. Affected files are org.teleal.cling.binding.xml.UDA10DeviceDescriptorBinderSAXImpl.java and UDA10DeviceDescriptorBinderImpl.java, where both commeted with "We hope it's RFC 2396 and RFC 2732 compliant". I fixed it by adding a check: String url = XMLUtil.getTextContent(rootChild); if(url != null && ! url.trim().isEmpty()) ..... Besides, many URI in the xml are padded with white-spaces(0x20) by the router. So function parseURI in UDA10DeviceDescriptorBinderImpl.java might need to check this to avoid an exception. What I did is adding: uri = uri.trim(); to the first line of the function. I have to say this shouldn't be trade as cling's bug. But it must be much better if cling is more compatible. --------- Shawn
Reply | Threaded
Open this post in threaded view
|

Re: Bug of doing NAT against TPLink TL-WR840N

Christian Bauer
Administrator
Did you try 2.0?

Reply | Threaded
Open this post in threaded view
|

Re: Bug of doing NAT against TPLink TL-WR840N

shawn
No, I haven't. I'll try it.

BTW, have the version 1.x been deprecated?
Reply | Threaded
Open this post in threaded view
|

Re: Bug of doing NAT against TPLink TL-WR840N

Christian Bauer
Administrator
> BTW, have the version 1.x been deprecated?

If you mean "should I use the newer version" then yes, of course.