void WRK_Init(void);
void WRK_QueueSession(struct sess *sp);
void WRK_Reset(struct worker *w, int *fd);
-int WRK_Flush(struct worker *w);
+unsigned WRK_Flush(struct worker *w);
unsigned WRK_Write(struct worker *w, const void *ptr, int len);
unsigned WRK_WriteH(struct worker *w, struct http_hdr *hh, const char *suf);
#ifdef HAVE_SENDFILE
assert(obj->hashlen >= sp->lhashptr);
b = obj->hash;
for (u = 0; u < sp->ihashptr; u += 2) {
- v = sp->hashptr[u + 1] - sp->hashptr[u];
+ v = pdiff(sp->hashptr[u], sp->hashptr[u + 1]);
memcpy(b, sp->hashptr[u], v);
b += v;
*b++ = '#';
w->wfd = fd;
}
-int
+unsigned
WRK_Flush(struct worker *w)
{
int i;
TAILQ_INSERT_TAIL(&sp->obj->store, st, list);
/* generate body */
- vsb_new(&vsb, (char *)st->ptr, st->space, VSB_FIXEDLEN);
+ AN(vsb_new(&vsb, (char *)st->ptr, st->space, VSB_FIXEDLEN));
vsb_printf(&vsb,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n"
return (NULL);
}
+ /*
+ * XXX: we should look up and check the handle in the loaded
+ * object
+ */
+
AZ(dlclose(p));
return (of);
}
}
}
+/*
+ * XXX: This should take an option argument to show all (include) files
+ */
void
mcf_config_show(struct cli *cli, char **av, void *priv)
{
cli_out(cli, "failed to locate source for %s: %s\n",
vp->name, dlerror());
cli_result(cli, CLIS_CANT);
- dlclose(dlh);
+ AZ(dlclose(dlh));
} else {
src = sym;
cli_out(cli, src[0]);
/* cli_out(cli, src[1]); */
- dlclose(dlh);
+ AZ(dlclose(dlh));
}
}
}
static int
cmp_storage(const struct stevedore *s, const char *p, const char *q)
{
- if (strlen(s->name) != q - p)
+ unsigned u;
+
+ u = pdiff(p, q);
+ if (strlen(s->name) != u)
return (1);
- if (strncmp(s->name, p, q - p))
+ if (strncmp(s->name, p, u))
return (1);
return (0);
}