static int stop = 0;
+/*
static int send_packet(const char *host)
{
char buf[PACKET_SIZE];
cs_close(cs);
return 0;
}
+*/
+/*
static void test_file(const char *fname)
{
Z_GDU *req;
int fd =open(fname, O_RDONLY, 0666);
if (fd == -1)
{
- yaz_log(LOG_ERRNO|LOG_FATAL, "open %s", fname);
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "open %s", fname);
exit (1);
}
while (off < sizeof(buf))
ssize_t rd;
rd = read(fd, buf+off, sizeof(buf)-off);
if (rd == -1) {
- yaz_log(LOG_ERRNO|LOG_FATAL, "read %s", fname);
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "read %s", fname);
exit (1);
}
if (rd == 0)
}
if (close(fd) == -1)
{
- yaz_log(LOG_ERRNO|LOG_FATAL, "close %s", fname);
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "close %s", fname);
exit (1);
}
odr_setbuf(odr, buf, off, 0);
odr_destroy(odr);
}
+*/
static void test_random(int run, const char *fname, const char *fname2,
int *estat)
char *mbuf;
ODR odr;
- nmem_init();
odr = odr_createmem(ODR_DECODE);
if (fname)
{
int fd =open(fname, O_TRUNC|O_CREAT|O_WRONLY, 0666);
if (fd == -1)
{
- yaz_log(LOG_ERRNO|LOG_FATAL, "open %s", fname);
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "open %s", fname);
exit (1);
}
while (sizeof(buf)-j-off > 0)
ssize_t wrote;
wrote = write(fd, buf+off+j, sizeof(buf)-j-off);
if (wrote <= 0) {
- yaz_log(LOG_ERRNO|LOG_FATAL, "write %s", fname);
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "write %s", fname);
exit (1);
}
off += wrote;
}
if (close(fd) == -1)
{
- yaz_log(LOG_ERRNO|LOG_FATAL, "close %s", fname);
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "close %s", fname);
exit (1);
}
}
free(mbuf);
odr_reset(odr);
odr_destroy(odr);
- nmem_exit();
}
if (dumpfile && dumpfile != stdout)
fclose(dumpfile);