[freeside-commits] freeside/fs_selfservice/FS-SelfService
SelfService.pm, 1.23, 1.24
Ivan,,,
ivan at wavetail.420.am
Sun Nov 5 09:36:11 PST 2006
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService
In directory wavetail:/tmp/cvs-serv31014
Modified Files:
SelfService.pm
Log Message:
add some self-service debugging
Index: SelfService.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/SelfService.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- SelfService.pm 17 Oct 2006 05:49:17 -0000 1.23
+++ SelfService.pm 5 Nov 2006 17:36:09 -0000 1.24
@@ -1,7 +1,7 @@
package FS::SelfService;
use strict;
-use vars qw($VERSION @ISA @EXPORT_OK $dir $socket %autoload $tag);
+use vars qw($VERSION @ISA @EXPORT_OK $DEBUG $dir $socket %autoload $tag);
use Exporter;
use Socket;
use FileHandle;
@@ -13,6 +13,8 @@
@ISA = qw( Exporter );
+$DEBUG = 0;
+
$dir = "/usr/local/freeside";
$socket = "$dir/selfservice_socket";
$socket .= '.'.$tag if defined $tag && length($tag);
@@ -91,6 +93,8 @@
sub simple_packet {
my $packet = shift;
+ warn "sending ". $packet->{_packet}. " to server"
+ if $DEBUG;
socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
connect(SOCK, sockaddr_un($socket)) or die "connect to $socket: $!";
nstore_fd($packet, \*SOCK) or die "can't send packet: $!";
@@ -102,9 +106,16 @@
# my $w = new IO::Select;
# $w->add(\*SOCK);
# my @wait = $w->can_read;
+
+ warn "reading message from server"
+ if $DEBUG;
+
my $return = fd_retrieve(\*SOCK) or die "error reading result: $!";
die $return->{'_error'} if defined $return->{_error} && $return->{_error};
+ warn "returning message to client"
+ if $DEBUG;
+
$return;
}
More information about the freeside-commits
mailing list