Skip to content

Commit

Permalink
Merge pull request naver#243 from uhm0311/uhm0311/proxy_connect_valid…
Browse files Browse the repository at this point in the history
…ation

INTERNAL: Add validation in arcus_proxy_connect()
  • Loading branch information
jhpark816 authored Mar 16, 2022
2 parents 222d6cf + 764f29e commit 2e797b3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions libmemcached/arcus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,21 @@ arcus_return_t arcus_proxy_connect(memcached_st *mc,
memcached_pool_st *pool,
memcached_st *proxy)
{
arcus_return_t rc;
if (mc == NULL and pool == NULL) {
return ARCUS_ERROR;
}
if (proxy == NULL) {
return ARCUS_ERROR;
}
if (mc != NULL and pool != NULL and mc != memcached_pool_get_master(pool)) {
return ARCUS_ERROR;
}
if (mc == NULL and pool != NULL) {
mc= memcached_pool_get_master(pool);
}

/* Initiate the Arcus. */
rc= do_arcus_init(mc, pool, NULL, NULL);
arcus_return_t rc= do_arcus_init(mc, pool, NULL, NULL);
if (rc == ARCUS_ALREADY_INITIATED) {
return ARCUS_SUCCESS;
}
Expand Down

0 comments on commit 2e797b3

Please sign in to comment.