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
Merge branch 'protocol-version2' of ssh://git.indexdata.com/home/git/pub/pazpar2...
[pazpar2-moved-to-github.git]
/
src
/
http.c
diff --git
a/src/http.c
b/src/http.c
index
2df1706
..
c0f9596
100644
(file)
--- a/
src/http.c
+++ b/
src/http.c
@@
-1,5
+1,5
@@
/* This file is part of Pazpar2.
/* This file is part of Pazpar2.
- Copyright (C) 2006-2011 Index Data
+ Copyright (C) 2006-2012 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
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
@@
-70,6
+70,7
@@
typedef int socklen_t;
#include "ppmutex.h"
#include "session.h"
#include "http.h"
#include "ppmutex.h"
#include "session.h"
#include "http.h"
+#include "parameters.h"
#define MAX_HTTP_HEADER 4096
#define MAX_HTTP_HEADER 4096
@@
-649,6
+650,12
@@
static struct http_buf *http_serialize_response(struct http_channel *c,
if (r->payload)
wrbuf_puts(c->wrbuf, r->payload);
if (r->payload)
wrbuf_puts(c->wrbuf, r->payload);
+ if (global_parameters.dump_records > 1)
+ {
+ FILE *lf = yaz_log_file();
+ yaz_log(YLOG_LOG, "Response:");
+ fwrite(wrbuf_buf(c->wrbuf), 1, wrbuf_len(c->wrbuf), lf);
+ }
return http_buf_bywrbuf(c->http_server, c->wrbuf);
}
return http_buf_bywrbuf(c->http_server, c->wrbuf);
}
@@
-926,6
+933,7
@@
static void http_io(IOCHAN i, int event)
(long long) iochan_getfd(i), sz);
for (hb = hc->iqueue; hb; hb = hb->next)
fwrite(hb->buf, 1, hb->len, hc->http_server->record_file);
(long long) iochan_getfd(i), sz);
for (hb = hc->iqueue; hb; hb = hb->next)
fwrite(hb->buf, 1, hb->len, hc->http_server->record_file);
+ fflush(hc->http_server->record_file);
}
#endif
if (!(hc->request = http_parse_request(hc, &hc->iqueue, reqlen)))
}
#endif
if (!(hc->request = http_parse_request(hc, &hc->iqueue, reqlen)))
@@
-979,6
+987,8
@@
static void http_io(IOCHAN i, int event)
(long long) iochan_getfd(i), sz);
fwrite(wb->buf, 1, wb->offset + wb->len,
hc->http_server->record_file);
(long long) iochan_getfd(i), sz);
fwrite(wb->buf, 1, wb->offset + wb->len,
hc->http_server->record_file);
+ fputc('\n', hc->http_server->record_file);
+ fflush(hc->http_server->record_file);
}
#endif
hc->oqueue = hc->oqueue->next;
}
#endif
hc->oqueue = hc->oqueue->next;
@@
-1094,6
+1104,7
@@
static void proxy_io(IOCHAN pi, int event)
default:
yaz_log(YLOG_WARN, "Unexpected event on connection");
http_channel_destroy(hc->iochan);
default:
yaz_log(YLOG_WARN, "Unexpected event on connection");
http_channel_destroy(hc->iochan);
+ break;
}
}
}
}