[Asterisk-code-review] Sorcery: Create human friendly serializer names. (asterisk[master])

Mark Michelson asteriskteam at digium.com
Fri Jan 8 14:43:43 CST 2016


Mark Michelson has posted comments on this change.

Change subject: Sorcery: Create human friendly serializer names.
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/1957/1/main/sorcery.c
File main/sorcery.c:

Line 860: 	/* Create name with seq number appended.  Truncate type to ensure string fits. */
        : 	snprintf(seq, sizeof(seq), "-%08x", ast_taskprocessor_seq_num());
        : 	snprintf(tps_name, sizeof(tps_name) - sizeof(seq) + 1, "sorcery/%s", type);
        : 	strcat(tps_name, seq);
I've noticed that in this and other reviews, the creators of the taskprocessors are responsible for ensuring that the taskprocessor sequence number is appended to the taskprocessor name. I think it would be wise to make the taskprocessor code responsible for appending the sequence number to the name provided by the user of the taskprocessor. This way, there is no chance that a user might break expectations by not using the sequence number. It's also more "user-friendly" since the users of taskprocessors presumably shouldn't even have to know that such a sequence number exists.


-- 
To view, visit https://gerrit.asterisk.org/1957
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list