Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
da3f6341
Commit
da3f6341
authored
Aug 14, 2013
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #415042
parent
e5882541
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
MQTTAsync.c
src/MQTTAsync.c
+2
-1
Thread.c
src/Thread.c
+7
-2
MQTTAsync_publish.c
src/samples/MQTTAsync_publish.c
+1
-1
No files found.
src/MQTTAsync.c
View file @
da3f6341
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
* Ian Craggs, Allan Stockdill-Mander - SSL support
* Ian Craggs, Allan Stockdill-Mander - SSL support
* Ian Craggs - multiple server connection support
* Ian Craggs - multiple server connection support
* Ian Craggs - fix for bug 413429 - connectionLost not called
* Ian Craggs - fix for bug 413429 - connectionLost not called
* Ian Craggs - fix for bug# 415042 - using already freed structure
*******************************************************************************/
*******************************************************************************/
/**
/**
...
@@ -2618,7 +2619,7 @@ MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc)
...
@@ -2618,7 +2619,7 @@ MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc)
while
(
ListNextElement
(
m
->
responses
,
&
current
))
while
(
ListNextElement
(
m
->
responses
,
&
current
))
{
{
MQTTAsync_queuedCommand
*
command
=
(
MQTTAsync_queuedCommand
*
)(
current
->
content
);
MQTTAsync_queuedCommand
*
command
=
(
MQTTAsync_queuedCommand
*
)(
current
->
content
);
if
(
command
->
command
.
token
==
((
Puback
*
)
pack
)
->
msgI
d
)
if
(
command
->
command
.
token
==
msgi
d
)
{
{
if
(
!
ListDetach
(
m
->
responses
,
command
))
/* then remove the response from the list */
if
(
!
ListDetach
(
m
->
responses
,
command
))
/* then remove the response from the list */
Log
(
LOG_ERROR
,
-
1
,
"Publish command not removed from command list"
);
Log
(
LOG_ERROR
,
-
1
,
"Publish command not removed from command list"
);
...
...
src/Thread.c
View file @
da3f6341
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
* Contributors:
* Contributors:
* Ian Craggs - initial implementation
* Ian Craggs - initial implementation
* Ian Craggs, Allan Stockdill-Mander - async client updates
* Ian Craggs, Allan Stockdill-Mander - async client updates
* Ian Craggs - bug #415042 - start Linux thread as disconnected
*******************************************************************************/
*******************************************************************************/
/**
/**
...
@@ -53,18 +54,22 @@
...
@@ -53,18 +54,22 @@
*/
*/
thread_type
Thread_start
(
thread_fn
fn
,
void
*
parameter
)
thread_type
Thread_start
(
thread_fn
fn
,
void
*
parameter
)
{
{
#if defined(WIN32)
#if defined(WIN32)
thread_type
thread
=
NULL
;
thread_type
thread
=
NULL
;
#else
#else
thread_type
thread
=
0
;
thread_type
thread
=
0
;
pthread_attr_t
attr
;
#endif
#endif
FUNC_ENTRY
;
FUNC_ENTRY
;
#if defined(WIN32)
#if defined(WIN32)
thread
=
CreateThread
(
NULL
,
0
,
fn
,
parameter
,
0
,
NULL
);
thread
=
CreateThread
(
NULL
,
0
,
fn
,
parameter
,
0
,
NULL
);
#else
#else
if
(
pthread_create
(
&
thread
,
NULL
,
fn
,
parameter
)
!=
0
)
pthread_attr_init
(
&
attr
);
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_DETACHED
);
if
(
pthread_create
(
&
thread
,
&
attr
,
fn
,
parameter
)
!=
0
)
thread
=
0
;
thread
=
0
;
pthread_attr_destroy
(
&
attr
);
#endif
#endif
FUNC_EXIT
;
FUNC_EXIT
;
return
thread
;
return
thread
;
...
...
src/samples/MQTTAsync_publish.c
View file @
da3f6341
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "string.h"
#include "string.h"
#include "MQTTAsync.h"
#include "MQTTAsync.h"
#define ADDRESS "tcp://
swtest.hursley.ibm.com
:1883"
#define ADDRESS "tcp://
m2m.eclipse.org
:1883"
#define CLIENTID "ExampleClientPub"
#define CLIENTID "ExampleClientPub"
#define TOPIC "MQTT Examples"
#define TOPIC "MQTT Examples"
#define PAYLOAD "Hello World!"
#define PAYLOAD "Hello World!"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment