Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
freediameter
Commits
6d37281c
Commit
6d37281c
authored
Feb 23, 2010
by
Sebastien Decugis
Browse files
Cleanup termination
parent
1d4f46c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
freeDiameter/cnxctx.c
View file @
6d37281c
...
...
@@ -509,13 +509,14 @@ void fd_cnx_markerror(struct cnxctx * conn)
TRACE_ENTRY
(
"%p"
,
conn
);
CHECK_PARAMS_DO
(
conn
,
goto
fatal
);
TRACE_DEBUG
(
FULL
,
"
Connection (%d)
CC_STATUS_ERROR set"
,
conn
->
cc_socket
);
TRACE_DEBUG
(
FULL
,
"CC_STATUS_ERROR set
for socket %d (%s)
"
,
conn
->
cc_socket
,
conn
->
cc_id
);
/* Mark the error */
conn
->
cc_status
|=
CC_STATUS_ERROR
;
/* Report the error if not reported yet, and not closing */
if
((
!
(
conn
->
cc_status
&
CC_STATUS_CLOSING
))
&&
(
!
(
conn
->
cc_status
&
CC_STATUS_SIGNALED
)))
{
TRACE_DEBUG
(
FULL
,
"Sending FDEVP_CNX_ERROR event"
);
CHECK_FCT_DO
(
fd_event_send
(
Target_Queue
(
conn
),
FDEVP_CNX_ERROR
,
0
,
NULL
),
goto
fatal
);
conn
->
cc_status
|=
CC_STATUS_SIGNALED
;
}
...
...
freeDiameter/sctps.c
View file @
6d37281c
...
...
@@ -114,6 +114,11 @@ static void * demuxer(void * arg)
}
while
(
conn
->
cc_loop
);
out:
/* Signal termination of the connection to all decipher threads */
for
(
strid
=
0
;
strid
<
conn
->
cc_sctp_para
.
pairs
;
strid
++
)
{
if
(
conn
->
cc_sctps_data
.
array
[
strid
].
raw_recv
)
CHECK_FCT_DO
(
fd_event_send
(
conn
->
cc_sctps_data
.
array
[
strid
].
raw_recv
,
FDEVP_CNX_ERROR
,
0
,
NULL
),
goto
fatal
);
}
TRACE_DEBUG
(
FULL
,
"Thread terminated"
);
return
NULL
;
...
...
@@ -180,7 +185,8 @@ static ssize_t sctps_pull(gnutls_transport_ptr_t tr, void * buf, size_t len)
if
(
!
ctx
->
partial
.
buf
)
{
int
ev
;
CHECK_FCT_DO
(
errno
=
fd_event_get
(
ctx
->
raw_recv
,
&
ev
,
&
ctx
->
partial
.
bufsz
,
(
void
*
)
&
ctx
->
partial
.
buf
),
return
-
1
);
ASSERT
(
ev
==
FDEVP_CNX_MSG_RECV
);
if
(
ev
==
FDEVP_CNX_ERROR
)
return
0
;
/* connection closed */
}
pulled
=
ctx
->
partial
.
bufsz
-
ctx
->
partial
.
offset
;
...
...
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