[MAJOR] fixed missing checks for NULL srv pointers (possible in dispatch mode)

This commit is contained in:
willy tarreau 2006-05-01 15:26:35 +02:00
parent cd655351b8
commit 926a3575e6
1 changed files with 26 additions and 13 deletions

View File

@ -2242,6 +2242,7 @@ int connect_server(struct session *s) {
#endif
fd_insert(fd);
if (s->srv)
s->srv->cur_sess++;
if (s->proxy->contimeout)
@ -4396,6 +4397,7 @@ int process_srv(struct session *t) {
/* timeout, connect error or first write error */
//FD_CLR(t->srv_fd, StaticWriteEvent);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->conn_retries--;
@ -4506,6 +4508,7 @@ int process_srv(struct session *t) {
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 502;
@ -4528,6 +4531,7 @@ int process_srv(struct session *t) {
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 502;
@ -4961,6 +4965,7 @@ int process_srv(struct session *t) {
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 502;
@ -4990,6 +4995,7 @@ int process_srv(struct session *t) {
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
t->logs.status = 504;
@ -5086,6 +5092,7 @@ int process_srv(struct session *t) {
tv_eternity(&t->srexpire);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
t->srv_state = SV_STCLOSE;
if (!(t->flags & SN_ERR_MASK))
@ -5193,6 +5200,7 @@ int process_srv(struct session *t) {
//FD_CLR(t->srv_fd, StaticWriteEvent);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
@ -5207,6 +5215,7 @@ int process_srv(struct session *t) {
//FD_CLR(t->srv_fd, StaticWriteEvent);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
@ -5217,6 +5226,7 @@ int process_srv(struct session *t) {
//FD_CLR(t->srv_fd, StaticWriteEvent);
tv_eternity(&t->swexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
@ -5253,6 +5263,7 @@ int process_srv(struct session *t) {
//FD_CLR(t->srv_fd, StaticReadEvent);
tv_eternity(&t->srexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
@ -5267,6 +5278,7 @@ int process_srv(struct session *t) {
//FD_CLR(t->srv_fd, StaticReadEvent);
tv_eternity(&t->srexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;
@ -5277,6 +5289,7 @@ int process_srv(struct session *t) {
//FD_CLR(t->srv_fd, StaticReadEvent);
tv_eternity(&t->srexpire);
fd_delete(t->srv_fd);
if (t->srv)
t->srv->cur_sess--;
//close(t->srv_fd);
t->srv_state = SV_STCLOSE;