VBE_DropRefLocked(vc->backend);
CHECK_OBJ_NOTNULL(bp, BACKEND_MAGIC);
}
-
-/* Update health ----------------------------------------------------*/
-/* See cache_backend_random.c and/or cache_backend_round_robin.c for
- * details and comments about this function.
- */
-void
-VBE_UpdateHealth(const struct sess *sp, const struct vbe_conn *vc, int a)
-{
- (void)sp;
- (void)vc;
- (void)a;
-#if 0
- INCOMPL();
- struct backend *b;
-
- if (vc != NULL) {
- CHECK_OBJ_NOTNULL(vc, VBE_CONN_MAGIC);
- CHECK_OBJ_NOTNULL(vc->backend, BACKEND_MAGIC);
- b = vc->backend;
- }
- else {
- CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
- CHECK_OBJ_NOTNULL(sp->backend, BACKEND_MAGIC);
- b = sp->backend;
- }
- AN(b->method);
- if (b->method->updatehealth != NULL)
- b->method->updatehealth(sp, vc, a);
- CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC);
-#endif
-}
/* Deal with any message-body the request might have */
i = FetchReqBody(sp);
if (i > 0) {
- if (i > 1)
- VBE_UpdateHealth(sp, vc, -1);
VBE_ClosedFd(sp->wrk, vc);
return (__LINE__);
}
if (WRK_Flush(w)) {
- VBE_UpdateHealth(sp, vc, -1);
VBE_ClosedFd(sp->wrk, vc);
/* XXX: other cleanup ? */
return (__LINE__);
while (i == 0);
if (i < 0) {
- VBE_UpdateHealth(sp, vc, -1);
VBE_ClosedFd(sp->wrk, vc);
/* XXX: other cleanup ? */
return (__LINE__);
}
if (http_DissectResponse(sp->wrk, htc, hp)) {
- VBE_UpdateHealth(sp, vc, -2);
VBE_ClosedFd(sp->wrk, vc);
/* XXX: other cleanup ? */
return (__LINE__);
} else if (http_GetHdr(hp, H_Transfer_Encoding, &b)) {
/* XXX: AUGH! */
WSL(sp->wrk, SLT_Debug, vc->fd, "Invalid Transfer-Encoding");
- VBE_UpdateHealth(sp, vc, -3);
VBE_ClosedFd(sp->wrk, vc);
return (__LINE__);
} else {
VTAILQ_REMOVE(&sp->obj->store, st, list);
STV_free(st);
}
- VBE_UpdateHealth(sp, vc, -4);
VBE_ClosedFd(sp->wrk, vc);
sp->obj->len = 0;
return (__LINE__);
if (http_GetHdr(hp, H_Connection, &b) && !strcasecmp(b, "close"))
cls = 1;
- VBE_UpdateHealth(sp, vc, http_GetStatus(sp->bereq->http));
-
if (cls)
VBE_ClosedFd(sp->wrk, vc);
else