This website works better with JavaScript.
Home
Explore
Help
Sign In
RuhNetConsulting
/
rtpengine
mirror of
https://github.com/sipwise/rtpengine
Watch
1
Star
1
Fork
0
Code
Issues
0
Projects
0
Releases
822
Wiki
Activity
Browse Source
since xmlrpc is still segfaulting even in its own process, disable core dumps in the child and retry the xmlrpc call up to 3 times if the child terminates abnormally. jumping through hoops ftw!
git.mgm/mediaproxy-ng/2.1
Richard Fuchs
14 years ago
parent
2ad1d6f65e
commit
d20d747a63
3 changed files
with
27 additions
and
10 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+9
-0
daemon/aux.h
+18
-2
daemon/call.c
+0
-8
daemon/main.c
+ 9
- 0
daemon/aux.h
View File
@ -13,6 +13,7 @@
#
include
<stdarg.h>
#
include
<arpa/inet.h>
#
include
<pthread.h>
#
include
<sys/resource.h>
@ -177,4 +178,12 @@ void thread_create_detach(void (*)(void *), void *);
static
inline
int
rlim
(
int
res
,
rlim_t
val
)
{
struct
rlimit
rlim
;
ZERO
(
rlim
)
;
rlim
.
rlim_cur
=
rlim
.
rlim_max
=
val
;
return
setrlimit
(
res
,
&
rlim
)
;
}
#
endif
+ 18
- 2
daemon/call.c
View File
@ -549,19 +549,35 @@ void xmlrpc_kill_calls(void *p) {
xmlrpc_value
*
r
;
pid_t
pid
;
sigset_t
ss
;
int
i
=
0
;
int
status
;
while
(
xh
-
>
tags
)
{
pid
=
fork
(
)
;
if
(
pid
)
{
waitpid
(
pid
,
NULL
,
0
)
;
xh
-
>
tags
=
g_slist_delete_link
(
xh
-
>
tags
,
xh
-
>
tags
)
;
retry
:
pid
=
waitpid
(
pid
,
&
status
,
0
)
;
if
(
(
pid
>
0
&
&
WIFEXITED
(
status
)
)
|
|
i
>
=
3
)
{
xh
-
>
tags
=
g_slist_delete_link
(
xh
-
>
tags
,
xh
-
>
tags
)
;
i
=
0
;
}
else
{
if
(
pid
=
=
-
1
&
&
errno
=
=
EINTR
)
goto
retry
;
i
+
+
;
}
continue
;
}
/* child process */
rlim
(
RLIMIT_CORE
,
0
)
;
sigemptyset
(
&
ss
)
;
sigprocmask
(
SIG_SETMASK
,
&
ss
,
NULL
)
;
for
(
i
=
0
;
i
<
100
;
i
+
+
)
close
(
i
)
;
alarm
(
5
)
;
xmlrpc_env_init
(
&
e
)
;
+ 0
- 8
daemon/main.c
View File
@ -105,14 +105,6 @@ static void signals(void) {
pthread_sigmask
(
SIG_SETMASK
,
&
ss
,
NULL
)
;
}
static
int
rlim
(
int
res
,
rlim_t
val
)
{
struct
rlimit
rlim
;
ZERO
(
rlim
)
;
rlim
.
rlim_cur
=
rlim
.
rlim_max
=
val
;
return
setrlimit
(
res
,
&
rlim
)
;
}
static
void
resources
(
void
)
{
int
tryv
;
Write
Preview
Loading…
Cancel
Save