Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arne Øslebø
mapi
Commits
b0c8ee5d
Commit
b0c8ee5d
authored
Feb 06, 2008
by
Browse files
fix in DiMAPI re-connection mechanism
git-svn-id:
file:///home/svn/mapi/trunk@1375
8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent
5e136ae6
Changes
2
Show whitespace changes
Inline
Side-by-side
src/lib/mapi.c
View file @
b0c8ee5d
...
...
@@ -3912,6 +3912,7 @@ int mapi_is_sensor_down(int fd){
if
(
rflow
!=
NULL
&&
rflow
->
daemons_down
==
1
)
return
1
;
else
if
(
rflow
!=
NULL
)
return
0
;
#else
return
0
;
// without reconnect always up ??
#endif
...
...
@@ -3920,15 +3921,16 @@ int mapi_is_sensor_down(int fd){
flowdescr_t
*
flow
=
flist_get
(
flowlist
,
fd
);
int
check_mapid
;
if
(
flow
==
NULL
)
return
0
;
check_mapid
=
check_network_mapid
();
if
(
check_mapid
==
1
&&
flow
!=
NULL
)
if
(
check_mapid
==
1
)
{
//up
flow
->
mapid_down
=
0
;
if
(
flow
!=
NULL
&&
flow
->
mapid_down
==
1
)
return
1
;
else
return
0
;
}
else
return
1
;
#else
return
0
;
// without reconnect always up ??
#endif
...
...
src/mapicommd.c
View file @
b0c8ee5d
...
...
@@ -485,6 +485,16 @@ void *handle_request(void *arg) {
}
break
;
case
READ_RESULT
:
#ifdef RECONNECT
if
(
mapi_is_sensor_down
(
dbuf
->
fd
)
==
1
)
{
printf
(
"SENSOR DOWN
\n
"
);
int
local_err
=
MAPI_READ_RESULT_RECONNECTION
;
dbuf
->
cmd
=
ERROR_ACK
;
memcpy
(
dbuf
->
data
,
&
local_err
,
sizeof
(
int
));
dbuf
->
length
=
BASIC_SIZE
+
sizeof
(
int
);
break
;
}
#endif
result
=
mapi_read_results
(
dbuf
->
fd
,
dbuf
->
fid
);
if
(
result
!=
NULL
&&
result
->
size
<
DIMAPI_DATA_SIZE
){
dbuf
->
cmd
=
READ_RESULT_ACK
;
...
...
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