* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.135 2002-01-21 12:54:06 adam Exp $
+ * $Id: client.c,v 1.136 2002-01-23 22:40:36 adam Exp $
*/
#include <stdio.h>
static char ccl_fields[512] = "default.bib";
static char* esPackageName = 0;
static char* yazProxy = 0;
+static int kilobytes = 1024;
static char last_cmd[32] = "?";
static FILE *marcdump = 0;
ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_2);
ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_3);
- *req->maximumRecordSize = 1024*1024;
- *req->preferredMessageSize = 1024*1024;
+ *req->maximumRecordSize = 1024*kilobytes;
+ *req->preferredMessageSize = 1024*kilobytes;
req->idAuthentication = auth;
const char *octet_buf = (char*)r->u.octet_aligned->buf;
if (ent->value == VAL_TEXT_XML || ent->value == VAL_APPLICATION_XML ||
ent->value == VAL_HTML)
+ {
print_record((const unsigned char *) octet_buf,
r->u.octet_aligned->len);
+ }
+ else if (ent->value == VAL_POSTSCRIPT)
+ {
+ int size = r->u.octet_aligned->len;
+ if (size > 100)
+ size = 100;
+ print_record((const unsigned char *) octet_buf, size);
+ }
else
{
if (
char *arg;
int ret;
- while ((ret = options("c:a:m:v:p:u:", argv, argc, &arg)) != -2)
+ while ((ret = options("k:c:a:m:v:p:u:", argv, argc, &arg)) != -2)
{
switch (ret)
{
strcat (open_command, arg);
}
break;
+ case 'k':
+ kilobytes = atoi(arg);
+ break;
case 'm':
if (!(marcdump = fopen (arg, "a")))
{
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.125 2002-01-23 21:13:30 adam Exp $
+ * $Id: seshigh.c,v 1.126 2002-01-23 22:40:36 adam Exp $
*/
/*
#include <yaz/log.h>
#include <yaz/logrpn.h>
#include <yaz/statserv.h>
+#include <yaz/diagbib1.h>
#include <yaz/backend.h>
odr_malloc (assoc->encode, sizeof(*dr));
yaz_log(LOG_LOG, "[%d] %s %s%s", error, diagbib1_str(error),
- addinfo ? " -- " : "", addinfo ? addinfo : "", error);
+ addinfo ? " -- " : "", addinfo ? addinfo : "");
rec->which = Z_Records_NSD;
rec->u.nonSurrogateDiagnostic = dr;
dr->diagnosticSetId =
}
else /* too big entirely */
{
- yaz_log(LOG_DEBUG, "Record > maxrcdsz");
+ yaz_log(LOG_LOG, "Record > maxrcdsz this=%d max=%d", this_length, a->maximumRecordSize);
reclist->records[reclist->num_records] =
surrogatediagrec(a, freq.basename, 17, 0);
reclist->num_records++;
Z_ListEntries *ents = (Z_ListEntries *)
odr_malloc (assoc->encode, sizeof(*ents));
Z_DiagRecs *diagrecs_p = NULL;
- oident *attent;
oident *attset;
bend_scan_rr *bsrr = (bend_scan_rr *)
odr_malloc (assoc->encode, sizeof(*bsrr));
* Copyright (c) 1995-2002, Index Data.
* See the file LICENSE for details.
*
- * $Id: ztest.c,v 1.49 2002-01-21 12:54:06 adam Exp $
+ * $Id: ztest.c,v 1.50 2002-01-23 22:40:36 adam Exp $
*/
/*
char *cp;
r->errstring = 0;
r->last_in_set = 0;
- r->basename = "DUMMY";
+ r->basename = "Default";
r->output_format = r->request_format;
if (r->request_format == VAL_SUTRS)
{
return 0;
}
}
+ else if (r->request_format == VAL_POSTSCRIPT)
+ {
+ char fname[20];
+ FILE *f;
+ long size;
+
+ sprintf (fname, "part.%d.ps", r->number);
+ f = fopen(fname, "rb");
+ if (!f)
+ {
+ r->errcode = 13;
+ return 0;
+ }
+ fseek (f, 0L, SEEK_END);
+ size = ftell (f);
+ if (size <= 0 || size >= 5000000)
+ {
+ r->errcode = 14;
+ return 0;
+ }
+ fseek (f, 0L, SEEK_SET);
+ r->record = odr_malloc (r->stream, size);
+ r->len = size;
+ r->output_format = VAL_POSTSCRIPT;
+ fread (r->record, size, 1, f);
+ fclose (f);
+ }
else if ((cp = dummy_database_record(r->number, r->stream)))
{
r->len = strlen(cp);