*/
/*$Log: SimpleServer.xs,v $
-/*Revision 1.14 2002-03-05 00:34:13 mike
+/*Revision 1.15 2002-09-16 13:55:53 sondberg
+/*Added support for authentication into SimpleServer.
+/*
+/*Revision 1.14 2002/03/05 00:34:13 mike
/*Support for implementation_id (commented out until it's
/*in mainstream Yaz)
/*
/*char *name_ptr;
char *ver_ptr;*/
char *ptr;
+ char *user = NULL;
+ char *passwd = NULL;
dSP;
ENTER;
hv_store(href, "PEER_NAME", 9, newSVpv(q->peer_name, 0), 0);
hv_store(href, "HANDLE", 6, newSVsv(&sv_undef), 0);
hv_store(href, "PID", 3, newSViv(getpid()), 0);
+ if (q->auth) {
+ if (q->auth->which == Z_IdAuthentication_open) {
+ char *openpass = xstrdup (q->auth->u.open);
+ char *cp = strchr (openpass, '/');
+ if (cp) {
+ *cp = '\0';
+ user = nmem_strdup (odr_getmem (q->stream), openpass);
+ passwd = nmem_strdup (odr_getmem (q->stream), cp + 1);
+ }
+ xfree(openpass);
+ }
+ hv_store(href, "USER", 4, newSVpv(user, 0), 0);
+ hv_store(href, "PASS", 4, newSVpv(passwd, 0), 0);
+ }
PUSHMARK(sp);
$args->{IMP_VER} = "3.14159";
$args->{ERR_CODE} = 0;
$args->{HANDLE} = $session;
+ if (defined($args->{PASS}) && defined($args->{USER})) {
+ printf("Received USER/PASS=%s/%s\n", $args->{USER},$args->{PASS});
+ }
+
}
sub my_scan_handler {
## $Log: ztest.pl,v $
-## Revision 1.10 2001-08-30 13:15:11 sondberg
+## Revision 1.11 2002-09-16 13:55:53 sondberg
+## Added support for authentication into SimpleServer.
+##
+## Revision 1.10 2001/08/30 13:15:11 sondberg
## Corrected a memory leak, one more to go.
##
## Revision 1.9 2001/08/29 11:48:36 sondberg