/* This file is part of Pazpar2.
- Copyright (C) 2006-2011 Index Data
+ Copyright (C) 2006-2013 Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
long long id;
int sz, r, c;
char req[100];
+ char request_type[100];
size_t i;
struct con **conp;
c = fgetc(inf);
c = fgetc(inf);
}
req[i] = 0;
- r = sscanf(req, "%lld %lld %lld %d", &tv_sec1, &tv_usec1, &id, &sz);
- if (r != 4)
+ r = sscanf(req, "%s %lld %lld %lld %d", request_type,
+ &tv_sec1, &tv_usec1, &id, &sz);
+ if (r != 5)
{
fprintf(stderr, "bad line %s\n", req);
return -1;
}
else
spec.tv_usec = tv_usec1 - tv_usec0;
-
+
select(0, 0, 0, 0, &spec);
}
tv_sec0 = tv_sec1;
(long long) toread, (long long) r);
return -1;
}
- w = write((*conp)->fd, buf, toread);
- if (w != toread)
- {
- fprintf(stderr, "write truncated\n");
- return -1;
+ if (*request_type == 'r')
+ { /* Only deal with things tha Pazpar2 received */
+ w = write((*conp)->fd, buf, toread);
+ if (w != toread)
+ {
+ fprintf(stderr, "write truncated\n");
+ return -1;
+ }
}
cnt += toread;
}
hints.ai_addr = NULL;
hints.ai_canonname = NULL;
hints.ai_next = NULL;
-
+
cp = strchr(host, ':');
if (*cp)
{