[MINOR] do not create a socket if there is no server

Since the distinction of backends and frontends, it has become
possible that some requests reach a frontend which has no
backend parameters. We must not create a socket on the backend
side just to destroy it later in such a case. The real problem
comes from the dispatch mode not being explictly stated.
This commit is contained in:
Willy Tarreau 2007-01-20 11:07:46 +01:00
parent 0637fa0671
commit 1a1158b0bd

View File

@ -186,7 +186,10 @@ int assign_server(struct session *s)
else /* unknown balancing algorithm */ else /* unknown balancing algorithm */
return SRV_STATUS_INTERNAL; return SRV_STATUS_INTERNAL;
} }
s->flags |= SN_ASSIGNED; else if (*(int *)&s->be->beprm->dispatch_addr.sin_addr || s->fe->options & PR_O_TRANSP)
s->flags |= SN_ASSIGNED;
else
return SRV_STATUS_NOSRV;
} }
return SRV_STATUS_OK; return SRV_STATUS_OK;
} }
@ -243,6 +246,10 @@ int assign_server_address(struct session *s)
return SRV_STATUS_INTERNAL; return SRV_STATUS_INTERNAL;
} }
} }
else {
/* no server and no LB algorithm ! */
return SRV_STATUS_INTERNAL;
}
s->flags |= SN_ADDR_SET; s->flags |= SN_ADDR_SET;
return SRV_STATUS_OK; return SRV_STATUS_OK;