use Sip::Configuration;
use Sip::Checksum qw(checksum verify_cksum);
use Sip::MsgType;
+use Time::HiRes qw/time/;
use Cache::Memcached;
my $conn_id = $mself->{conn_id};
if (!$conn_id) {
$mself->{conn_id} = $conn_id = "$peeraddr:$peerport\@" . time();
+ syslog('LOG_DEBUG', "Created new connection: $conn_id");
+ } else {
+ syslog('LOG_DEBUG', "Inbound msg on existing connection: $conn_id");
}
# check for kids that went away
check_pending_connections();
my $c = scalar(keys %active_connections);
- syslog("LOG_DEBUG", "multi: inbound message on connection; $c total");
+ syslog("LOG_DEBUG", "multi: inbound message on connection $conn_id; $c total");
if ($kid_count >= $max_concurrent) {
# XXX should we say something to the client? maybe wait and try again?
$self->{state} = $self->{ils}->state() if (UNIVERSAL::can($self->{ils},'state'));
- # Evergreen, at least, needs a chance to clean up before forking for other requests
- # Note: This should not be necessary, w/ the child process exiting on completion
- #$self->{ils}->disconnect() if (UNIVERSAL::can($self->{ils},'disconnect'));
-
- # Stash the ILS module somewhere handy for later
- my $ils_ref = ref($self->{ils});
-
$cache_data->{success} = 1;
$cache_data->{net_server_parts} = {
map { ($_ => $$self{$_}) } qw/state institution account/
};
- $cache_data->{net_server_parts}{ils} = $ils_ref;
+
+ # Stash the ILS module somewhere handy for later
+ $cache_data->{net_server_parts}{ils} = ref($self->{ils});
+
} else {
$cache_data->{success} = 0;
}
} else { # waited too long, kid and pipe are gone
$active_connections{$conn_id}{worker_pipe} = IO::Pipe->new;
+ syslog('LOG_DEBUG', "multi: parent creating new pipe for existing connection");
my $pid = fork();
if (!defined($pid) or $pid < 0) {