Lines Matching refs:run
58 typedef int (*mcp_mut_r)(struct mcp_mut_run *run, struct mcp_mut_step *s, struct mcp_mut_part *p);
136 #define mut_step_r(n) static int mcp_mutator_##n##_r(struct mcp_mut_run *run, struct mcp_mut_step *…
137 #define mut_step_n(n) static int mcp_mutator_##n##_n(struct mcp_mut_run *run, struct mcp_mut_step *…
248 struct mcp_mutator *mut = run->mut; in mut_step_r()
253 memcpy(run->d_pos, str, c->len); in mut_step_r()
254 run->d_pos += c->len; in mut_step_r()
278 mcp_request_t *srq = lua_touserdata(run->L, idx); in mut_step_n()
294 memcpy(run->d_pos, p->src, p->slen); in mut_step_r()
295 run->d_pos += p->slen; in mut_step_r()
320 mcp_request_t *srq = lua_touserdata(run->L, idx); in mut_step_n()
329 memcpy(run->d_pos, p->src, p->slen); in mut_step_r()
330 run->d_pos += p->slen; in mut_step_r()
376 struct mcp_mutator *mut = run->mut; in mut_step_r()
381 memcpy(run->d_pos, str, c->len); in mut_step_r()
382 run->d_pos += c->len; in mut_step_r()
416 struct mcp_mutator *mut = run->mut; in mut_step_r()
421 memcpy(run->d_pos, str, c->len); in mut_step_r()
422 run->d_pos += c->len; in mut_step_r()
445 mcp_resp_t *srs = lua_touserdata(run->L, idx); in mut_step_n()
468 memcpy(run->d_pos, p->src, p->slen); in mut_step_r()
469 run->d_pos += p->slen; in mut_step_r()
562 struct mcp_mutator *mut = run->mut; in mut_step_r()
569 memcpy(run->d_pos, str, len); in mut_step_r()
570 run->d_pos += len; in mut_step_r()
619 struct mcp_mutator *mut = run->mut; in mut_step_r()
625 *(run->d_pos) = c->flag.f; in mut_step_r()
626 run->d_pos++; in mut_step_r()
628 memcpy(run->d_pos, str, len); in mut_step_r()
629 run->d_pos += len; in mut_step_r()
659 struct mcp_mutator *mut = run->mut; in mut_step_n()
665 mcp_request_t *srq = lua_touserdata(run->L, idx); in mut_step_n()
682 mcp_resp_t *srs = lua_touserdata(run->L, idx); in mut_step_n()
710 *(run->d_pos) = c->f; in mut_step_r()
711 run->d_pos++; in mut_step_r()
713 memcpy(run->d_pos, p->src, p->slen); in mut_step_r()
714 run->d_pos += p->slen; in mut_step_r()
768 lua_State *L = run->L; in mut_step_n()
790 run->vbuf = srq->pr.vbuf; in mut_step_n()
791 run->vlen = srq->pr.vlen; in mut_step_n()
811 run->vbuf = lua_tolstring(L, idx, &run->vlen); in mut_step_n()
829 const char *e = itoa_u64(run->vlen, temp); in mut_step_n()
837 run->d_pos = itoa_u64(run->vlen-2, run->d_pos); in mut_step_r()
941 static inline int _mcp_mut_run_total(struct mcp_mut_run *run, struct mcp_mut_part *parts) { in _mcp_mut_run_total() argument
943 struct mcp_mutator *mut = run->mut; in _mcp_mut_run_total()
947 int len = s->n(run, s, &parts[x]); in _mcp_mut_run_total()
963 static inline int _mcp_mut_run_assemble(struct mcp_mut_run *run, struct mcp_mut_part *parts) { in _mcp_mut_run_assemble() argument
964 struct mcp_mutator *mut = run->mut; in _mcp_mut_run_assemble()
972 if (s->r(run, s, &parts[x]) < 0) { in _mcp_mut_run_assemble()
976 *(run->d_pos) = ' '; in _mcp_mut_run_assemble()
977 run->d_pos++; in _mcp_mut_run_assemble()
983 *(run->d_pos-1) = '\r'; in _mcp_mut_run_assemble()
984 *(run->d_pos) = '\n'; in _mcp_mut_run_assemble()
985 run->d_pos++; in _mcp_mut_run_assemble()
990 static int mcp_mut_run(struct mcp_mut_run *run) { in mcp_mut_run() argument
991 struct mcp_mutator *mut = run->mut; in mcp_mut_run()
992 LIBEVENT_THREAD *t = PROXY_GET_THR(run->L); in mcp_mut_run()
997 int total = _mcp_mut_run_total(run, parts); in mcp_mut_run()
1002 mcp_request_t *rq = run->arg; in mcp_mut_run()
1010 run->d_pos = rq->request; in mcp_mut_run()
1012 _mcp_mut_run_assemble(run, parts); in mcp_mut_run()
1016 if (process_request(&rq->pr, rq->request, run->d_pos - rq->request) != 0) { in mcp_mut_run()
1021 if (run->vbuf) { in mcp_mut_run()
1022 rq->pr.vbuf = malloc(run->vlen); in mcp_mut_run()
1030 rq->pr.vlen = run->vlen; in mcp_mut_run()
1031 memcpy(rq->pr.vbuf, run->vbuf, run->vlen); in mcp_mut_run()
1034 mcp_resp_t *rs = run->arg; in mcp_mut_run()
1044 run->d_pos = rs->buf; in mcp_mut_run()
1046 _mcp_mut_run_assemble(run, parts); in mcp_mut_run()
1049 if (mcmc_parse_buf(rs->buf, run->d_pos - rs->buf, &rs->resp) != MCMC_OK) { in mcp_mut_run()
1055 if (run->vbuf) { in mcp_mut_run()
1056 memcpy(run->d_pos, run->vbuf, run->vlen); in mcp_mut_run()
1057 run->d_pos += run->vlen; in mcp_mut_run()
1060 rs->blen = run->d_pos - rs->buf; in mcp_mut_run()
1135 struct mcp_mut_run run = {L, mut, arg, NULL, NULL, 0}; in mcplib_mutator_call() local
1137 int ret = mcp_mut_run(&run); in mcplib_mutator_call()