[Tarantool-patches] [PATCH 5/5] msgpuck: activate MP_EXT custom serializers

Alexander Turenko alexander.turenko at tarantool.org
Tue May 19 15:11:48 MSK 2020


> diff --git a/src/box/msgpack.c b/src/box/msgpack.c
> index 37bb3920c..4013aec4c 100644
> --- a/src/box/msgpack.c
> +++ b/src/box/msgpack.c
> @@ -49,7 +49,8 @@ msgpack_fprint_ext(FILE *file, const char **data, int depth)
>  	case MP_ERROR:
>  		return mp_fprint_error(file, data, depth);
>  	default:
> -		return fprintf(file, "undefined");
> +		return fprintf(file, "(extension: type %d, len %u)", (int)type,
> +			       (unsigned)len);
>  	}
>  }

I would reuse mp_fprint_ext_default() here.

>  
> @@ -66,7 +67,8 @@ msgpack_snprint_ext(char *buf, int size, const char **data, int depth)
>  	case MP_ERROR:
>  		return mp_snprint_error(buf, size, data, depth);
>  	default:
> -		return snprintf(buf, size, "undefined");
> +		return snprintf(buf, size, "(extension: type %d, len %u)",
> +				(int)type, (unsigned)len);
>  	}
>  }

Same.


More information about the Tarantool-patches mailing list