projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no dsa keys
[freeside.git]
/
FS
/
bin
/
freeside-selfservice-xmlrpcd
diff --git
a/FS/bin/freeside-selfservice-xmlrpcd
b/FS/bin/freeside-selfservice-xmlrpcd
index
a902051
..
423d2c3
100755
(executable)
--- a/
FS/bin/freeside-selfservice-xmlrpcd
+++ b/
FS/bin/freeside-selfservice-xmlrpcd
@@
-15,7
+15,7
@@
use constant MAX_PROCESSES => 10; # Total server process count.
use constant SERVER_PORT => 8080; # Server port.
use constant TESTING_CHURN => 0; # Randomly test process respawning.
use constant SERVER_PORT => 8080; # Server port.
use constant TESTING_CHURN => 0; # Randomly test process respawning.
-use POE
;
# Base features.
+use POE
1.2;
# Base features.
use POE::Filter::HTTPD; # For serving HTTP content.
use POE::Wheel::ReadWrite; # For socket I/O.
use POE::Wheel::SocketFactory; # For serving socket connections.
use POE::Filter::HTTPD; # For serving HTTP content.
use POE::Wheel::ReadWrite; # For socket I/O.
use POE::Wheel::SocketFactory; # For serving socket connections.
@@
-23,11
+23,12
@@
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
);
+use FS::Daemon qw(
daemonize1 drop_root logfile daemonize2 );
+use FS::UID qw(
adminsuidsetup forksuidsetup dbh
);
use FS::Conf;
use FS::ClientAPI qw( load_clientapi_modules );
use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
use FS::Conf;
use FS::ClientAPI qw( load_clientapi_modules );
use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
+use FS::TicketSystem;
#freeside
my $FREESIDE_LOG = "%%%FREESIDE_LOG%%%";
#freeside
my $FREESIDE_LOG = "%%%FREESIDE_LOG%%%";
@@
-36,7
+37,7
@@
my $lock_file = "$FREESIDE_LOCK/selfservice-xmlrpcd.writelock";
#freeside xmlrpc.cgi
my %typelookup = (
#freeside xmlrpc.cgi
my %typelookup = (
- base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'],
+
#not utf-8 safe#
base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'],
dateTime => [35, sub {$_[0] =~ /^\d{8}T\d\d:\d\d:\d\d$/}, 'as_dateTime'],
string => [40, sub {1}, 'as_string'],
);
dateTime => [35, sub {$_[0] =~ /^\d{8}T\d\d:\d\d:\d\d$/}, 'as_dateTime'],
string => [40, sub {1}, 'as_string'],
);
@@
-63,11
+64,17
@@
logfile("$FREESIDE_LOG/selfservice-xmlrpcd.log");
daemonize2();
daemonize2();
+FS::ClientAPI::Signup::clear_cache();
+
my $conf = new FS::Conf;
die "not running; selfservice-xmlrpc conf option is off\n"
unless $conf->exists('selfservice-xmlrpc');
my $conf = new FS::Conf;
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
###
@@
-186,6
+193,12
@@
sub server_do_fork {
$heap->{is_a_child} = 1;
$heap->{children} = {};
$heap->{is_a_child} = 1;
$heap->{children} = {};
+ #freeside db connection, etc.
+ forksuidsetup($user);
+
+ #why isn't this needed ala freeside-selfservice-server??
+ #FS::TicketSystem->init();
+
return;
}
}
return;
}
}
@@
-280,7
+293,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);
@@
-305,20
+318,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 {
-
- #if we need a db connection in the parent
- ##get new db handle
- #$FS::UID::dbh->{InactiveDestroy} = 1;
- #forksuidsetup($user);
-
- adminsuidsetup($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.