Auth-Kokolores

 view release on metacpan or  search on metacpan

lib/Auth/Kokolores.pm  view on Meta::CPAN

}

sub post_configure_hook {
  my $self = shift;
  $self->{'plugins'}->init( $self );
  return;
}

sub post_bind_hook {
  my $self = shift;
  $self->_set_process_stat('master');
  $self->set_socket_permissions;
  return;
}

sub set_socket_permissions {
  my $self = shift;
  if( ! defined $self->{'socket_mode'} ) {
    return;
  }
  my $mode = oct($self->{'socket_mode'});

lib/Auth/Kokolores.pm  view on Meta::CPAN

  $self->log(2, sprintf('setting socket mode to: %o', $mode));
  chmod( $mode, $self->{'socket_path'} )
    or $self->log(1, 'could not change mode of socket: '.$!);
  
  return;
}

sub child_init_hook {
  my $self = shift;
  $self->{'plugins'}->child_init( $self );
  $self->_set_process_stat('virgin child');
  return;
}

sub child_finish_hook {
  my $self = shift;
  $self->{'plugins'}->shutdown( $self );
  return;
}

sub authenticate {

lib/Auth/Kokolores.pm  view on Meta::CPAN

}

sub process_request {
  my ( $self, $conn ) = @_;
  my $port = $conn->NS_port;
  $self->log(4, "accepted new client on port $port");

  my $protocol = $self->get_protocol_handler( $conn, $port );
  $protocol->init_connection;

  $self->_set_process_stat('waiting request');
  my $r = $protocol->read_request;

  $self->_set_process_stat('processing request');

  my $response;
  eval { $response = $self->process_kokolores_request( $r ); };
  if( $@ ) {
    $self->log(1, 'processing request failed: '.$@);
    return;
  }
  $protocol->write_response( $response );

  $protocol->shutdown_connection;
  $self->_set_process_stat('idle');
  return;
}

sub _set_process_stat {
  my ( $self, $stat ) = @_;
  $0 = $self->{'program_name'}.' ('.$stat.')';
}

1;



( run in 1.053 second using v1.01-cache-2.11-cpan-49f99fa48dc )