bugfix: TSG-14162 使用strlen(meta->route_ctx)判断route_ctx是否为空时,遗漏route_ctx首字节为0的情况

This commit is contained in:
luwenpeng
2023-03-13 19:39:57 +08:00
parent 20510bd2d5
commit 8d820e3213
4 changed files with 55 additions and 12 deletions

View File

@@ -122,6 +122,28 @@ void sids_copy(struct sids *dst, struct sids *src)
}
}
/******************************************************************************
* route_ctx
******************************************************************************/
int route_ctx_is_empty(struct route_ctx *ctx)
{
if (ctx->len == 0)
{
return 1;
}
else
{
return 0;
}
}
void route_ctx_copy(struct route_ctx *dst, struct route_ctx *src)
{
memcpy(dst->data, src->data, src->len);
dst->len = src->len;
}
/******************************************************************************
* throughput_metrics
******************************************************************************/