提交 44a27ac2 编写于 作者: M Matt Caswell

Remove ASYNC_in_job()

The ASYNC_in_job() function is redundant. The same effect can be achieved by
using ASYNC_get_current_job().
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 c00793da
......@@ -287,14 +287,6 @@ int ASYNC_pause_job(void)
return 1;
}
int ASYNC_in_job(void)
{
if(ASYNC_get_ctx())
return 1;
return 0;
}
static void async_empty_pool(STACK_OF(ASYNC_JOB) *pool)
{
ASYNC_JOB *job;
......
......@@ -73,7 +73,6 @@ void ASYNC_free_pool(void);
int ASYNC_start_job(ASYNC_JOB **job, int *ret, int (*func)(void *),
void *args, size_t size);
int ASYNC_pause_job(void);
int ASYNC_in_job(void);
int ASYNC_get_wait_fd(ASYNC_JOB *job);
ASYNC_JOB *ASYNC_get_current_job(void);
......
......@@ -961,7 +961,7 @@ int SSL_accept(SSL *s)
args.s = s;
if((s->mode & SSL_MODE_ASYNC) && !ASYNC_in_job()) {
if((s->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
switch(ASYNC_start_job(&s->job, &ret, ssl_accept_intern, &args,
sizeof(struct ssl_async_args))) {
case ASYNC_ERR:
......@@ -1031,7 +1031,7 @@ int SSL_read(SSL *s, void *buf, int num)
args.buf = buf;
args.num = num;
if((s->mode & SSL_MODE_ASYNC) && !ASYNC_in_job()) {
if((s->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
switch(ASYNC_start_job(&s->job, &ret, ssl_read_intern, &args,
sizeof(struct ssl_async_args))) {
case ASYNC_ERR:
......@@ -1104,7 +1104,7 @@ int SSL_write(SSL *s, const void *buf, int num)
args.buf = (void *) buf;
args.num = num;
if((s->mode & SSL_MODE_ASYNC) && !ASYNC_in_job()) {
if((s->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
switch(ASYNC_start_job(&s->job, &ret, ssl_write_intern, &args,
sizeof(struct ssl_async_args))) {
case ASYNC_ERR:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册