Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions zookeeper-client/zookeeper-client-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ set(test_sources
tests/ThreadingUtil.cc
tests/TestZookeeperInit.cc
tests/TestZookeeperClose.cc
tests/TestAuthCompletion.cc
tests/TestSASLAuth.cc
tests/TestReconfig.cc
tests/TestReconfigServer.cc
Expand Down
1 change: 1 addition & 0 deletions zookeeper-client/zookeeper-client-c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ TEST_SOURCES = \
tests/ThreadingUtil.cc \
tests/TestZookeeperInit.cc \
tests/TestZookeeperClose.cc \
tests/TestAuthCompletion.cc \
tests/TestReconfig.cc \
tests/TestReconfigServer.cc \
tests/TestClientRetry.cc \
Expand Down
5 changes: 5 additions & 0 deletions zookeeper-client/zookeeper-client-c/include/zookeeper.h
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,11 @@ ZOOAPI const char* zerror(int c);
* the following result codes may be passed into the completion callback:
* ZOK operation completed successfully
* ZAUTHFAILED authentication failed
* If the server rejects an earlier credential, a request that is still
* pending also receives ZAUTHFAILED. If the connection closes before the
* reply, the completion receives the error that closed it, for example
* ZCONNECTIONLOSS. The client keeps the credential and sends it again on the
* next connection. That resend has no completion.
* \param data the data that will be passed to the completion routine when the
* function completes.
* \return ZOK on success or one of the following errcodes on failure:
Expand Down
13 changes: 12 additions & 1 deletion zookeeper-client/zookeeper-client-c/src/zk_adaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ struct sync_completion {
};

typedef struct _auth_info {
int state; /* 0=>inactive, >0 => active */
char* scheme;
struct buffer auth;
void_completion_t completion;
Expand Down Expand Up @@ -177,9 +176,21 @@ struct adaptor_threads {
};
#endif

/**
* Outstanding SetAuth request. The list is a FIFO that matches the order of
* frames on the wire. Each reply completes the head entry.
*/
typedef struct _auth_request {
auth_info *auth; /* credential carried by this frame */
void_completion_t completion; /* NULL on a reconnect resend */
const char *data;
struct _auth_request *next;
} auth_request_t;

/** the auth list for adding auth */
typedef struct _auth_list_head {
auth_info *auth;
auth_request_t *pending; /* FIFO of SetAuth frames on the wire */
#ifdef THREADED
pthread_mutex_t lock;
#endif
Expand Down
Loading
Loading