projects
/
egate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
177cd18
)
Added auth.
author
Sebastian Hammer
<quinn@indexdata.com>
Wed, 19 Apr 1995 12:55:15 +0000
(12:55 +0000)
committer
Sebastian Hammer
<quinn@indexdata.com>
Wed, 19 Apr 1995 12:55:15 +0000
(12:55 +0000)
zlayer/zaccess-yaz.c
patch
|
blob
|
history
diff --git
a/zlayer/zaccess-yaz.c
b/zlayer/zaccess-yaz.c
index
62d3ef2
..
98e82b8
100644
(file)
--- a/
zlayer/zaccess-yaz.c
+++ b/
zlayer/zaccess-yaz.c
@@
-4,7
+4,10
@@
* Z39.50 API for the Email gateway - YAZ version
*
* $Log: zaccess-yaz.c,v $
* Z39.50 API for the Email gateway - YAZ version
*
* $Log: zaccess-yaz.c,v $
- * Revision 1.2 1995/04/19 09:24:02 quinn
+ * Revision 1.3 1995/04/19 12:55:15 quinn
+ * Added auth.
+ *
+ * Revision 1.2 1995/04/19 09:24:02 quinn
* Fixed bug in zass_open - variable initialized after use
*
* Revision 1.1 1995/04/17 11:26:53 quinn
* Fixed bug in zass_open - variable initialized after use
*
* Revision 1.1 1995/04/17 11:26:53 quinn
@@
-87,12
+90,13
@@
static int send_apdu(struct zass *z, Z_APDU *a)
return 0;
}
return 0;
}
-static int send_initreq(struct zass *p)
+static int send_initreq(struct zass *p, char *auth)
{
Z_APDU a;
Z_InitRequest init;
Odr_bitmask options, protocolVersion;
char name[512];
{
Z_APDU a;
Z_InitRequest init;
Odr_bitmask options, protocolVersion;
char name[512];
+ Z_IdAuthentication idauth;
a.which = Z_APDU_initRequest;
a.u.initRequest = &init;
a.which = Z_APDU_initRequest;
a.u.initRequest = &init;
@@
-108,7
+112,14
@@
static int send_initreq(struct zass *p)
ODR_MASK_SET(&protocolVersion, Z_ProtocolVersion_2);
init.preferredMessageSize = &p->preferredmessagesize;
init.maximumRecordSize = &p->maxrecordsize;
ODR_MASK_SET(&protocolVersion, Z_ProtocolVersion_2);
init.preferredMessageSize = &p->preferredmessagesize;
init.maximumRecordSize = &p->maxrecordsize;
- init.idAuthentication = 0;
+ if (!auth)
+ init.idAuthentication = 0;
+ else
+ {
+ init.idAuthentication = &idauth;
+ idauth.which = Z_IdAuthentication_open;
+ idauth.u.open = auth;
+ }
init.implementationId = ZASS_ID;
sprintf(name, "%s (YAZ protocol layer)", ZASS_NAME);
init.implementationName = name;
init.implementationId = ZASS_ID;
sprintf(name, "%s (YAZ protocol layer)", ZASS_NAME);
init.implementationName = name;
@@
-152,7
+163,7
@@
static int receive_initres(struct zass *p)
return 0;
}
return 0;
}
-ZASS zass_open(char *host, int port)
+ZASS zass_open(char *host, int port, char *auth)
{
struct zass *p;
char addstr[512];
{
struct zass *p;
char addstr[512];
@@
-198,7
+209,7
@@
ZASS zass_open(char *host, int port)
gw_log(ZASS_DEBUG, ZASS_TYPE, "connected ok");
p->inbuf = 0;
p->inbuflen = 0;
gw_log(ZASS_DEBUG, ZASS_TYPE, "connected ok");
p->inbuf = 0;
p->inbuflen = 0;
- if (send_initreq(p) < 0 || receive_initres(p) < 0)
+ if (send_initreq(p, auth) < 0 || receive_initres(p) < 0)
{
gw_log(GW_LOG_FATAL, ZASS_TYPE, "Failed to initialize");
return 0;
{
gw_log(GW_LOG_FATAL, ZASS_TYPE, "Failed to initialize");
return 0;