mirror of https://github.com/eclipse/paho.mqtt.c
Fix ant build & test plus some compiler warnings
Squashed commit of the following:
commit 42ff91b70ebc9719048c1676548683cdabfaa433
Author: Ian Craggs <icraggs@uk.ibm.com>
Date: Thu Jun 29 10:38:20 2017 +0100
Proxy ports
commit c7cb7c1372796d26fd09cc9d8a098fd96e0d00d2
Author: Ian Craggs <icraggs@uk.ibm.com>
Date: Wed Jun 28 19:46:19 2017 +0100
Fix build.xml syntax
commit 371565969967a2bbad9965ec87019c57f63beb5f
Author: Ian Craggs <icraggs@uk.ibm.com>
Date: Wed Jun 28 19:45:05 2017 +0100
Fix mqttsas2 invocation
commit ec2d18d37c533d4df3a56cc5d28feb3334259d62
Author: Ian Craggs <icraggs@uk.ibm.com>
Date: Wed Jun 28 19:34:10 2017 +0100
Change broker port to allow proxy to start on Hudson
This commit is contained in:
parent
6b0502d122
commit
d5070d7967
78
build.xml
78
build.xml
|
|
@ -1,15 +1,15 @@
|
|||
<!--****************************************************************************
|
||||
Copyright (c) 2012, 2016 IBM Corp.
|
||||
|
||||
Copyright (c) 2012, 2017 IBM Corp.
|
||||
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
|
||||
The Eclipse Public License is available at
|
||||
and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
|
||||
The Eclipse Public License is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
and the Eclipse Distribution License is available at
|
||||
and the Eclipse Distribution License is available at
|
||||
http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
|
||||
|
||||
Contributors:
|
||||
Ian Craggs - initial API and implementation and/or initial documentation
|
||||
*******************************************************************************-->
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
</classpath>
|
||||
</taskdef>
|
||||
|
||||
<property name="output.folder" value="build/output" />
|
||||
<property name="release.version" value="1.1.0" />
|
||||
<property name="output.folder" value="build/output" />
|
||||
<property name="release.version" value="1.2.0" />
|
||||
|
||||
<property name="libname" value="mqttv3c" />
|
||||
<property name="libname.ssl" value="mqttv3cs" />
|
||||
|
|
@ -33,7 +33,8 @@
|
|||
<property name="ssl" value="yes" />
|
||||
<property name="windows.openssl.folder" value="c:\openssl\bin" />
|
||||
<property name="test.hostname" value="iot.eclipse.org"/>
|
||||
<property name="test.port" value="18883"/>
|
||||
<property name="test.port" value="1883"/>
|
||||
<property name="proxy.port" value="18883"/>
|
||||
<if>
|
||||
<os family="windows"/>
|
||||
<then>
|
||||
|
|
@ -52,7 +53,7 @@
|
|||
</else>
|
||||
</if>
|
||||
<echo message="os.family is '${os.family}'" />
|
||||
|
||||
|
||||
<target name="init">
|
||||
<tstamp>
|
||||
<format property="buildTimestamp" pattern="yyyyMMddHHmm" />
|
||||
|
|
@ -73,22 +74,24 @@
|
|||
<pathconvert refid="async.source.fileset" property="async.source.files" pathsep=" "/>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<target name="version" depends="init" description="replace tags with the right levels">
|
||||
<property name="build.level" value="${DSTAMP}${TSTAMP}" />
|
||||
<property name="build.level" value="${DSTAMP}${TSTAMP}" />
|
||||
<copy file="src/VersionInfo.h.in" tofile="src/VersionInfo.h" />
|
||||
<replace file="src/VersionInfo.h" token="@BUILD_TIMESTAMP@" value="${build.level}" />
|
||||
<replace file="src/VersionInfo.h" token="@CLIENT_VERSION@" value="${release.version}" />
|
||||
</target>
|
||||
|
||||
|
||||
<target name="test" >
|
||||
<!-- display Python version -->
|
||||
<exec executable="python" failonerror="true">
|
||||
<arg line="-V"/>
|
||||
<arg line="-V"/>
|
||||
</exec>
|
||||
<exec executable="python" dir="test" spawn="true">
|
||||
<exec executable="python" dir="test" spawn="true">
|
||||
<arg value="mqttsas2.py" />
|
||||
<arg value="${test.hostname}" />
|
||||
<arg value="${test.port}" />
|
||||
<arg value="${proxy.port}" />
|
||||
</exec>
|
||||
<if>
|
||||
<os family="windows"/>
|
||||
|
|
@ -105,19 +108,23 @@
|
|||
<target name="runAtest">
|
||||
<if>
|
||||
<os family="windows"/>
|
||||
<then>
|
||||
<exec executable="cmd.exe" failonerror="true" dir="${output.folder}/test" >
|
||||
<then>
|
||||
<exec executable="cmd.exe" failonerror="true" dir="${output.folder}/test" >
|
||||
<arg value="/c" />
|
||||
<arg value="${aTest}.exe" />
|
||||
<arg value="--connection" />
|
||||
<arg value="tcp://${test.hostname}:${test.port}" />
|
||||
<arg value="--proxy_connection" />
|
||||
<arg value="tcp://localhost:${proxy.port}" />
|
||||
<env key="PATH" path="${output.folder}" />
|
||||
</exec>
|
||||
</then>
|
||||
<else>
|
||||
<exec executable="./${aTest}" failonerror="true" dir="${output.folder}/test" >
|
||||
<else>
|
||||
<exec executable="./${aTest}" failonerror="true" dir="${output.folder}/test" >
|
||||
<arg value="--connection" />
|
||||
<arg value="tcp://${test.hostname}:1883" />
|
||||
<arg value="tcp://${test.hostname}:${test.port}" />
|
||||
<arg value="--proxy_connection" />
|
||||
<arg value="tcp://localhost:${proxy.port}" />
|
||||
<env key="LD_LIBRARY_PATH" path="${output.folder}" />
|
||||
<env key="DYLD_LIBRARY_PATH" path="${output.folder}" />
|
||||
</exec>
|
||||
|
|
@ -128,8 +135,8 @@
|
|||
<target name="runSSLtest">
|
||||
<if>
|
||||
<os family="windows"/>
|
||||
<then>
|
||||
<exec executable="cmd.exe" failonerror="true" dir="${output.folder}/test" >
|
||||
<then>
|
||||
<exec executable="cmd.exe" failonerror="true" dir="${output.folder}/test" >
|
||||
<arg value="/c" />
|
||||
<arg value="${aTest}.exe" />
|
||||
<arg value="--hostname" />
|
||||
|
|
@ -137,8 +144,8 @@
|
|||
<env key="PATH" path="${output.folder};${windows.openssl.folder}" />
|
||||
</exec>
|
||||
</then>
|
||||
<else>
|
||||
<exec executable="./${aTest}" failonerror="true" dir="${output.folder}/test" >
|
||||
<else>
|
||||
<exec executable="./${aTest}" failonerror="true" dir="${output.folder}/test" >
|
||||
<arg value="--hostname" />
|
||||
<arg value="${test.hostname}" />
|
||||
<env key="LD_LIBRARY_PATH" path="${output.folder}" />
|
||||
|
|
@ -161,10 +168,10 @@
|
|||
</exec>
|
||||
<zip destfile="${output.folder}/MQTTClient_doc.zip">
|
||||
<zipfileset dir="${output.folder}/doc/MQTTClient" />
|
||||
</zip>
|
||||
</zip>
|
||||
<zip destfile="${output.folder}/MQTTAsync_doc.zip">
|
||||
<zipfileset dir="${output.folder}/doc/MQTTAsync" prefix="MQTTAsync/"/>
|
||||
</zip>
|
||||
</zip>
|
||||
<delete dir="${output.folder}/doc" />
|
||||
</then>
|
||||
<else>
|
||||
|
|
@ -176,11 +183,11 @@
|
|||
<target name="build" >
|
||||
<if>
|
||||
<os family="unix"/>
|
||||
<then>
|
||||
<then>
|
||||
<delete dir="${output.folder}" />
|
||||
<!-- display gcc version -->
|
||||
<exec executable="gcc" failonerror="true">
|
||||
<arg line="-v"/>
|
||||
<arg line="-v"/>
|
||||
</exec>
|
||||
<if>
|
||||
<available file="/usr/bin/make"/>
|
||||
|
|
@ -192,7 +199,7 @@
|
|||
</if>
|
||||
<if>
|
||||
<os family="windows"/>
|
||||
<then>
|
||||
<then>
|
||||
<delete dir="${output.folder}" />
|
||||
<!-- display gcc version -->
|
||||
<exec executable="cl" failonerror="true">
|
||||
|
|
@ -209,7 +216,7 @@
|
|||
<mkdir dir="${output.folder}/include"/>
|
||||
<copy overwrite="true" todir="${output.folder}/include">
|
||||
<fileset dir="src" includes="MQTTClient.h,MQTTAsync.h,MQTTClientPersistence.h"/>
|
||||
</copy>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${output.folder}">
|
||||
<fileset dir="." includes="README.md,CONTRIBUTING.md,about.html,notice.html,edl-v10,epl-v10"/>
|
||||
</copy>
|
||||
|
|
@ -224,7 +231,7 @@
|
|||
</move>
|
||||
<copy overwrite="true" todir="${output.folder}/samples">
|
||||
<fileset dir="src/samples" includes="*"/>
|
||||
</copy>
|
||||
</copy>
|
||||
<delete>
|
||||
<fileset dir="." includes="eclipse-paho-mqtt-c-windows-${release.version}.zip"/>
|
||||
<fileset dir="." includes="eclipse-paho-mqtt-c-${os.family}-${release.version}.tar.gz"/>
|
||||
|
|
@ -263,7 +270,7 @@
|
|||
<arg value="lib"/>
|
||||
<arg value="bin"/>
|
||||
</exec>
|
||||
</else>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
|
|
@ -284,7 +291,7 @@
|
|||
<arg value="test"/>
|
||||
<arg value="Windows Build"/>
|
||||
</exec>
|
||||
</then>
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
|
|
@ -299,7 +306,7 @@
|
|||
<include name="*.gz"/>
|
||||
<include name="*.zip"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</copy>
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
|
|
@ -307,4 +314,3 @@
|
|||
<target name="full" depends="init, version, build, test, doc, package, copy" />
|
||||
|
||||
</project>
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue