void http_process(struct vtclog *vl, const char *spec, int sock, int sfd) { struct http *hp; char *s, *q; (void)sfd; ALLOC_OBJ(hp, HTTP_MAGIC); AN(hp); hp->fd = sock; hp->timeout = 3000; hp->nrxbuf = 640*1024; hp->vsb = vsb_newauto(); hp->rxbuf = malloc(hp->nrxbuf); /* XXX */ hp->sfd = sfd; hp->vl = vl; AN(hp->rxbuf); AN(hp->vsb); s = strdup(spec); q = strchr(s, '\0'); assert(q > s); AN(s); parse_string(s, http_cmds, hp, vl); vsb_delete(hp->vsb); free(hp->rxbuf); free(hp); }
static void vcc_delete_expr(struct expr *e) { if (e == NULL) return; CHECK_OBJ_NOTNULL(e, EXPR_MAGIC); vsb_delete(e->vsb); FREE_OBJ(e); }
void vtc_logclose(struct vtclog *vl) { CHECK_OBJ_NOTNULL(vl, VTCLOG_MAGIC); vsb_delete(vl->vsb); AZ(pthread_mutex_destroy(&vl->mtx)); FREE_OBJ(vl); }