proto get_server_status remove field service_id
parent
7f92190c87
commit
b38bf00a28
|
|
@ -201,12 +201,11 @@ typedef struct {
|
||||||
typedef struct sf_proto_get_server_status_req {
|
typedef struct sf_proto_get_server_status_req {
|
||||||
SFProtoConfigSigns config_signs;
|
SFProtoConfigSigns config_signs;
|
||||||
char server_id[4]; //my server id
|
char server_id[4]; //my server id
|
||||||
char service_id[2];
|
|
||||||
union {
|
union {
|
||||||
char is_leader;
|
char is_leader;
|
||||||
char is_master;
|
char is_master;
|
||||||
};
|
};
|
||||||
char padding[1];
|
char padding[3];
|
||||||
} SFProtoGetServerStatusReq;
|
} SFProtoGetServerStatusReq;
|
||||||
|
|
||||||
typedef struct sf_group_server_info {
|
typedef struct sf_group_server_info {
|
||||||
|
|
@ -558,15 +557,13 @@ int sf_proto_get_leader(ConnectionInfo *conn,
|
||||||
const int network_timeout,
|
const int network_timeout,
|
||||||
SFClientServerEntry *leader);
|
SFClientServerEntry *leader);
|
||||||
|
|
||||||
|
static inline void sf_proto_get_server_status_pack(
|
||||||
static inline void sf_proto_get_server_status_pack(const int server_id,
|
const int server_id, const bool is_leader,
|
||||||
const int service_id, const bool is_leader,
|
|
||||||
const unsigned char *servers_sign,
|
const unsigned char *servers_sign,
|
||||||
const unsigned char *cluster_sign,
|
const unsigned char *cluster_sign,
|
||||||
SFProtoGetServerStatusReq *req)
|
SFProtoGetServerStatusReq *req)
|
||||||
{
|
{
|
||||||
int2buff(server_id, req->server_id);
|
int2buff(server_id, req->server_id);
|
||||||
short2buff(service_id, req->service_id);
|
|
||||||
req->is_leader = (is_leader ? 1 : 0);
|
req->is_leader = (is_leader ? 1 : 0);
|
||||||
memcpy(req->config_signs.servers, servers_sign,
|
memcpy(req->config_signs.servers, servers_sign,
|
||||||
SF_CLUSTER_CONFIG_SIGN_LEN);
|
SF_CLUSTER_CONFIG_SIGN_LEN);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue