*/
static int smp_fetch_capture_req_hdr(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct proxy *fe = strm_fe(smp->strm);
+ struct proxy *fe;
int idx;
if (!args || args->type != ARGT_SINT)
return 0;
+ if (!smp->strm)
+ return 0;
+
+ fe = strm_fe(smp->strm);
idx = args->data.sint;
if (idx > (fe->nb_req_cap - 1) || smp->strm->req_cap == NULL || smp->strm->req_cap[idx] == NULL)
*/
static int smp_fetch_capture_res_hdr(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct proxy *fe = strm_fe(smp->strm);
+ struct proxy *fe;
int idx;
if (!args || args->type != ARGT_SINT)
return 0;
+ if (!smp->strm)
+ return 0;
+
+ fe = strm_fe(smp->strm);
idx = args->data.sint;
if (idx > (fe->nb_rsp_cap - 1) || smp->strm->res_cap == NULL || smp->strm->res_cap[idx] == NULL)
static int smp_fetch_capture_req_method(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct buffer *temp;
- struct http_txn *txn = smp->strm->txn;
+ struct http_txn *txn;
char *ptr;
+ if (!smp->strm)
+ return 0;
+
+ txn = smp->strm->txn;
if (!txn || !txn->uri)
return 0;
/* Extracts the path in the HTTP request, the txn->uri should be filled before the call */
static int smp_fetch_capture_req_uri(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct http_txn *txn = smp->strm->txn;
+ struct http_txn *txn;
struct ist path;
const char *ptr;
+ if (!smp->strm)
+ return 0;
+
+ txn = smp->strm->txn;
if (!txn || !txn->uri)
return 0;
*/
static int smp_fetch_capture_req_ver(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct http_txn *txn = smp->strm->txn;
+ struct http_txn *txn;
+
+ if (!smp->strm)
+ return 0;
+ txn = smp->strm->txn;
if (!txn || txn->req.msg_state >= HTTP_MSG_BODY)
return 0;
*/
static int smp_fetch_capture_res_ver(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct http_txn *txn = smp->strm->txn;
+ struct http_txn *txn;
+ if (!smp->strm)
+ return 0;
+
+ txn = smp->strm->txn;
if (!txn || txn->rsp.msg_state >= HTTP_MSG_BODY)
return 0;