[mythtv-users] MythTV Frontend for Android released on Market

Raymond Wagner raymond at wagnerrp.com
Fri Feb 24 17:05:41 UTC 2012


On 2/24/2012 09:40, Mark Lord wrote:
> On 12-02-24 09:22 AM, Sven Bretfeld wrote:
> ..
>> I have only two lines:
>>
>> 2012-02-24 15:20:31.318 MainServer::HandleVersion - Client did not pass
>> protocol token. Refusing connection!
>> 2012-02-24 15:20:31.371 MainServer, Warning: Unknown socket closing
>> MythSocket(0xffffffffa9302740)
> That's due to a peculiar bit of code added post-release to 0.24,
> which wants a "magic number" as well as the correct version.
> This appears to be designed to make it difficult for out-of-tree
> code to talk to the backend.

No! No no no! That is NOT the purpose!

No sensible programmer can deny the sanity of version checks.  If you 
can't speak the profile, you shouldn't try to.  Yet that's exactly what 
happens.  Most attempts at 3rd party access to the protocol would 
blindly parrot back the version the backend responded with, without a 
care of the changes made between that version and what they actually 
internally implement.

Plus, that change went in before the 0.24 release, not after.

> So dig around in the source code, find the magic number, and pass it along.
> That number will change from time to time, creating a bit of a maintenance
> headache for no good reason.

There's no digging needed.  All the various versions are stored in a 
single file in the source for convenient viewing.

https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/mythversion.h

There's not even need to go into the source.  All the various protocol 
versions are tabulated in the wiki, with their corresponding token, 
changeset, and what commands they modified.

http://www.mythtv.org/wiki/Category:Myth_Protocol#List_of_proto_bumps

So, in order to support a new version, you have to go to that page, look 
up the matching token, and apply it to your code.  YOU SHOULD BE DOING 
THAT ANYWAY TO MAKE SURE THE CHANGE DOESN'T BREAK YOUR CODE!  That's 
such a maintenance headache, forcing people to actually attempt to 
properly follow a communications protocol.  Besides which, for 
development purposes, you can completely disable the version check 
through a compile-time define.


More information about the mythtv-users mailing list