adjust to changed VDP interface

parent 7aafb824
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
#include <stdio.h> #include <stdio.h>
#include "vtim.h" #include "vtim.h"
#define Debug(fmt, ...) printf(fmt, __VA_ARGS__) #define Debug(fmt, ...) printf(fmt, __VA_ARGS__)
#define VSLdbgv(req, fmt, ...) \ #define VSLdbgv(tng, fmt, ...) \
do { \ do { \
VSL(SLT_Debug, 0, "xid=%u t=%.6f " fmt, \ VSL(SLT_Debug, 0, "xid=%u t=%.6f " fmt, \
VXID(req->vsl->wid), VTIM_real(), __VA_ARGS__); \ VXID((tng)->vsl->wid), VTIM_real(), __VA_ARGS__); \
VSLb(req->vsl, SLT_Debug, fmt, __VA_ARGS__); \ VSLb((tng)->vsl, SLT_Debug, fmt, __VA_ARGS__); \
} while(0) } while(0)
#define VSLdbg(req, msg) \ #define VSLdbg(tng, msg) \
do { \ do { \
VSL(SLT_Debug, 0, "xid=%u t=%.6f " msg, \ VSL(SLT_Debug, 0, "xid=%u t=%.6f " msg, \
VXID(req->vsl->wid), VTIM_real()); \ VXID((tng)->vsl->wid), VTIM_real()); \
VSLb(req->vsl, SLT_Debug, msg); \ VSLb((tng)->vsl, SLT_Debug, msg); \
} while(0) } while(0)
#define VSL0dbg(...) VSL(SLT_Debug, 0, __VA_ARGS__) #define VSL0dbg(...) VSL(SLT_Debug, 0, __VA_ARGS__)
#else #else
#define VSLdbgv(req, fmt, ...) (void)0 #define VSLdbgv(tng, fmt, ...) (void)0
#define VSLdbg(req, msg) (void)0 #define VSLdbg(tng, msg) (void)0
#define VSL0dbg(...) (void)0 #define VSL0dbg(...) (void)0
#define Debug(fmt, ...) /**/ #define Debug(fmt, ...) /**/
#endif #endif
...@@ -77,7 +77,7 @@ vped_pretend_gzip_fini(struct req *req, void **priv) ...@@ -77,7 +77,7 @@ vped_pretend_gzip_fini(struct req *req, void **priv)
} }
static int v_matchproto_(vdp_bytes_f) static int v_matchproto_(vdp_bytes_f)
vped_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv, vped_pretend_gzip_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
const void *pv, ssize_t l) const void *pv, ssize_t l)
{ {
uint8_t buf1[5], buf2[5]; uint8_t buf1[5], buf2[5];
...@@ -85,11 +85,12 @@ vped_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -85,11 +85,12 @@ vped_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv,
uint16_t lx; uint16_t lx;
struct nexus_gzip *gz; struct nexus_gzip *gz;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(vdx, VDP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vdx->req, REQ_MAGIC);
CAST_OBJ_NOTNULL(gz, *priv, NEXUS_GZIP_MAGIC); CAST_OBJ_NOTNULL(gz, *priv, NEXUS_GZIP_MAGIC);
if (l == 0) if (l == 0)
return (VDP_bytes(req, act, pv, l)); return (VDP_bytes(vdx, act, pv, l));
p = pv; p = pv;
...@@ -105,23 +106,23 @@ vped_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -105,23 +106,23 @@ vped_pretend_gzip_bytes(struct req *req, enum vdp_action act, void **priv,
while (l > 0) { while (l > 0) {
if (l >= 65535) { if (l >= 65535) {
lx = 65535; lx = 65535;
if (VDP_bytes(req, VDP_NULL, buf1, sizeof buf1)) if (VDP_bytes(vdx, VDP_NULL, buf1, sizeof buf1))
return (-1); return (-1);
} else { } else {
lx = (uint16_t)l; lx = (uint16_t)l;
buf2[0] = 0; buf2[0] = 0;
vle16enc(buf2 + 1, lx); vle16enc(buf2 + 1, lx);
vle16enc(buf2 + 3, ~lx); vle16enc(buf2 + 3, ~lx);
if (VDP_bytes(req, VDP_NULL, buf2, sizeof buf2)) if (VDP_bytes(vdx, VDP_NULL, buf2, sizeof buf2))
return (-1); return (-1);
} }
if (VDP_bytes(req, VDP_NULL, p, lx)) if (VDP_bytes(vdx, VDP_NULL, p, lx))
return (-1); return (-1);
l -= lx; l -= lx;
p += lx; p += lx;
} }
/* buf1 & buf2 is local, have to flush */ /* buf1 & buf2 is local, have to flush */
return (VDP_bytes(req, VDP_FLUSH, NULL, 0)); return (VDP_bytes(vdx, VDP_FLUSH, NULL, 0));
} }
const struct vdp vped_pretend_gz = { const struct vdp vped_pretend_gz = {
...@@ -179,7 +180,7 @@ vped_gzgz_init(struct req *req, void **priv) ...@@ -179,7 +180,7 @@ vped_gzgz_init(struct req *req, void **priv)
* thus we need to flush at the end of each call * thus we need to flush at the end of each call
*/ */
static int v_matchproto_(vdp_bytes_f) static int v_matchproto_(vdp_bytes_f)
vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv, vped_gzgz_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
const void *ptr, ssize_t len) const void *ptr, ssize_t len)
{ {
struct vped_gzgz_priv *foo; struct vped_gzgz_priv *foo;
...@@ -207,7 +208,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -207,7 +208,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
if (dl > 0) { if (dl > 0) {
if (dl > len) if (dl > len)
dl = len; dl = len;
if (VDP_bytes(req, act, pp, dl)) if (VDP_bytes(vdx, act, pp, dl))
return(-1); return(-1);
foo->ll += dl; foo->ll += dl;
len -= dl; len -= dl;
...@@ -218,7 +219,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -218,7 +219,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
/* Remove the "LAST" bit */ /* Remove the "LAST" bit */
foo->dbits[0] = *pp; foo->dbits[0] = *pp;
foo->dbits[0] &= ~(1U << (foo->last & 7)); foo->dbits[0] &= ~(1U << (foo->last & 7));
if (VDP_bytes(req, VDP_NULL, foo->dbits, 1)) if (VDP_bytes(vdx, VDP_NULL, foo->dbits, 1))
return (-1); return (-1);
foo->ll++; foo->ll++;
len--; len--;
...@@ -230,7 +231,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -230,7 +231,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
if (dl > 0) { if (dl > 0) {
if (dl > len) if (dl > len)
dl = len; dl = len;
if (VDP_bytes(req, act, pp, dl)) if (VDP_bytes(vdx, act, pp, dl))
return (-1); return (-1);
foo->ll += dl; foo->ll += dl;
len -= dl; len -= dl;
...@@ -292,7 +293,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -292,7 +293,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
default: default:
WRONG("compiler must be broken"); WRONG("compiler must be broken");
} }
if (VDP_bytes(req, VDP_NULL, foo->dbits + 1, foo->lpad)) if (VDP_bytes(vdx, VDP_NULL, foo->dbits + 1, foo->lpad))
return (-1); return (-1);
} }
if (len > 0) { if (len > 0) {
...@@ -313,7 +314,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -313,7 +314,7 @@ vped_gzgz_bytes(struct req *req, enum vdp_action act, void **priv,
} }
} }
assert(len == 0); assert(len == 0);
return (VDP_bytes(req, VDP_FLUSH, NULL, 0)); return (VDP_bytes(vdx, VDP_FLUSH, NULL, 0));
} }
static int v_matchproto_(vdp_fini_f) static int v_matchproto_(vdp_fini_f)
......
/*- /*-
* Copyright 2019 UPLEX Nils Goroll Systemoptimierung * Copyright 2019-2020 UPLEX Nils Goroll Systemoptimierung
* All rights reserved * All rights reserved
* *
* Authors: Geoffrey Simmons <geoffrey.simmons@uplex.de> * Authors: Geoffrey Simmons <geoffrey.simmons@uplex.de>
...@@ -49,7 +49,7 @@ req_fini(struct req **reqp, struct worker *wrk) ...@@ -49,7 +49,7 @@ req_fini(struct req **reqp, struct worker *wrk)
VSLdbg(req, "req_fini called"); VSLdbg(req, "req_fini called");
VDP_close(req); req->acct.resp_bodybytes += VDP_Close(req);
Req_Cleanup(req->sp, wrk, req); Req_Cleanup(req->sp, wrk, req);
Req_Release(req); Req_Release(req);
} }
This diff is collapsed.
...@@ -269,9 +269,9 @@ void set_closed(struct bytes_tree *, struct node *, const struct worker *); ...@@ -269,9 +269,9 @@ void set_closed(struct bytes_tree *, struct node *, const struct worker *);
//-------------- //--------------
void tree_prune(struct req *, struct node *); void tree_prune(struct vdp_ctx *, struct node *);
void tree_free(struct req *, struct node *); void tree_free(struct vdp_ctx *, struct node *);
//-------------- //--------------
void tree_deliver(struct req *, struct bytes_tree *); void tree_deliver(struct vdp_ctx *, struct bytes_tree *);
...@@ -101,15 +101,16 @@ vped_to_parent_fini(struct req *req, void **priv) ...@@ -101,15 +101,16 @@ vped_to_parent_fini(struct req *req, void **priv)
} }
static int v_matchproto_(vdp_bytes_f) static int v_matchproto_(vdp_bytes_f)
vped_to_parent_bytes(struct req *req, enum vdp_action act, void **priv, vped_to_parent_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
const void *ptr, ssize_t len) const void *ptr, ssize_t len)
{ {
struct req *preq; struct req *preq;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(vdx, VDP_CTX_MAGIC);
CAST_OBJ_NOTNULL(preq, *priv, REQ_MAGIC); CAST_OBJ_NOTNULL(preq, *priv, REQ_MAGIC);
req->acct.resp_bodybytes += len; if (act == VDP_END)
return (VDP_bytes(preq, act, ptr, len)); act = VDP_FLUSH;
return (VDP_bytes(preq->vdc, act, ptr, len));
} }
static const struct vdp vped_to_parent = { static const struct vdp vped_to_parent = {
...@@ -256,7 +257,7 @@ vped_task(struct worker *wrk, void *priv) ...@@ -256,7 +257,7 @@ vped_task(struct worker *wrk, void *priv)
*/ */
// finish the request // finish the request
VDP_close(req); (void) VDP_Close(req);
if (req->transport_priv != NULL) if (req->transport_priv != NULL)
assert(req->transport_priv == pesi); assert(req->transport_priv == pesi);
...@@ -494,9 +495,10 @@ pesi_buf_fini(struct req *req, void **priv) ...@@ -494,9 +495,10 @@ pesi_buf_fini(struct req *req, void **priv)
} }
static int v_matchproto_(vdp_bytes_f) static int v_matchproto_(vdp_bytes_f)
pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv, pesi_buf_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
const void *ptr, ssize_t len) const void *ptr, ssize_t len)
{ {
struct req *req;
struct bytes_tree *tree; struct bytes_tree *tree;
struct node *node, *parent; struct node *node, *parent;
struct pesi *pesi; struct pesi *pesi;
...@@ -510,17 +512,19 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -510,17 +512,19 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
if (tree->retval || ptr == NULL || len == 0) if (tree->retval || ptr == NULL || len == 0)
return (tree->retval); return (tree->retval);
CHECK_OBJ_NOTNULL(vdx, VDP_CTX_MAGIC);
req = vdx->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
parent = pesi->node; parent = pesi->node;
CHECK_OBJ_NOTNULL(parent, NODE_MAGIC); CHECK_OBJ_NOTNULL(parent, NODE_MAGIC);
assert(parent->type == T_NEXUS); assert(parent->type == T_NEXUS);
VSLdbgv(req, "bytes_add: parent=%p front=%p", VSLdbgv(vdx, "bytes_add: parent=%p front=%p",
parent, tree->front); parent, tree->front);
assert(req == parent->nexus.req); assert(req == parent->nexus.req);
VSLdbg(req, "bytes_add: adding data to node"); VSLdbg(vdx, "bytes_add: adding data to node");
node = node_alloc(pesi); node = node_alloc(pesi);
CHECK_OBJ_NOTNULL(node, NODE_MAGIC); CHECK_OBJ_NOTNULL(node, NODE_MAGIC);
...@@ -555,17 +559,17 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -555,17 +559,17 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
AN(ptr); AN(ptr);
AZ(node->data.ptr); AZ(node->data.ptr);
if (refok) { if (refok) {
VSLdbg(req, "bytes_add: stv ref"); VSLdbg(vdx, "bytes_add: stv ref");
node->data.ptr = ptr; node->data.ptr = ptr;
} }
else { else {
VSLdbg(req, "bytes_add: allocating from transient"); VSLdbg(vdx, "bytes_add: allocating from transient");
node->data.st = stv_transient->sml_alloc(stv_transient, len); node->data.st = stv_transient->sml_alloc(stv_transient, len);
if (node->data.st == NULL) { if (node->data.st == NULL) {
VSLb(req->vsl, SLT_Error, "Cannot allocate transient " VSLb(vdx->vsl, SLT_Error, "Cannot allocate transient "
"storage to buffer response data while waiting " "storage to buffer response data while waiting "
"for parallel ESI"); "for parallel ESI");
VSLdbg(req, "bytes_add: exit after transient alloc " VSLdbg(vdx, "bytes_add: exit after transient alloc "
"failure"); "failure");
Lck_Lock(&tree->tree_lock); Lck_Lock(&tree->tree_lock);
...@@ -601,21 +605,21 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -601,21 +605,21 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
(tree->front->parent == NULL || (tree->front->parent == NULL ||
tree->front == parent || tree->front == parent ||
tree->front->parent == parent || tree->front->parent == parent ||
tree->front_owner == req->wrk)) { tree->front_owner == vdx->wrk)) {
VSLdbg(req, "front push"); VSLdbg(vdx, "front push");
// XXX for this node, we can spare buffering if got pushed // XXX for this node, we can spare buffering if got pushed
// XXX double locking with node_insert // XXX double locking with node_insert
Lck_Lock(&tree->tree_lock); Lck_Lock(&tree->tree_lock);
if (parent->state == ST_PRIVATE) if (parent->state == ST_PRIVATE)
set_open(tree, parent, req->wrk); set_open(tree, parent, vdx->wrk);
assert(parent->state = ST_OPEN); assert(parent->state = ST_OPEN);
tree_deliver(req, tree); tree_deliver(vdx, tree);
Lck_Unlock(&tree->tree_lock); Lck_Unlock(&tree->tree_lock);
} }
VSLdbgv(req, "bytes_add to %s parent: exit", VSLdbgv(vdx, "bytes_add to %s parent: exit",
parent->state == ST_PRIVATE ? "private" : "open"); parent->state == ST_PRIVATE ? "private" : "open");
return (tree->retval); return (tree->retval);
...@@ -820,7 +824,7 @@ vdp_pesi_fini(struct req *req, void **priv) ...@@ -820,7 +824,7 @@ vdp_pesi_fini(struct req *req, void **priv)
* *
* we likely need more error handling * we likely need more error handling
*/ */
tree_prune(req, bytes_tree->root); tree_prune(req->vdc, bytes_tree->root);
AZ(pesi_tree->task_running); AZ(pesi_tree->task_running);
assert(VTAILQ_EMPTY(&pesi_tree->task_head)); assert(VTAILQ_EMPTY(&pesi_tree->task_head));
...@@ -830,7 +834,7 @@ vdp_pesi_fini(struct req *req, void **priv) ...@@ -830,7 +834,7 @@ vdp_pesi_fini(struct req *req, void **priv)
Lck_Delete(&bytes_tree->tree_lock); Lck_Delete(&bytes_tree->tree_lock);
AZ(pthread_cond_destroy(&bytes_tree->cond)); AZ(pthread_cond_destroy(&bytes_tree->cond));
tree_free(req, bytes_tree->root); tree_free(req->vdc, bytes_tree->root);
*priv = NULL; *priv = NULL;
return (0); return (0);
...@@ -867,9 +871,10 @@ vped_decode_len(struct req *req, const uint8_t **pp) ...@@ -867,9 +871,10 @@ vped_decode_len(struct req *req, const uint8_t **pp)
} }
static int v_matchproto_(vdp_bytes_f) static int v_matchproto_(vdp_bytes_f)
vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv, vdp_pesi_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv,
const void *ptr, ssize_t len) const void *ptr, ssize_t len)
{ {
struct req *req;
uint8_t *q, *r; uint8_t *q, *r;
ssize_t l = 0; ssize_t l = 0;
const uint8_t *pp; const uint8_t *pp;
...@@ -880,6 +885,10 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -880,6 +885,10 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
struct node *node, *child = NULL; struct node *node, *child = NULL;
int retval = 0, parallel; int retval = 0, parallel;
CHECK_OBJ_NOTNULL(vdx, VDP_CTX_MAGIC);
req = vdx->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
AN(priv); AN(priv);
CAST_OBJ_NOTNULL(pesi, *priv, PESI_MAGIC); CAST_OBJ_NOTNULL(pesi, *priv, PESI_MAGIC);
CHECK_OBJ_NOTNULL(pesi->pecx, PECX_MAGIC); CHECK_OBJ_NOTNULL(pesi->pecx, PECX_MAGIC);
...@@ -1005,20 +1014,20 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -1005,20 +1014,20 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
node_insert(tree, node, child); node_insert(tree, node, child);
VSLdbg(req, "vped_vdp: call vped_include"); VSLdbg(vdx, "vped_vdp: call vped_include");
parallel = parallel =
vped_include(req, (const char*)q, vped_include(req, (const char*)q,
(const char*)pecx->p, (const char*)pecx->p,
pesi, child); pesi, child);
child = NULL; child = NULL;
VSLdbgv(req, "vped_vdp: vped_include()=%d", VSLdbgv(vdx, "vped_vdp: vped_include()=%d",
parallel); parallel);
assert(parallel >= 0); assert(parallel >= 0);
Debug("INCL [%s][%s] END\n", q, pecx->p); Debug("INCL [%s][%s] END\n", q, pecx->p);
pecx->p = r + 1; pecx->p = r + 1;
break; break;
default: default:
VSLb(req->vsl, SLT_Error, VSLb(vdx->vsl, SLT_Error,
"ESI corruption line %d 0x%02x [%s]\n", "ESI corruption line %d 0x%02x [%s]\n",
__LINE__, *pecx->p, pecx->p); __LINE__, *pecx->p, pecx->p);
WRONG("ESI-codes: Illegal code"); WRONG("ESI-codes: Illegal code");
...@@ -1046,17 +1055,17 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -1046,17 +1055,17 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
* in the same storage segment, so loop over storage * in the same storage segment, so loop over storage
* until we have processed them all. * until we have processed them all.
*/ */
VSLdbgv(req, "vped_vdp: pecx->state=%d", pecx->state); VSLdbgv(vdx, "vped_vdp: pecx->state=%d", pecx->state);
if (pecx->l <= len) { if (pecx->l <= len) {
if (pecx->state == 3) if (pecx->state == 3)
retval = VDP_bytes(req, act, pp, pecx->l); retval = VDP_bytes(vdx, act, pp, pecx->l);
len -= pecx->l; len -= pecx->l;
pp += pecx->l; pp += pecx->l;
pecx->state = 1; pecx->state = 1;
break; break;
} }
if (pecx->state == 3 && len > 0) if (pecx->state == 3 && len > 0)
retval = VDP_bytes(req, act, pp, len); retval = VDP_bytes(vdx, act, pp, len);
pecx->l -= len; pecx->l -= len;
return (tree->retval); return (tree->retval);
case 99: case 99:
...@@ -1079,17 +1088,17 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv, ...@@ -1079,17 +1088,17 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
vped_close_vdp(req, 1, &VDP_pesi_buf); vped_close_vdp(req, 1, &VDP_pesi_buf);
assert_vdp_next_not(req, &VDP_pesi); assert_vdp_next_not(req, &VDP_pesi);
tree_deliver(req, tree); tree_deliver(vdx, tree);
while (!tree->retval while (!tree->retval
&& (tree->root->state < ST_DELIVERED || && (tree->root->state < ST_DELIVERED ||
tree->npending > 0)) { tree->npending > 0)) {
VSLdbgv(req, "vdp_pesi_bytes: waiting - " VSLdbgv(vdx, "vdp_pesi_bytes: waiting - "
"state=%d npending=%d", "state=%d npending=%d",
tree->root->state, tree->root->state,
tree->npending); tree->npending);
AZ(Lck_CondWait(&tree->cond, AZ(Lck_CondWait(&tree->cond,
&tree->tree_lock, 0)); &tree->tree_lock, 0));
tree_deliver(req, tree); tree_deliver(vdx, tree);
} }
Lck_Unlock(&tree->tree_lock); Lck_Unlock(&tree->tree_lock);
...@@ -1252,14 +1261,14 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1252,14 +1261,14 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
assert(parent->type == T_NEXUS); assert(parent->type == T_NEXUS);
if (wantbody == 0) { if (wantbody == 0) {
VDP_close(req); (void) VDP_Close(req);
return; return;
} }
VSLdbgv(req, "vped_deliver: ObjGetLen=%lu", VSLdbgv(req, "vped_deliver: ObjGetLen=%lu",
ObjGetLen(req->wrk, req->objcore)); ObjGetLen(req->wrk, req->objcore));
if (boc == NULL && ObjGetLen(req->wrk, req->objcore) == 0) { if (boc == NULL && ObjGetLen(req->wrk, req->objcore) == 0) {
VDP_close(req); (void) VDP_Close(req);
return; return;
} }
...@@ -1277,7 +1286,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1277,7 +1286,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
if (req->objcore->flags & OC_F_FAILED) { if (req->objcore->flags & OC_F_FAILED) {
/* No way of signalling errors in the middle of /* No way of signalling errors in the middle of
the ESI body. Omit this ESI fragment. */ the ESI body. Omit this ESI fragment. */
VDP_close(req); (void) VDP_Close(req);
return; return;
} }
...@@ -1285,7 +1294,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1285,7 +1294,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
if (vgzgz == NULL) { if (vgzgz == NULL) {
VSLb(req->vsl, SLT_Error, VSLb(req->vsl, SLT_Error,
"Insufficient workspace for ESI gzip data"); "Insufficient workspace for ESI gzip data");
VDP_close(req); (void) VDP_Close(req);
return; return;
} }
INIT_OBJ(vgzgz, VPED_GZGZ_PRIV_MAGIC); INIT_OBJ(vgzgz, VPED_GZGZ_PRIV_MAGIC);
...@@ -1373,7 +1382,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1373,7 +1382,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
(void)VDP_DeliverObj(req); (void)VDP_DeliverObj(req);
VDP_close(req); req->acct.resp_bodybytes += VDP_Close(req);
node->final.fi_state = FI_DONE; node->final.fi_state = FI_DONE;
AZ(pthread_cond_signal(&node->final.fi_cond)); AZ(pthread_cond_signal(&node->final.fi_cond));
...@@ -1406,7 +1415,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1406,7 +1415,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
/* /*
* to be done in the other thread: * to be done in the other thread:
* - VDP_DeliverObj() * - VDP_DeliverObj()
* - VDP_close() * - VDP_Close()
* *
* from vped_task(): * from vped_task():
* - req_fini() * - req_fini()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment