Opened 11 years ago

Closed 3 years ago

#8094 closed Patch - Feature (Fixed)

Adjust UPnP detection to search localhost

Reported by: Raymond Wagner Owned by: stuartm
Priority: minor Milestone: 29.0
Component: MythTV - UPnP Version: Master Head
Severity: low Keywords:
Cc: Ticket locked: no


UPnP backend autodetection only works for systems given a routable address. This set of patches tries to connect the local status server on its default port ( before proceeding with the normal msearch, allowing detection of backends not using UPnP.

This change is needed for MythBuntu? to move away from a shared mysql.txt to the new config.xml in individual user directories.

Attachments (3)

python.localhost.patch (611 bytes) - added by Raymond Wagner 11 years ago.
35_try_localhost_first (3.0 KB) - added by superm1@… 11 years ago.
implementation in mythcontext
perl.localhost.patch (6.7 KB) - added by rhpot1991@… 11 years ago.
patch for perl bindings

Download all attachments as: .zip

Change History (20)

Changed 11 years ago by Raymond Wagner

Attachment: python.localhost.patch added

Changed 11 years ago by superm1@…

Attachment: 35_try_localhost_first added

implementation in mythcontext

Changed 11 years ago by rhpot1991@…

Attachment: perl.localhost.patch added

patch for perl bindings

comment:1 Changed 11 years ago by superm1@…

Just so these aren't lost (at least for the C++ implementation):

superm1> danielk22, could you comment whether looks too crackful at all during freeze - or if its at least the right direction to be headed? <danielk22> superm1: I think it's to late for that one. As for the patch itself my first concern would be that it might connect to a local master backend when you really want to the popup to choose which master to connect to. <superm1> danielk22, okay thanks. that's what i was figuring, it's just something wagnerrp me and rhpot1991 whipped together. <superm1> that's a situation i certainly didn't think about <superm1> albeit probably uncommon for anyone but a developer <danielk22> I'm not terribly fond of using something as heavyweight as UPnP for detecting backends, but it does mostly work. <superm1> do you think adding a --disable-local switch to the misc binaries using mythcontext like that would be sufficient then to prevent such a type of problem? <danielk22> superm1: Sure, but it's always good to try to address these things from the start, so hacks don't get applied on top of hacks later on. If it isn't tractable, then a switch would be fine. Maybe just a popup that ask "A local master backend was found, do you want to search for remote ones as well?" <superm1> that's a good point. i'll see about making such a popup instead then, sounds like a better solution to avoid hack upon hack being added

comment:2 Changed 10 years ago by robertm

Status: newassigned

comment:3 Changed 10 years ago by beirdo

Owner: changed from dblain to stuartm

Also related to the mysql.txt/config.xml merge. I'd be happy to work the UPnP side of this if we chose to do this, but meanwhile, I'm just keeping the related tickets together.

comment:4 Changed 10 years ago by stuartm

Milestone: unknown0.25
Status: assignedaccepted
Type: enhancementPatch - Feature
Version: headTrunk Head

comment:5 Changed 10 years ago by stuartm

These patches need updating and I think moved to more common code. The backend selection screen fails to find a local backend if the machine is firewalled because the SSDP search uses multicast, so building the local check into the upnp discovery code instead of mythcontext will be more useful.

comment:6 Changed 9 years ago by stuartm

Milestone: 0.25unknown
Status: acceptedinfoneeded

comment:7 Changed 9 years ago by stuartm

Milestone: unknown0.25
Status: infoneededassigned

I will consider Mario's patch to try localhost first for the service discovery for 0.25, I'm not able to comment on the python and perl patches.

comment:8 Changed 9 years ago by stuartm

Milestone: 0.250.26

Patch doesn't work for 0.25 and I think there's a better implementation possible if we wait for 0.26 anyway.

comment:9 Changed 8 years ago by Rune Petersen <rune@…>

It is unclear what the plan is... But if you want to use unicast UPNP M-SEARCH you should know:

  • It is not possible to receive unicast on port 1900 on windows (windows has a ssdp service, and SO_REUSEADDR with unicast is broken on windows)
  • It is possible to use an alternative port for receiving unicast UPNP M-SEARCH (the SEARCHPORT.UPNP.ORG header)

If you simply need libmythupnp to also send M-SEARCH to localhost:1900 I don't mind making a patch for this.

comment:10 Changed 8 years ago by Kenni Lund [kenni a kelu dot dk]

Milestone: 0.260.27

comment:11 Changed 8 years ago by stuartm

Owner: changed from stuartm to Raymond Wagner

comment:12 Changed 7 years ago by Raymond Wagner

Milestone: 0.27unknown

comment:13 Changed 7 years ago by stuartm

Milestone: unknown0.27.1
Owner: changed from Raymond Wagner to stuartm
Status: assignedaccepted

comment:14 Changed 6 years ago by stuartm

Status: acceptedinfoneeded

I can't remember what the "better implementation" I had in mind was. If someone wants to submit a working patch against master I'll do my very best to get it in for 0.28.

comment:15 Changed 5 years ago by Stuart Auchterlonie

Milestone: 0.280.29

Moving to 0.29

comment:16 Changed 5 years ago by Stuart Auchterlonie

Milestone: 0.2929.0

Milestone renamed

comment:17 Changed 3 years ago by Peter Bennett

Resolution: Fixed
Status: infoneededclosed

After all of the changes to networking and other things, this is no longer a bug. UPNP detection is working fine in v29 even if your master backend has only as listen address.

Note: See TracTickets for help on using tickets.