mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
MINOR: ssl_sock: make use of CO_FL_WILL_UPDATE
Now when ssl_sock_{to,from}_buf are called, if the connection doesn't feature CO_FL_WILL_UPDATE, they will first retrieve the updated flags using conn_refresh_polling_flags() before changing any flag, then call conn_cond_update_sock_polling() before leaving, to commit such changes.
This commit is contained in:
parent
256b9c5993
commit
31d4dbe825
@ -4851,6 +4851,8 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
|
|||||||
int ret, done = 0;
|
int ret, done = 0;
|
||||||
int try;
|
int try;
|
||||||
|
|
||||||
|
conn_refresh_polling_flags(conn);
|
||||||
|
|
||||||
if (!conn->xprt_ctx)
|
if (!conn->xprt_ctx)
|
||||||
goto out_error;
|
goto out_error;
|
||||||
|
|
||||||
@ -4936,18 +4938,20 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
|
|||||||
goto out_error;
|
goto out_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
leave:
|
||||||
|
conn_cond_update_sock_polling(conn);
|
||||||
return done;
|
return done;
|
||||||
|
|
||||||
read0:
|
read0:
|
||||||
conn_sock_read0(conn);
|
conn_sock_read0(conn);
|
||||||
return done;
|
goto leave;
|
||||||
out_error:
|
out_error:
|
||||||
/* Clear openssl global errors stack */
|
/* Clear openssl global errors stack */
|
||||||
ssl_sock_dump_errors(conn);
|
ssl_sock_dump_errors(conn);
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
|
|
||||||
conn->flags |= CO_FL_ERROR;
|
conn->flags |= CO_FL_ERROR;
|
||||||
return done;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4966,6 +4970,7 @@ static int ssl_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
|
|||||||
int ret, try, done;
|
int ret, try, done;
|
||||||
|
|
||||||
done = 0;
|
done = 0;
|
||||||
|
conn_refresh_polling_flags(conn);
|
||||||
|
|
||||||
if (!conn->xprt_ctx)
|
if (!conn->xprt_ctx)
|
||||||
goto out_error;
|
goto out_error;
|
||||||
@ -5043,6 +5048,8 @@ static int ssl_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
|
|||||||
goto out_error;
|
goto out_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
leave:
|
||||||
|
conn_cond_update_sock_polling(conn);
|
||||||
return done;
|
return done;
|
||||||
|
|
||||||
out_error:
|
out_error:
|
||||||
@ -5051,7 +5058,7 @@ static int ssl_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
|
|||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
|
|
||||||
conn->flags |= CO_FL_ERROR;
|
conn->flags |= CO_FL_ERROR;
|
||||||
return done;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ssl_sock_close(struct connection *conn) {
|
static void ssl_sock_close(struct connection *conn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user