projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Automaked pazpar2. Bug #799. Preprocessor defines are put in cconfig.h and
[pazpar2-moved-to-github.git]
/
src
/
pazpar2.c
diff --git
a/src/pazpar2.c
b/src/pazpar2.c
index
cb6a384
..
18d0f0a
100644
(file)
--- a/
src/pazpar2.c
+++ b/
src/pazpar2.c
@@
-1,4
+1,4
@@
-/* $Id: pazpar2.c,v 1.15 2007-01-05 20:33:05 adam Exp $ */;
+/* $Id: pazpar2.c,v 1.18 2007-01-08 12:43:41 adam Exp $ */;
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
@@
-20,6
+20,10
@@
#include <yaz/yaz-util.h>
#include <yaz/nmem.h>
#include <yaz/yaz-util.h>
#include <yaz/nmem.h>
+#if HAVE_CONFIG_H
+#include "cconfig.h"
+#endif
+
#define USE_TIMING 0
#if USE_TIMING
#include <yaz/timing.h>
#define USE_TIMING 0
#if USE_TIMING
#include <yaz/timing.h>
@@
-27,14
+31,12
@@
#include "pazpar2.h"
#include "eventl.h"
#include "pazpar2.h"
#include "eventl.h"
-#include "command.h"
#include "http.h"
#include "termlists.h"
#include "reclists.h"
#include "relevance.h"
#include "config.h"
#include "http.h"
#include "termlists.h"
#include "reclists.h"
#include "relevance.h"
#include "config.h"
-#define PAZPAR2_VERSION "0.1"
#define MAX_CHUNK 15
static void client_fatal(struct client *cl);
#define MAX_CHUNK 15
static void client_fatal(struct client *cl);
@@
-71,7
+73,7
@@
struct parameters global_parameters =
30,
"81",
"Index Data PazPar2 (MasterKey)",
30,
"81",
"Index Data PazPar2 (MasterKey)",
- PAZPAR2_VERSION,
+ VERSION,
600, // 10 minutes
60,
100,
600, // 10 minutes
60,
100,
@@
-199,6
+201,8
@@
static void send_present(IOCHAN i)
int start = cl->records + 1;
toget = global_parameters.chunk;
int start = cl->records + 1;
toget = global_parameters.chunk;
+ if (toget > global_parameters.toget - cl->records)
+ toget = global_parameters.toget - cl->records;
if (toget > cl->hits - cl->records)
toget = cl->hits - cl->records;
if (toget > cl->hits - cl->records)
toget = cl->hits - cl->records;
@@
-1273,17
+1277,13
@@
int main(int argc, char **argv)
yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);
yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);
- while ((ret = options("f:x:c:h:p:C:s:d", argv, argc, &arg)) != -2)
+ while ((ret = options("f:x:h:p:C:s:d", argv, argc, &arg)) != -2)
{
switch (ret) {
case 'f':
if (!read_config(arg))
exit(1);
break;
{
switch (ret) {
case 'f':
if (!read_config(arg))
exit(1);
break;
- case 'c':
- command_init(atoi(arg));
- setport++;
- break;
case 'h':
http_init(arg);
setport++;
case 'h':
http_init(arg);
setport++;
@@
-1304,7
+1304,6
@@
int main(int argc, char **argv)
fprintf(stderr, "Usage: pazpar2\n"
" -f configfile\n"
" -h [host:]port (REST protocol listener)\n"
fprintf(stderr, "Usage: pazpar2\n"
" -f configfile\n"
" -h [host:]port (REST protocol listener)\n"
- " -c cmdport (telnet-style)\n"
" -C cclconfig\n"
" -s simpletargetfile\n"
" -p hostname[:portno] (HTTP proxy)\n");
" -C cclconfig\n"
" -s simpletargetfile\n"
" -p hostname[:portno] (HTTP proxy)\n");
@@
-1314,7
+1313,7
@@
int main(int argc, char **argv)
if (!setport)
{
if (!setport)
{
- fprintf(stderr, "Set command port with -h or -c\n");
+ fprintf(stderr, "Set command port with -h\n");
exit(1);
}
exit(1);
}