check_pending_connections();
my $c = scalar(keys %active_connections);
- syslog("LOG_DEBUG", "multi: new active connection; $c total");
+ syslog("LOG_DEBUG", "multi: inbound message on connection; $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
- $self->{ils}->disconnect() if (UNIVERSAL::can($self->{ils},'disconnect'));
+ # 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
- $self->{ils} = ref($self->{ils});
+ my $ils_ref = ref($self->{ils});
$cache_data->{success} = 1;
$cache_data->{net_server_parts} = {
- map { ($_ => $$self{$_}) } qw/ils state institution account/
+ map { ($_ => $$self{$_}) } qw/state institution account/
};
+ $cache_data->{net_server_parts}{ils} = $ils_ref;
} else {
$cache_data->{success} = 0;
}
$self->{login_complete_called} = 1;
};
- syslog('LOG_DEBUG', "Child $$ / $conn_id kicking of login process");
+ syslog('LOG_DEBUG', "Child $$ / $conn_id kicking off login process");
eval { &$transport($self, $active_connections{$conn_id}{worker_pipe}) };
} else {
my $fh = $active_connections{$conn_id}{worker_pipe};
+ $fh->writer;
+ $fh->autoflush;
print $fh $$str_ref;
push(@pending_connections, $pid);
$kid_hash{$pid} = $conn_id;
$self = $active_connections{$conn_id}->{net_server};
if ($active_connections{$conn_id}{worker_pipe}) {
+ syslog('LOG_DEBUG', "multi: parent writing msg to existing child process");
my $fh = $active_connections{$conn_id}{worker_pipe};
print $fh $$str_ref;
} else { # in parent
$active_connections{$conn_id}{worker_pipe}->writer;
my $fh = $active_connections{$conn_id}{worker_pipe};
+ $fh->autoflush;
print $fh $$str_ref;
$kid_count++;
$kid_hash{$pid} = $conn_id;