Commit 7c30485c authored by Ian Craggs's avatar Ian Craggs

Update header commments for 3.1.1 updates

parent 28e3c018
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -18,6 +18,7 @@
* Ian Craggs - fix for bug# 415042 - using already freed structure
* Ian Craggs - fix for bug 419233 - mutexes not reporting errors
* Ian Craggs - fix for bug #420851
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......@@ -976,12 +977,11 @@ void MQTTAsync_processCommand()
if (command->command.details.conn.serverURIcount > 0)
{
if (command->command.details.conn.MQTTVersion == 3)
{
command->command.details.conn.currentURI++;
command->command.details.conn.MQTTVersion = 4;
}
if (command->command.details.conn.MQTTVersion == 3)
{
command->command.details.conn.currentURI++;
command->command.details.conn.MQTTVersion = 4;
}
serverURI = command->command.details.conn.serverURIs[command->command.details.conn.currentURI];
if (strncmp(URI_TCP, serverURI, strlen(URI_TCP)) == 0)
......@@ -1175,7 +1175,7 @@ void MQTTAsync_checkTimeouts()
/* check connect timeout */
if (m->c->connect_state != 0 && MQTTAsync_elapsed(m->connect.start_time) > (m->connect.details.conn.timeout * 1000))
{
if (MQTTAsync_checkConn(&m->connect))
if (MQTTAsync_checkConn(&m->connect))
{
MQTTAsync_queuedCommand* conn;
......@@ -1185,7 +1185,7 @@ void MQTTAsync_checkTimeouts()
memset(conn, '\0', sizeof(MQTTAsync_queuedCommand));
conn->client = m;
conn->command = m->connect;
Log(TRACE_MIN, -1, "Connect failed, more to try");
Log(TRACE_MIN, -1, "Connect failed, more to try");
MQTTAsync_addCommand(conn, sizeof(m->connect));
}
else
......@@ -1508,7 +1508,7 @@ thread_return_type WINAPI MQTTAsync_receiveThread(void* n)
}
else
{
if (MQTTAsync_checkConn(&m->connect))
if (MQTTAsync_checkConn(&m->connect))
{
MQTTAsync_queuedCommand* conn;
......@@ -2572,7 +2572,7 @@ int MQTTAsync_connecting(MQTTAsyncs* m)
exit:
if ((rc != 0 && m->c->connect_state != 2) || (rc == SSL_FATAL))
{
if (MQTTAsync_checkConn(&m->connect))
if (MQTTAsync_checkConn(&m->connect))
{
MQTTAsync_queuedCommand* conn;
......@@ -2650,7 +2650,7 @@ MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc)
if ((m->c->connect_state == 3) && (*rc == SOCKET_ERROR))
{
Log(TRACE_MINIMUM, -1, "CONNECT sent but MQTTPacket_Factory has returned SOCKET_ERROR");
if (MQTTAsync_checkConn(&m->connect))
if (MQTTAsync_checkConn(&m->connect))
{
MQTTAsync_queuedCommand* conn;
......@@ -2660,7 +2660,7 @@ MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc)
memset(conn, '\0', sizeof(MQTTAsync_queuedCommand));
conn->client = m;
conn->command = m->connect;
Log(TRACE_MIN, -1, "Connect failed, more to try");
Log(TRACE_MIN, -1, "Connect failed, more to try");
MQTTAsync_addCommand(conn, sizeof(m->connect));
}
else
......
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -20,6 +20,7 @@
* Ian Craggs - fix for bug 421103 - trying to write to same socket, in publish/retries
* Ian Craggs - fix for bug 419233 - mutexes not reporting errors
* Ian Craggs - fix for bug #420851
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......@@ -788,7 +789,7 @@ int MQTTClient_connectURIVersion(MQTTClient handle, MQTTClient_connectOptions* o
goto exit;
}
else if (rc == 1)
{
{
rc = MQTTCLIENT_SUCCESS;
m->c->connect_state = 3;
if (MQTTPacket_send_connect(m->c, MQTTVersion) == SOCKET_ERROR)
......@@ -796,7 +797,7 @@ int MQTTClient_connectURIVersion(MQTTClient handle, MQTTClient_connectOptions* o
rc = SOCKET_ERROR;
goto exit;
}
if(!m->c->cleansession && m->c->session == NULL)
if (!m->c->cleansession && m->c->session == NULL)
m->c->session = SSL_get1_session(m->c->net.ssl);
}
}
......@@ -885,7 +886,7 @@ exit:
if (rc != MQTTCLIENT_SUCCESS)
{
Thread_unlock_mutex(mqttclient_mutex);
MQTTClient_disconnect1(handle, 0, 0, (MQTTVersion == 3)); /* not "internal" because we don't want to call connection lost */
MQTTClient_disconnect1(handle, 0, 0, (MQTTVersion == 3)); /* not "internal" because we don't want to call connection lost */
Thread_lock_mutex(mqttclient_mutex);
}
FUNC_EXIT_RC(rc);
......@@ -981,8 +982,8 @@ int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* options,
m->c->password = options->password;
m->c->retryInterval = options->retryInterval;
if ((rc = MQTTClient_connectURIVersion(handle, options, serverURI, 4 , start, millisecsTimeout)) != MQTTCLIENT_SUCCESS)
rc = MQTTClient_connectURIVersion(handle, options, serverURI, 3, start, millisecsTimeout);
if ((rc = MQTTClient_connectURIVersion(handle, options, serverURI, 4 , start, millisecsTimeout)) != MQTTCLIENT_SUCCESS)
rc = MQTTClient_connectURIVersion(handle, options, serverURI, 3, start, millisecsTimeout);
FUNC_EXIT_RC(rc);
return rc;
......@@ -1113,15 +1114,15 @@ int MQTTClient_disconnect1(MQTTClient handle, int timeout, int internal, int sto
if (Thread_check_sem(m->connect_sem))
Thread_post_sem(m->connect_sem);
if (Thread_check_sem(m->connack_sem))
Thread_post_sem(m->connect_sem);
Thread_post_sem(m->connect_sem);
if (Thread_check_sem(m->suback_sem))
Thread_post_sem(m->suback_sem);
if (Thread_check_sem(m->unsuback_sem))
Thread_post_sem(m->unsuback_sem);
exit:
if (stop)
MQTTClient_stop();
if (stop)
MQTTClient_stop();
if (internal && m->cl && was_connected)
{
Log(TRACE_MIN, -1, "Calling connectionLost for client %s", m->c->clientID);
......
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -13,6 +13,7 @@
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs, Allan Stockdill-Mander - SSL updates
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -13,6 +13,7 @@
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs, Allan Stockdill-Mander - SSL updates
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......@@ -58,18 +59,18 @@ int MQTTPacket_send_connect(Clients* client, int MQTTVersion)
len += strlen(client->password)+2;
ptr = buf = malloc(len);
if (MQTTVersion == 3)
{
writeUTF(&ptr, "MQIsdp");
writeChar(&ptr, (char)3);
}
else if (MQTTVersion == 4)
{
writeUTF(&ptr, "MQTT");
writeChar(&ptr, (char)4);
}
else
goto exit;
if (MQTTVersion == 3)
{
writeUTF(&ptr, "MQIsdp");
writeChar(&ptr, (char)3);
}
else if (MQTTVersion == 4)
{
writeUTF(&ptr, "MQTT");
writeChar(&ptr, (char)4);
}
else
goto exit;
packet.flags.all = 0;
packet.flags.bits.cleanstart = client->cleansession;
......
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -13,6 +13,7 @@
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs, Allan Stockdill-Mander - SSL updates
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
#if !defined(MQTTPACKETOUT_H)
......
/*******************************************************************************
* Copyright (c) 2009, 201 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -13,6 +13,7 @@
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs, Allan Stockdill-Mander - SSL updates
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......@@ -117,7 +118,7 @@ int MQTTProtocol_connect(char* ip_address, Clients* aClient, int ssl, int MQTTVe
if (rc == 0)
{
/* Now send the MQTT connect packet */
if ((rc = MQTTPacket_send_connect(aClient, MQTTVersion)) == 0)
if ((rc = MQTTPacket_send_connect(aClient, MQTTVersion)) == 0)
aClient->connect_state = 3; /* MQTT Connect sent - wait for CONNACK */
else
aClient->connect_state = 0;
......
/*******************************************************************************
* Copyright (c) 2009, 2013 IBM Corp.
* Copyright (c) 2009, 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
......@@ -13,6 +13,7 @@
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs, Allan Stockdill-Mander - SSL updates
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
#if !defined(MQTTPROTOCOLOUT_H)
......
#define MY_ID "@(#) stmqcom/pub1.c, stmqcom, cs 1.85 10/08/24 07:36:24"
/*--------------------------------------------------------------------*/
/* [Platforms]UNIX NT[/Platforms] */
/* [Title]MQ Telemetry MQTT C client tests */
/* [/Title] */
/* [Testclasses]stcom1 stmqcom1[/Category] */
/* [Category]MQ Telemetry[/Category] */
/* */
/* Copyright IBM 2012 */
/* All rights reserved. */
/*--------------------------------------------------------------------*/
/*******************************************************************************
* Copyright (c) 2009, 2014 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
* http://www.eclipse.org/legal/epl-v10.html
* 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
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......@@ -1057,7 +1062,7 @@ int test6(struct Options options)
/* now send the command which will break the connection and cause the will message to be sent */
/*rc = MQTTClient_publish(test6_c1, mqttsas_topic, strlen("TERMINATE"), "TERMINATE", 0, 0, NULL);
assert("Good rc from publish", rc == MQTTCLIENT_SUCCESS, "rc was %d\n", rc);*/
test6_socket_close(((MQTTClients*)test6_c1)->c->net.socket);
test6_socket_close(((MQTTClients*)test6_c1)->c->net.socket);
MyLog(LOGA_INFO, "Waiting to receive the will message");
count = 0;
......
#define MY_ID "@(#) stmqcom/pub1.c, stmqcom, cs 1.85 10/08/24 07:36:24"
/*--------------------------------------------------------------------*/
/* [Platforms]UNIX NT[/Platforms] */
/* [Title]MQ Telemetry MQTT C client SSL tests */
/* [/Title] */
/* [Testclasses]stcom1 stmqcom1[/Category] */
/* [Category]MQ Telemetry[/Category] */
/* */
/* Copyright IBM 2012 */
/* All rights reserved. */
/*--------------------------------------------------------------------*/
/*******************************************************************************
* Copyright (c) 2012, 2014 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
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Allan Stockdill-Mander - initial API and implementation and/or initial documentation
*******************************************************************************/
/**
......
#define MY_ID "@(#) stmqcom/pub1.c, stmqcom, cs 1.85 10/08/24 07:36:24"
/*--------------------------------------------------------------------*/
/* [Platforms]UNIX NT[/Platforms] */
/* [Title]MQ Telemetry MQTT C client tests */
/* [/Title] */
/* [Testclasses]stcom1 stmqcom1[/Category] */
/* [Category]MQ Telemetry[/Category] */
/* */
/* Copyright IBM 2012 */
/* All rights reserved. */
/*--------------------------------------------------------------------*/
/*******************************************************************************
* Copyright (c) 2009, 2014 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
* http://www.eclipse.org/legal/epl-v10.html
* 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
* Ian Craggs - MQTT 3.1.1 support
*******************************************************************************/
/**
......
#define MY_ID "@(#) stmqcom/pub1.c, stmqcom, cs 1.85 10/08/24 07:36:24"
/*--------------------------------------------------------------------*/
/* [Platforms]UNIX NT[/Platforms] */
/* [Title]MQ Telemetry MQTT C client SSL tests */
/* [/Title] */
/* [Testclasses]stcom1 stmqcom1[/Category] */
/* [Category]MQ Telemetry[/Category] */
/* */
/* Copyright IBM 2012 */
/* All rights reserved. */
/*--------------------------------------------------------------------*/
/*******************************************************************************
* Copyright (c) 2012, 2014 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
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Allan Stockdill-Mander - initial API and implementation and/or initial documentation
*******************************************************************************/
/**
* @file
......
#define MY_ID "@(#) stmqcom/pub1.c, stmqcom, cs 1.85 10/08/24 07:36:24"
/*--------------------------------------------------------------------*/
/* [Platforms]UNIX NT[/Platforms] */
/* [Title]MQTT restart/recovery application for Async C client */
/* [/Title] */
/* [Testclasses]stcom1 stmqcom1[/Category] */
/* [Category]MQDrivers[/Category] */
/* */
/* Copyright IBM 2011, 2013 */
/* All rights reserved. */
/*--------------------------------------------------------------------*/
/*******************************************************************************
* Copyright (c) 2011, 2014 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
* http://www.eclipse.org/legal/epl-v10.html
* 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
*******************************************************************************/
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment