From d5070d7967a8f2dcee87503728f4dee35efc6461 Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Thu, 29 Jun 2017 10:52:06 +0100 Subject: [PATCH] Fix ant build & test plus some compiler warnings Squashed commit of the following: commit 42ff91b70ebc9719048c1676548683cdabfaa433 Author: Ian Craggs Date: Thu Jun 29 10:38:20 2017 +0100 Proxy ports commit c7cb7c1372796d26fd09cc9d8a098fd96e0d00d2 Author: Ian Craggs Date: Wed Jun 28 19:46:19 2017 +0100 Fix build.xml syntax commit 371565969967a2bbad9965ec87019c57f63beb5f Author: Ian Craggs Date: Wed Jun 28 19:45:05 2017 +0100 Fix mqttsas2 invocation commit ec2d18d37c533d4df3a56cc5d28feb3334259d62 Author: Ian Craggs Date: Wed Jun 28 19:34:10 2017 +0100 Change broker port to allow proxy to start on Hudson --- build.xml | 78 ++++++++++++++++++++++++++---------------------- src/MQTTClient.c | 6 ++-- src/Thread.c | 2 +- test/mqttsas2.py | 9 ++++-- 4 files changed, 52 insertions(+), 43 deletions(-) diff --git a/build.xml b/build.xml index ca0a550f..2d5b78d2 100644 --- a/build.xml +++ b/build.xml @@ -1,15 +1,15 @@ @@ -23,8 +23,8 @@ - - + + @@ -33,7 +33,8 @@ - + + @@ -52,7 +53,7 @@ - + @@ -73,22 +74,24 @@ - + - + - + - + - + + + @@ -105,19 +108,23 @@ - - + + + + - - + + - + + + @@ -128,8 +135,8 @@ - - + + @@ -137,8 +144,8 @@ - - + + @@ -161,10 +168,10 @@ - + - + @@ -176,11 +183,11 @@ - + - + @@ -192,7 +199,7 @@ - + @@ -209,7 +216,7 @@ - + @@ -224,7 +231,7 @@ - + @@ -263,7 +270,7 @@ - + @@ -284,7 +291,7 @@ - + @@ -299,7 +306,7 @@ - + @@ -307,4 +314,3 @@ - diff --git a/src/MQTTClient.c b/src/MQTTClient.c index 5068989c..6f15f1ca 100644 --- a/src/MQTTClient.c +++ b/src/MQTTClient.c @@ -286,7 +286,7 @@ static int MQTTClient_disconnect_internal(MQTTClient handle, int timeout); static void MQTTClient_retry(void); static MQTTPacket* MQTTClient_cycle(int* sock, unsigned long timeout, int* rc); static MQTTPacket* MQTTClient_waitfor(MQTTClient handle, int packet_type, int* rc, long timeout); -static int pubCompare(void* a, void* b); +/*static int pubCompare(void* a, void* b); */ static void MQTTProtocol_checkPendingWrites(void); static void MQTTClient_writeComplete(int socket); @@ -1922,12 +1922,12 @@ exit: FUNC_EXIT; } - +/* static int pubCompare(void* a, void* b) { Messages* msg = (Messages*)a; return msg->publish == (Publications*)b; -} +}*/ int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken mdt, unsigned long timeout) diff --git a/src/Thread.c b/src/Thread.c index 4d96d89e..8af5d593 100644 --- a/src/Thread.c +++ b/src/Thread.c @@ -219,7 +219,7 @@ int Thread_wait_sem(sem_type sem, int timeout) * so I've used trywait in a loop instead. Ian Craggs 23/7/2010 */ int rc = -1; -#if !defined(WIN32) && !defined(WIN64) +#if !defined(WIN32) && !defined(WIN64) && !defined(OSX) #define USE_TRYWAIT #if defined(USE_TRYWAIT) int i = 0; diff --git a/test/mqttsas2.py b/test/mqttsas2.py index cbb7abfc..cdcb6b63 100755 --- a/test/mqttsas2.py +++ b/test/mqttsas2.py @@ -106,10 +106,13 @@ def run(): else: brokerport = 1883 - if brokerhost == myhost: - myport = brokerport + 1 + if len(sys.argv) > 3: + myport = int(sys.argv[3]) else: - myport = 1883 + if brokerhost == myhost: + myport = brokerport + 1 + else: + myport = 1883 print("Listening on port", str(myport)+", broker on port", brokerport) s = ThreadingTCPServer(("127.0.0.1", myport), MyHandler)