summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-07-15Stop HostAddress constructor running DNS lookup.Alex Clayton
When running the latest stroke against harrier android a NetworkOnMainThread exception was encountered. This was traced to the new constructor HostAddress(String) that was been called by Connector.start() method. The issue was dues to difference between the java code in stroke and the c++ code in swiften. In swiften the equivalent conde calls boost::asio::ip::address::from_string, which parses a string that may be an ipv4 or ipv6 address into an IP address object. If the string is not one of these then the object is left invalid. In the java code InetAddress.getByName(String name) is used instead. If this is an ipv4 or ipv6 address then it parses it into an InetAddress object. However if is not one of these it does a DNS lookup on the address. This was what was causing the error. To match the C++ the java code should only create an InetAddress if the input is an IP address, if not it should be left null. This was done by copying the IPv4 and IPv6 regexes in the Regex class in isode lib. The input to HostAddress(String) is checked against these if it matches InetAddress.getByName is called, otherwise address is set to null. Test-information: Ran unit tests in stroke they all pass. Ran code against android harrier, no longer fails. Ran against MLC (with updates for other changes in stroke api) it still passes. Change-Id: I1945c7c3cdfece8feb45b9196483131c0d9c4e7c
2016-01-12Make Networks equivalent with Swiften.Tarun Gupta
Adds ProxyProviders, DomainNameResolvers and DummyConnection. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for ChainedConnector, Connector and HostAddress. Test also added for ComponentConnector, which needed bits of Network. Five assertions are commented in ConnectorTest, which fails and will be updated after review. Change-Id: I8a62841eb2f9c109bc3a94865b7a003b33493e11
2015-06-18Adds Jingle Elements.Tarun Gupta
Adds: JinglePayload, its Parser and Serializer and JingleReasonParser. JingleContentPayload Element, its Parser and Serializer. JingleDesciption Element. JingleFileTransferDescription Element, its Parser and Serializer. JingleFileTransferFileInfo Element, its Parser and Serializer. JingleFileTransferHash Element, its Parser and Serializer. JingleIBBTransportPayload Element, its Parser and Serializer. JingleS5BTransportPayload Element, its Parser and Serializer. JingleTransportPayload Element and HashElement. Updates HostAddress access specifier for getInetAddress(). License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for: JingleParser JingleContentPayload Parser and Serializer. JingleFileTransferHash Parser and Serializer. JingleFileTranferFileInfo Parser and Serializer. JingleFileTransferDescription Parser and Serializer. JingleIBBTransportPayload Parser and Serializer. JingleS5BTransportPayload Parser and Serializer. All tests passes. Change-Id: Ife1b7fef00efc57d8d0d4290f3280327439abbb6
2012-01-18Add toString to some more classesNick Hudson
Also made "Stanza" be an abstract class and had its ".toString()" include the name of the subclass which is involved, so that the subclasses don't have to do that themselves. Also added null check to existing HostAddress.toString() method Also fixed Remko copyright in Connector class Test-information: Stuff is displayed as expected in debugger.
2011-10-31Fix utf-8 encoding on Remko's name throughout. Now compiles with Java 7Kevin Smith
2011-07-01Initial importKevin Smith