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
More clean-up (remove util.c).
[pazpar2-moved-to-github.git]
/
src
/
http_command.c
diff --git
a/src/http_command.c
b/src/http_command.c
index
f9c5d42
..
0cb7442
100644
(file)
--- a/
src/http_command.c
+++ b/
src/http_command.c
@@
-33,8
+33,8
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <yaz/snprintf.h>
#include <yaz/yaz-util.h>
#include <yaz/snprintf.h>
#include <yaz/yaz-util.h>
-#include "util.h"
#include "eventl.h"
#include "eventl.h"
+#include "parameters.h"
#include "pazpar2.h"
#include "http.h"
#include "settings.h"
#include "pazpar2.h"
#include "http.h"
#include "settings.h"
@@
-75,7
+75,7
@@
struct http_session *http_session_create(struct conf_service *service)
session_list = r;
r->timeout_iochan = iochan_create(-1, session_timeout, 0);
iochan_setdata(r->timeout_iochan, r);
session_list = r;
r->timeout_iochan = iochan_create(-1, session_timeout, 0);
iochan_setdata(r->timeout_iochan, r);
- iochan_settimeout(r->timeout_iochan, global_parameters.session_timeout);
+ iochan_settimeout(r->timeout_iochan, service->session_timeout);
pazpar2_add_channel(r->timeout_iochan);
return r;
pazpar2_add_channel(r->timeout_iochan);
return r;
@@
-561,13
+561,14
@@
static void cmd_record(struct http_channel *c)
struct http_session *s = locate_session(rq, rs);
struct record_cluster *rec, *prev_r, *next_r;
struct record *r;
struct http_session *s = locate_session(rq, rs);
struct record_cluster *rec, *prev_r, *next_r;
struct record *r;
- struct conf_service *service = s->psession->service;
+ struct conf_service *service;
const char *idstr = http_argbyname(rq, "id");
const char *offsetstr = http_argbyname(rq, "offset");
const char *binarystr = http_argbyname(rq, "binary");
if (!s)
return;
const char *idstr = http_argbyname(rq, "id");
const char *offsetstr = http_argbyname(rq, "offset");
const char *binarystr = http_argbyname(rq, "binary");
if (!s)
return;
+ service = s->psession->service;
if (!idstr)
{
error(rs, PAZPAR2_MISSING_PARAMETER, "id");
if (!idstr)
{
error(rs, PAZPAR2_MISSING_PARAMETER, "id");
@@
-576,7
+577,11
@@
static void cmd_record(struct http_channel *c)
wrbuf_rewind(c->wrbuf);
if (!(rec = show_single(s->psession, idstr, &prev_r, &next_r)))
{
wrbuf_rewind(c->wrbuf);
if (!(rec = show_single(s->psession, idstr, &prev_r, &next_r)))
{
- if (session_set_watch(s->psession, SESSION_WATCH_RECORD,
+ if (session_active_clients(s->psession) == 0)
+ {
+ error(rs, PAZPAR2_RECORD_MISSING, idstr);
+ }
+ else if (session_set_watch(s->psession, SESSION_WATCH_RECORD,
cmd_record_ready, c, c) != 0)
{
error(rs, PAZPAR2_RECORD_MISSING, idstr);
cmd_record_ready, c, c) != 0)
{
error(rs, PAZPAR2_RECORD_MISSING, idstr);