* Sebastian Hammer, Adam Dickmeiss
*
* $Log: seshigh.c,v $
- * Revision 1.24 1995-05-16 08:51:04 quinn
+ * Revision 1.25 1995-05-17 08:42:26 quinn
+ * Transfer auth info to backend. Allow backend to reject init gracefully.
+ *
+ * Revision 1.24 1995/05/16 08:51:04 quinn
* License, documentation, and memory fixes
*
* Revision 1.23 1995/05/15 13:25:10 quinn
new->input_buffer = 0;
new->input_buffer_len = 0;
new->backend = 0;
+ new->rejected = 0;
request_initq(&new->incoming);
request_initq(&new->outgoing);
if (cs_getproto(link) == CS_Z3950)
{
logf(LOG_DEBUG, "ir_session (input)");
assert(assoc && conn);
+ if (assoc->rejected)
+ {
+ logf(LOG_LOG, "Closed connection after reject");
+ cs_close(conn);
+ destroy_association(assoc);
+ iochan_destroy(h);
+ return;
+ }
if ((res = cs_get(conn, &assoc->input_buffer,
&assoc->input_buffer_len)) <= 0)
{
logf(LOG_LOG, "Version: %s", req->implementationVersion);
binitreq.configname = "default-config";
- if (!(binitres = bend_init(&binitreq)) || binitres->errcode)
+ binitreq.auth = req->idAuthentication;
+ if (!(binitres = bend_init(&binitreq)))
{
- logf(LOG_WARN, "Negative response from backend");
+ logf(LOG_WARN, "Bad response from backend.");
return 0;
}
resp.implementationName = "Index Data/YAZ Generic Frontend Server";
resp.implementationVersion = YAZ_VERSION;
resp.userInformationField = 0;
+ if (binitres->errcode)
+ {
+ logf(LOG_LOG, "Connection rejected by backend.");
+ result = 0;
+ assoc->rejected = 1;
+ }
return &apdu;
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: session.h,v $
- * Revision 1.7 1995-05-16 08:51:08 quinn
+ * Revision 1.8 1995-05-17 08:42:28 quinn
+ * Transfer auth info to backend. Allow backend to reject init gracefully.
+ *
+ * Revision 1.7 1995/05/16 08:51:08 quinn
* License, documentation, and memory fixes
*
* Revision 1.6 1995/05/15 11:56:41 quinn
void *backend; /* backend handle */
request_q incoming; /* Q of incoming PDUs */
request_q outgoing; /* Q of outgoing data buffers (enc. PDUs) */
+ int rejected; /* session rejected */
/* session parameters */
int preferredMessageSize;