Comment # 20
on bug 8414
from Evan Huus
(In reply to comment #19)
> Created attachment 10221 [details]
> Fix for cut-and-paste error
>
> Oops, the duplicate INT_VIDEOCONTROL was a cut-and-paste error. Fix attached.
>
> Re: dissector_try_uint():
>
> I debated replacing the table-driven dispatch with a simple 'switch' to
> validate the request type, since all the known requests from the last 6 or
> so years map to the same function. (i.e., table-driven dispatch is overkill
> already). I left it in because (A) I didn't know if there would be an
> objection to a simple, but rather large, switch statement, and (2) the UVC
> "ALL" requests might need different handling at some point. At the moment
> they're pretty poorly defined in the standard.
>
> But the issue with dissector_try_uint() - and packet-usb.c has this already
> - is that its return value (gboolean, success/failure) is not compatible
> with that of the caller (int, offset). I'm not quite sure why that function
> was implemented that way, but I think it limits its usefulness. Maybe it's
> an "old-style dissector" compatibility thing.
I believe it was a compatibility choice, but it's been so long we can probably
update it to return an int. Regardless, I think you can work around it with a
combination of dissector_get_uint_handle() and call_dissector_only()?
I'm short on time right now, so the above may not be 100% correct (the
signatures seem to line up at least). I will check in the fix later.
You are receiving this mail because:
- You are watching all bug changes.