Skip to content

Commit

Permalink
CCBC-350: Add cntl to report changeset used by binary
Browse files Browse the repository at this point in the history
Change-Id: Ib8240c4d899fdf3f6c4988a52f23ddf2e37def8b
Reviewed-on: http://review.couchbase.org/34898
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
  • Loading branch information
mnunberg committed Mar 27, 2014
1 parent 4df4baa commit 3eb22d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 8 additions & 1 deletion include/libcouchbase/cntl.h
Expand Up @@ -433,8 +433,15 @@ extern "C" {
*/
#define LCB_CNTL_CONFIG_CCCP_NODES 0x1E

/**
* Get the current SCM changeset for the library binary
* Arg: char** to contain the resultant string. This string must not be
* freed
*/
#define LCB_CNTL_CHANGESET 0x1F

/** This is not a command, but rather an indicator of the last item */
#define LCB_CNTL__MAX 0x1F
#define LCB_CNTL__MAX 0x20


#ifdef __cplusplus
Expand Down
12 changes: 11 additions & 1 deletion src/cntl.c
Expand Up @@ -447,6 +447,15 @@ static lcb_error_t config_nodes(int mode, lcb_t instance, int cmd, void *arg)
return LCB_SUCCESS;
}

static lcb_error_t get_changeset(int mode, lcb_t instance, int cmd, void *arg)
{
*(char **)arg = LCB_VERSION_CHANGESET;
(void)instance;
(void)mode;
(void)cmd;
return LCB_SUCCESS;
}

static ctl_handler handlers[] = {
timeout_common, /* LCB_CNTL_OP_TIMEOUT */
timeout_common, /* LCB_CNTL_VIEW_TIMEOUT */
Expand Down Expand Up @@ -478,7 +487,8 @@ static ctl_handler handlers[] = {
timeout_common, /* LCB_CNTL_CONFIG_NODE_TIMEOUT */
timeout_common, /* LCB_CNTL_HTCONFIG_IDLE_TIMEOUT */
config_nodes, /* LCB_CNTL_CONFIG_HTTP_NODES */
config_nodes /* LCB_CNTL_CONFIG_CCCP_NODES */
config_nodes, /* LCB_CNTL_CONFIG_CCCP_NODES */
get_changeset /* LCB_CNTL_CHANGESET */
};


Expand Down

0 comments on commit 3eb22d6

Please sign in to comment.