projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a567f55
)
Fixed some pointer errors
author
Sebastian Hammer
<quinn@indexdata.com>
Mon, 5 Feb 2007 16:35:18 +0000
(16:35 +0000)
committer
Sebastian Hammer
<quinn@indexdata.com>
Mon, 5 Feb 2007 16:35:18 +0000
(16:35 +0000)
src/http.c
patch
|
blob
|
history
diff --git
a/src/http.c
b/src/http.c
index
291f0d9
..
bc40aca
100644
(file)
--- a/
src/http.c
+++ b/
src/http.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: http.c,v 1.10 2007-02-05 16:15:41 quinn Exp $
+ * $Id: http.c,v 1.11 2007-02-05 16:35:18 quinn Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-734,8
+734,8
@@
static void proxy_io(IOCHAN pi, int event)
else
{
htbuf->buf[res] = '\0';
else
{
htbuf->buf[res] = '\0';
+ htbuf->offset = 0;
htbuf->len = res;
htbuf->len = res;
- int offset = 0;
if (pc->first_response) // Check if this is a redirect
{
int len;
if (pc->first_response) // Check if this is a redirect
{
int len;
@@
-752,8
+752,9
@@
static void proxy_io(IOCHAN pi, int event)
struct http_buf *buf;
h->value = sub_hostname(hc, h->value);
buf = http_serialize_response(hc, res);
struct http_buf *buf;
h->value = sub_hostname(hc, h->value);
buf = http_serialize_response(hc, res);
+ yaz_log(YLOG_LOG, "Proxy rewrite");
http_buf_enqueue(&hc->oqueue, buf);
http_buf_enqueue(&hc->oqueue, buf);
- offset = len;
+ htbuf->offset = len;
break;
}
}
break;
}
}
@@
-761,15
+762,8
@@
static void proxy_io(IOCHAN pi, int event)
pc->first_response = 0;
}
// Write any remaining payload
pc->first_response = 0;
}
// Write any remaining payload
- if (htbuf->len - offset > 0)
- {
- if (offset > 0)
- {
- memmove(htbuf->buf, htbuf->buf + offset, htbuf->len - offset);
- htbuf->len -= offset;
- }
- http_buf_enqueue(&hc->oqueue, htbuf + offset);
- }
+ if (htbuf->len - htbuf->offset > 0)
+ http_buf_enqueue(&hc->oqueue, htbuf);
}
iochan_setflag(hc->iochan, EVENT_OUTPUT);
break;
}
iochan_setflag(hc->iochan, EVENT_OUTPUT);
break;