projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7cf151a
)
fix leaking db connections in freeside-selfservice-xmlrpcd, RT#7780
author
ivan
<ivan>
Sat, 3 Jul 2010 04:20:01 +0000
(
04:20
+0000)
committer
ivan
<ivan>
Sat, 3 Jul 2010 04:20:01 +0000
(
04:20
+0000)
FS/bin/freeside-selfservice-xmlrpcd
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-selfservice-xmlrpcd
b/FS/bin/freeside-selfservice-xmlrpcd
index
6c75aa8
..
76fe7e6
100755
(executable)
--- a/
FS/bin/freeside-selfservice-xmlrpcd
+++ b/
FS/bin/freeside-selfservice-xmlrpcd
@@
-23,8
+23,8
@@
use POE::Wheel::SocketFactory; # For serving socket connections.
use XMLRPC::Transport::HTTP; #SOAP::Transport::HTTP;
use XMLRPC::Lite; # for XMLRPC::Serializer
use XMLRPC::Transport::HTTP; #SOAP::Transport::HTTP;
use XMLRPC::Lite; # for XMLRPC::Serializer
-use FS::Daemon qw(daemonize1 drop_root logfile daemonize2 );
-use FS::UID qw(
adminsuidsetup forksuidsetup
);
+use FS::Daemon qw(
daemonize1 drop_root logfile daemonize2 );
+use FS::UID qw(
adminsuidsetup forksuidsetup dbh
);
use FS::Conf;
use FS::ClientAPI;
use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
use FS::Conf;
use FS::ClientAPI;
use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
@@
-66,6
+66,10
@@
my $conf = new FS::Conf;
die "not running; selfservice-xmlrpc conf option is off\n"
unless $conf->exists('selfservice-xmlrpc');
die "not running; selfservice-xmlrpc conf option is off\n"
unless $conf->exists('selfservice-xmlrpc');
+#parent doesn't need to hold a DB connection open
+dbh->disconnect;
+undef $FS::UID::dbh;
+
###
# the main loop
###
###
# the main loop
###
@@
-184,6
+188,9
@@
sub server_do_fork {
$heap->{is_a_child} = 1;
$heap->{children} = {};
$heap->{is_a_child} = 1;
$heap->{children} = {};
+ #freeside db connection, etc.
+ forksuidsetup($user);
+
return;
}
}
return;
}
}
@@
-278,7
+285,7
@@
sub client_stop {
sub client_got_request {
my ( $heap, $request ) = @_[ HEAP, ARG0 ];
sub client_got_request {
my ( $heap, $request ) = @_[ HEAP, ARG0 ];
- f
reeside_kid_time()
;
+ f
orksuidsetup($user) unless dbh && dbh->ping
;
my $serializer = new XMLRPC::Serializer(typelookup => \%typelookup);
my $serializer = new XMLRPC::Serializer(typelookup => \%typelookup);
@@
-303,18
+310,6
@@
sub client_got_request {
$heap->{client}->put($response);
}
$heap->{client}->put($response);
}
-#setup the database connection and other things FS::SelfService::XMLRPC
-#expects to be in place. aka "kid time" in freeside-selfservice-server
-sub freeside_kid_time {
-
- #we did need a db connection in the parent, so
- ##get new db handle
- $FS::UID::dbh->{InactiveDestroy} = 1;
- forksuidsetup($user);
-
- #i guess that was it
-}
-
### The client handler received an error. Stop the ReadWrite wheel,
### which also closes the socket.
### The client handler received an error. Stop the ReadWrite wheel,
### which also closes the socket.