Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
soft
thingsee-sdk
Commits
46b43f4e
Commit
46b43f4e
authored
Aug 18, 2015
by
Pekka Ervasti
Committed by
Pekka Niemimaa
Oct 26, 2015
Browse files
ts_engine/connectors: pass negative error code to process function
Signed-off-by:
Pekka Ervasti
<
pekka.ervasti@haltian.com
>
parent
6f3bed5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
apps/ts_engine/kii-connector/conn_comm.c
View file @
46b43f4e
...
...
@@ -251,18 +251,24 @@ static int execute_task_conn_request(struct conn_network_task_s *task)
if
(
ret
==
OK
)
{
int
status_code
;
int
status_code
=
INT_MIN
;
char
*
content
=
NULL
;
ret
=
execute_http_request
(
&
con
->
srv_ip4addr
,
con
->
port
,
hdr
,
hdrlen
,
data
,
datalen
,
&
status_code
,
&
content
,
task
->
context
);
if
(
ret
==
OK
)
if
(
ret
<
0
)
{
status_code
=
ret
;
}
if
(
status_code
!=
INT_MIN
)
{
next_task
=
task
->
process
(
task
->
context
,
status_code
,
content
);
if
(
next_task
!=
NULL
)
ret
=
conn_network_give_new_conn_task
(
next_task
);
}
conn_free_pointer
((
void
**
)
&
content
);
conn_free_pointer
((
void
**
)
&
hdr
);
}
...
...
@@ -322,6 +328,9 @@ static void *conn_network_thread(void *param)
if
(
ret
<
0
)
{
con_dbg
(
"request_connection on failed, skipping task
\n
"
);
task
.
conn
->
process
(
task
.
conn
->
context
,
NETWORK_ERROR
,
NULL
);
conn_complete_task_workflow
(
task
.
conn
->
context
,
ret
);
conn_destroy_task
(
task
.
conn
);
break
;
}
...
...
apps/ts_engine/meshblu-connector/conn_comm.c
View file @
46b43f4e
...
...
@@ -251,18 +251,24 @@ static int execute_task_conn_request(struct conn_network_task_s *task)
if
(
ret
==
OK
)
{
int
status_code
;
int
status_code
=
INT_MIN
;
char
*
content
=
NULL
;
ret
=
execute_http_request
(
&
con
->
srv_ip4addr
,
con
->
port
,
hdr
,
hdrlen
,
data
,
datalen
,
&
status_code
,
&
content
,
task
->
context
);
if
(
ret
==
OK
)
if
(
ret
<
0
)
{
status_code
=
ret
;
}
if
(
status_code
!=
INT_MIN
)
{
next_task
=
task
->
process
(
task
->
context
,
status_code
,
content
);
if
(
next_task
!=
NULL
)
ret
=
conn_network_give_new_conn_task
(
next_task
);
}
conn_free_pointer
((
void
**
)
&
content
);
conn_free_pointer
((
void
**
)
&
hdr
);
}
...
...
@@ -322,6 +328,9 @@ static void *conn_network_thread(void *param)
if
(
ret
<
0
)
{
con_dbg
(
"request_connection on failed, skipping task
\n
"
);
task
.
conn
->
process
(
task
.
conn
->
context
,
NETWORK_ERROR
,
NULL
);
conn_complete_task_workflow
(
task
.
conn
->
context
,
ret
);
conn_destroy_task
(
task
.
conn
);
break
;
}
...
...
apps/ts_engine/ts-connector/conn_comm.c
View file @
46b43f4e
...
...
@@ -251,18 +251,24 @@ static int execute_task_conn_request(struct conn_network_task_s *task)
if
(
ret
==
OK
)
{
int
status_code
;
int
status_code
=
INT_MIN
;
char
*
content
=
NULL
;
ret
=
execute_http_request
(
&
con
->
srv_ip4addr
,
con
->
port
,
hdr
,
hdrlen
,
data
,
datalen
,
&
status_code
,
&
content
,
task
->
context
);
if
(
ret
==
OK
)
if
(
ret
<
0
)
{
status_code
=
ret
;
}
if
(
status_code
!=
INT_MIN
)
{
next_task
=
task
->
process
(
task
->
context
,
status_code
,
content
);
if
(
next_task
!=
NULL
)
ret
=
conn_network_give_new_conn_task
(
next_task
);
}
conn_free_pointer
((
void
**
)
&
content
);
conn_free_pointer
((
void
**
)
&
hdr
);
}
...
...
@@ -322,6 +328,9 @@ static void *conn_network_thread(void *param)
if
(
ret
<
0
)
{
con_dbg
(
"request_connection on failed, skipping task
\n
"
);
task
.
conn
->
process
(
task
.
conn
->
context
,
NETWORK_ERROR
,
NULL
);
conn_complete_task_workflow
(
task
.
conn
->
context
,
ret
);
conn_destroy_task
(
task
.
conn
);
break
;
}
...
...
Write
Preview
Supports
Markdown
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