CLEANUP: sample: remove useless tests in fetch functions for l4 != NULL
The stream may never be null given that all these functions are called
from sample_process(). Let's remove this now confusing test which
sometimes happens after a dereference was already done.
diff --git a/src/payload.c b/src/payload.c
index 3a2dc15..9d7774c 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -48,9 +48,6 @@
{
struct channel *chn;
- if (!s)
- return 0;
-
chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
if (!chn->buf)
return 0;
@@ -71,9 +68,6 @@
struct channel *chn;
const unsigned char *data;
- if (!s)
- goto not_ssl_hello;
-
chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
if (!chn->buf)
goto not_ssl_hello;
@@ -140,7 +134,7 @@
int version, bleft, msg_len;
const unsigned char *data;
- if (!s || !s->req.buf)
+ if (!s->req.buf)
return 0;
msg_len = 0;
@@ -277,9 +271,6 @@
struct channel *chn;
unsigned char *data;
- if (!s)
- goto not_ssl_hello;
-
chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
if (!chn->buf)
goto not_ssl_hello;
@@ -415,7 +406,7 @@
int bleft;
const unsigned char *data;
- if (!s || !s->req.buf)
+ if (!s->req.buf)
return 0;
smp->flags = SMP_F_CONST;
@@ -542,9 +533,6 @@
/* by default buf offset == len offset + len size */
/* buf offset could be absolute or relative to len offset + len size if prefixed by + or - */
- if (!s)
- return 0;
-
chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
if (!chn->buf)
return 0;
@@ -592,9 +580,6 @@
unsigned int buf_size = arg_p[1].data.uint;
struct channel *chn;
- if (!s)
- return 0;
-
chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
if (!chn->buf)
return 0;