Skip to content
Permalink
Browse files

Simplify and appeace FlexeLint

  • Loading branch information...
bsdphk committed Nov 4, 2019
1 parent 90f084c commit e50acd5460fbddbd75bf3570c1de041b629120bb
@@ -104,8 +104,8 @@ cnt_transport(struct worker *wrk, struct req *req)
* Deliver an object to client
*/

static int
resp_setup_deliver(struct req *req)
int
Resp_Setup_Deliver(struct req *req)
{
struct http *h;
struct objcore *oc;
@@ -145,12 +145,11 @@ resp_setup_deliver(struct req *req)
ObjCheckFlag(req->wrk, oc, OF_GZIPED) &&
!RFC2616_Req_Gzip(req->http))
RFC2616_Weaken_Etag(h);

return (0);
return(0);
}

static int
resp_setup_synth(struct req *req)
void
Resp_Setup_Synth(struct req *req)
{
struct http *h;

@@ -175,23 +174,6 @@ resp_setup_synth(struct req *req)
*/
if (req->want100cont)
http_SetHeader(h, "Connection: close");

return (0);
}

int
Resp_Setup(struct req *req, unsigned method)
{
switch (method) {
case VCL_MET_DELIVER:
return (resp_setup_deliver(req));
case VCL_MET_SYNTH:
return (resp_setup_synth(req));
default:
WRONG("vcl method");
}

return (0);
}

static enum req_fsm_nxt
@@ -209,7 +191,7 @@ cnt_deliver(struct worker *wrk, struct req *req)

ObjTouch(req->wrk, req->objcore, req->t_prev);

if (resp_setup_deliver(req)) {
if (Resp_Setup_Deliver(req)) {
(void)HSH_DerefObjCore(wrk, &req->objcore, HSH_RUSH_POLICY);
req->err_code = 500;
req->req_step = R_STP_SYNTH;
@@ -297,7 +279,7 @@ cnt_synth(struct worker *wrk, struct req *req)
if (req->err_code < 100)
req->err_code = 501;

(void) resp_setup_synth(req);
Resp_Setup_Synth(req);

synth_body = VSB_new_auto();
AN(synth_body);
@@ -361,7 +361,8 @@ void VRB_Free(struct req *);

/* cache_req_fsm.c [CNT] */

int Resp_Setup(struct req *, unsigned);
int Resp_Setup_Deliver(struct req *);
void Resp_Setup_Synth(struct req *);

enum req_fsm_nxt {
REQ_FSM_MORE,
@@ -747,8 +747,10 @@ VRT_Rollback(VRT_CTX, VCL_HTTP hp)
if (hp == ctx->http_req) {
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
Req_Rollback(ctx->req);
if ((ctx->method & (VCL_MET_DELIVER | VCL_MET_SYNTH)) != 0)
Resp_Setup(ctx->req, ctx->method);
if (ctx->method & VCL_MET_DELIVER)
XXXAZ(Resp_Setup_Deliver(ctx->req));
if (ctx->method & VCL_MET_SYNTH)
Resp_Setup_Synth(ctx->req);
} else if (hp == ctx->http_bereq) {
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
Bereq_Rollback(ctx->bo);
@@ -482,7 +482,7 @@ pool_breed(struct pool *qp)
if (cache_param->wthread_add_delay > 0.0)
VTIM_sleep(cache_param->wthread_add_delay);
else
sched_yield();
(void)sched_yield();
}

AZ(pthread_attr_destroy(&tp_attr));

0 comments on commit e50acd5

Please sign in to comment.
You can’t perform that action at this time.