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
ad943e4c
Commit
ad943e4c
authored
May 31, 2016
by
Ian Craggs
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes' into develop
Conflicts: src/Socket.c
parents
1f91546b
89d2c5fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
11 deletions
+24
-11
.travis.yml
.travis.yml
+12
-0
build.xml
build.xml
+2
-1
MQTTPersistenceDefault.c
src/MQTTPersistenceDefault.c
+4
-3
Socket.c
src/Socket.c
+6
-7
No files found.
.travis.yml
0 → 100644
View file @
ad943e4c
language
:
c
compiler
:
-
gcc
-
clang
os
:
-
linux
-
osx
script
:
-
make
build.xml
View file @
ad943e4c
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
<property
name=
"libname.async"
value=
"mqttv3a"
/>
<property
name=
"libname.async"
value=
"mqttv3a"
/>
<property
name=
"libname.async.ssl"
value=
"mqttv3as"
/>
<property
name=
"libname.async.ssl"
value=
"mqttv3as"
/>
<property
name=
"ssl"
value=
"yes"
/>
<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.hostname"
value=
"iot.eclipse.org"
/>
<property
name=
"test.port"
value=
"18883"
/>
<property
name=
"test.port"
value=
"18883"
/>
<if>
<if>
...
@@ -127,7 +128,7 @@
...
@@ -127,7 +128,7 @@
<arg
value=
"${aTest}.exe"
/>
<arg
value=
"${aTest}.exe"
/>
<arg
value=
"--hostname"
/>
<arg
value=
"--hostname"
/>
<arg
value=
"${test.hostname}"
/>
<arg
value=
"${test.hostname}"
/>
<env
key=
"PATH"
path=
"${output.folder}"
/>
<env
key=
"PATH"
path=
"${output.folder}
;${windows.openssl.folder}
"
/>
</exec>
</exec>
</then>
</then>
<else>
<else>
...
...
src/MQTTPersistenceDefault.c
View file @
ad943e4c
/*******************************************************************************
/*******************************************************************************
* Copyright (c) 2009, 201
4
IBM Corp.
* Copyright (c) 2009, 201
6
IBM Corp.
*
*
* All rights reserved. This program and the accompanying materials
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License v1.0
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
* Contributors:
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs - async client updates
* Ian Craggs - async client updates
* Ian Craggs - fix for bug 484496
*******************************************************************************/
*******************************************************************************/
/**
/**
...
@@ -73,8 +74,8 @@ int pstopen(void **handle, const char* clientID, const char* serverURI, void* co
...
@@ -73,8 +74,8 @@ int pstopen(void **handle, const char* clientID, const char* serverURI, void* co
/* Note that serverURI=address:port, but ":" not allowed in Windows directories */
/* Note that serverURI=address:port, but ":" not allowed in Windows directories */
perserverURI
=
malloc
(
strlen
(
serverURI
)
+
1
);
perserverURI
=
malloc
(
strlen
(
serverURI
)
+
1
);
strcpy
(
perserverURI
,
serverURI
);
strcpy
(
perserverURI
,
serverURI
);
ptraux
=
strstr
(
perserverURI
,
":"
);
while
((
ptraux
=
strstr
(
perserverURI
,
":"
))
!=
NULL
)
*
ptraux
=
'-'
;
*
ptraux
=
'-'
;
/* consider '/' + '-' + '\0' */
/* consider '/' + '-' + '\0' */
clientDir
=
malloc
(
strlen
(
dataDir
)
+
strlen
(
clientID
)
+
strlen
(
perserverURI
)
+
3
);
clientDir
=
malloc
(
strlen
(
dataDir
)
+
strlen
(
clientID
)
+
strlen
(
perserverURI
)
+
3
);
...
...
src/Socket.c
View file @
ad943e4c
/*******************************************************************************
/*******************************************************************************
* Copyright (c) 2009, 201
4
IBM Corp.
* Copyright (c) 2009, 201
6
IBM Corp.
*
*
* All rights reserved. This program and the accompanying materials
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License v1.0
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
* Contributors:
* Contributors:
* Ian Craggs - initial implementation and documentation
* Ian Craggs - initial implementation and documentation
* Ian Craggs - async client updates
* Ian Craggs - async client updates
* Ian Craggs - fix for bug 484496
*******************************************************************************/
*******************************************************************************/
/**
/**
...
@@ -601,6 +602,7 @@ int Socket_new(char* addr, int port, int* sock)
...
@@ -601,6 +602,7 @@ int Socket_new(char* addr, int port, int* sock)
FUNC_ENTRY
;
FUNC_ENTRY
;
*
sock
=
-
1
;
*
sock
=
-
1
;
memset
(
&
address6
,
'\0'
,
sizeof
(
address6
));
if
(
addr
[
0
]
==
'['
)
if
(
addr
[
0
]
==
'['
)
++
addr
;
++
addr
;
...
@@ -609,13 +611,10 @@ int Socket_new(char* addr, int port, int* sock)
...
@@ -609,13 +611,10 @@ int Socket_new(char* addr, int port, int* sock)
{
{
struct
addrinfo
*
res
=
result
;
struct
addrinfo
*
res
=
result
;
/* prefer ip4 addresses */
while
(
res
)
while
(
res
)
{
{
/* prefer ip4 addresses */
if
(
res
->
ai_family
==
AF_INET
)
if
(
res
->
ai_family
==
AF_INET
||
res
->
ai_next
==
NULL
)
{
break
;
break
;
}
res
=
res
->
ai_next
;
res
=
res
->
ai_next
;
}
}
...
@@ -627,7 +626,7 @@ int Socket_new(char* addr, int port, int* sock)
...
@@ -627,7 +626,7 @@ int Socket_new(char* addr, int port, int* sock)
{
{
address6
.
sin6_port
=
htons
(
port
);
address6
.
sin6_port
=
htons
(
port
);
address6
.
sin6_family
=
family
=
AF_INET6
;
address6
.
sin6_family
=
family
=
AF_INET6
;
address6
.
sin6_addr
=
((
struct
sockaddr_in6
*
)(
res
->
ai_addr
))
->
sin6_addr
;
memcpy
(
&
address6
.
sin6_addr
,
&
((
struct
sockaddr_in6
*
)(
res
->
ai_addr
))
->
sin6_addr
,
sizeof
(
address6
.
sin6_addr
))
;
}
}
else
else
#endif
#endif
...
...
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