Merge of showtoken into sm?

Julien ÉLIE julien at trigofacile.com
Sun Nov 15 17:08:13 UTC 2009


Hi,

Would it be possible to integrate the contrib Perl program "showtoken"
into the main distribution?

That program decodes a token.  For instance:

% echo '@030A41555452453100000029EDC000000001@' | perl contrib/showtoken.in
@030A41555452453100000029EDC000000001@ type=cnfs class=10 buffer=AUTRE1 offset=53db8000 cycnum=1


The problem is that it has hard-coded values:

  my @types = ('trash', '', 'timehash', 'cnfs', 'timecaf', 'tradspool');
  open(MAP, "$pathspool/tradspool.map");
  printf 'time=%08lX seq=%04X file=time-%02x/%02x/%02x/%04x-%02x%02x',
         $time, $seq, $class, $b, $c, $seq, $a, $d;


I would suggest to merge it into "sm".
We would then have the same result with for instance:

% echo '@030A41555452453100000029EDC000000001@' | sm -c

It would lead to add a function like
  char * TokenExplained(const TOKEN token)
to our storage interface.  Each storage method would return the string to display.

I believe it would be more maintainable because we could put that function
just before CNFSBreakToken() or similar ones.  Thus, a change of decoding
would be reported into TokenExplained()...

showtoken is currently broken for CAF files (we changed the decoding function
in INN 2.5.1 because).


Any other suggestion?

-- 
Julien ÉLIE

« Redde Caesari quae sunt Caesaris, et quae sunt Dei Deo. »
  (saint Matthieu) 




More information about the inn-workers mailing list