Skip to content

Commit 1cc9340

Browse files
committed
MINOR: listener: Remove useless checks on the receiver protocol existence
The receiver protocol is always set when a listener is created or cloned. At least for now. And there is no check on it at many places, except in listener_accept() function. So, let's remove remaining useless checks. That will avoid false Coverity reports in future. This patch should fix the issue #2631.
1 parent 217e467 commit 1cc9340

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/listener.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ void listener_accept(struct listener *l)
10341034
int ret;
10351035

10361036
p = l->bind_conf->frontend;
1037-
bind_tid_commit = l->rx.proto ? l->rx.proto->bind_tid_commit : NULL;
1037+
bind_tid_commit = l->rx.proto->bind_tid_commit;
10381038

10391039
/* if l->bind_conf->maxaccept is -1, then max_accept is UINT_MAX. It is
10401040
* not really illimited, but it is probably enough.
@@ -1473,7 +1473,7 @@ void listener_accept(struct listener *l)
14731473
* reservation in the target ring.
14741474
*/
14751475

1476-
if (l->rx.proto && l->rx.proto->bind_tid_prep) {
1476+
if (l->rx.proto->bind_tid_prep) {
14771477
if (l->rx.proto->bind_tid_prep(cli_conn, t)) {
14781478
/* Failed migration, stay on the same thread. */
14791479
goto local_accept;
@@ -1498,7 +1498,7 @@ void listener_accept(struct listener *l)
14981498
*/
14991499
_HA_ATOMIC_INC(&activity[t].accq_full);
15001500

1501-
if (l->rx.proto && l->rx.proto->bind_tid_reset)
1501+
if (l->rx.proto->bind_tid_reset)
15021502
l->rx.proto->bind_tid_reset(cli_conn);
15031503
}
15041504
#endif // USE_THREAD
@@ -1573,7 +1573,7 @@ void listener_accept(struct listener *l)
15731573
/* This may be a shared socket that was paused by another process.
15741574
* Let's put it to pause in this case.
15751575
*/
1576-
if (l->rx.proto && l->rx.proto->rx_listening(&l->rx) == 0) {
1576+
if (l->rx.proto->rx_listening(&l->rx) == 0) {
15771577
suspend_listener(l, 0, 0);
15781578
goto end;
15791579
}

0 commit comments

Comments
 (0)