add macro SF_PROTO_CLIENT_SET_REQ_EX
parent
97f9db7a17
commit
5522165e5c
|
|
@ -97,14 +97,14 @@
|
||||||
|
|
||||||
#define SF_PROTO_QUERY_EXTRA_BODY_SIZE FCFS_AUTH_SESSION_ID_LEN
|
#define SF_PROTO_QUERY_EXTRA_BODY_SIZE FCFS_AUTH_SESSION_ID_LEN
|
||||||
|
|
||||||
#define SF_PROTO_CLIENT_SET_REQ(client_ctx, out_buff, \
|
#define SF_PROTO_CLIENT_SET_REQ_EX(client_ctx, auth_enabled, \
|
||||||
header, req, the_req_id, out_bytes) \
|
out_buff, header, req, the_req_id, out_bytes) \
|
||||||
do { \
|
do { \
|
||||||
char *the_req_start; \
|
char *the_req_start; \
|
||||||
header = (SFCommonProtoHeader *)out_buff; \
|
header = (SFCommonProtoHeader *)out_buff; \
|
||||||
the_req_start = (char *)(header + 1); \
|
the_req_start = (char *)(header + 1); \
|
||||||
out_bytes = sizeof(SFCommonProtoHeader) + sizeof(*req); \
|
out_bytes = sizeof(SFCommonProtoHeader) + sizeof(*req); \
|
||||||
if (client_ctx->auth.enabled) { \
|
if (auth_enabled) { \
|
||||||
out_bytes += FCFS_AUTH_SESSION_ID_LEN; \
|
out_bytes += FCFS_AUTH_SESSION_ID_LEN; \
|
||||||
memcpy(the_req_start, client_ctx->auth.ctx-> \
|
memcpy(the_req_start, client_ctx->auth.ctx-> \
|
||||||
session.id, FCFS_AUTH_SESSION_ID_LEN); \
|
session.id, FCFS_AUTH_SESSION_ID_LEN); \
|
||||||
|
|
@ -121,6 +121,10 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define SF_PROTO_CLIENT_SET_REQ(client_ctx, out_buff, \
|
||||||
|
header, req, the_req_id, out_bytes) \
|
||||||
|
SF_PROTO_CLIENT_SET_REQ_EX(client_ctx, client_ctx->auth.enabled, \
|
||||||
|
out_buff, header, req, the_req_id, out_bytes)
|
||||||
|
|
||||||
typedef struct sf_common_proto_header {
|
typedef struct sf_common_proto_header {
|
||||||
unsigned char magic[4]; //magic number
|
unsigned char magic[4]; //magic number
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue