* Forcibly tweak the model number for Xbox360 clients, or they might ignore us.

This commit is contained in:
Justin Maggard 2012-04-04 18:24:21 +00:00
parent 40f3664390
commit 755c81fd34
4 changed files with 16 additions and 7 deletions

View File

@ -158,7 +158,7 @@ sigterm(int sig)
/*errno = save_errno;*/ /*errno = save_errno;*/
} }
/* record the startup time, for returning uptime */ /* record the startup time */
static void static void
set_startup_time(void) set_startup_time(void)
{ {
@ -263,6 +263,7 @@ getfriendlyname(char * buf, int len)
} }
} }
fclose(info); fclose(info);
#if PNPX
memcpy(pnpx_hwid+4, "01F2", 4); memcpy(pnpx_hwid+4, "01F2", 4);
if( strcmp(modelnumber, "NVX") == 0 ) if( strcmp(modelnumber, "NVX") == 0 )
memcpy(pnpx_hwid+17, "0101", 4); memcpy(pnpx_hwid+17, "0101", 4);
@ -285,6 +286,7 @@ getfriendlyname(char * buf, int len)
memcpy(pnpx_hwid+17, "0108", 4); memcpy(pnpx_hwid+17, "0108", 4);
else if( strcmp(modelnumber, "NV+ v2") == 0 ) else if( strcmp(modelnumber, "NV+ v2") == 0 )
memcpy(pnpx_hwid+17, "0109", 4); memcpy(pnpx_hwid+17, "0109", 4);
#endif
#else #else
char * logname; char * logname;
logname = getenv("LOGNAME"); logname = getenv("LOGNAME");

View File

@ -47,7 +47,6 @@ static const struct {
{ UPNPPORT, "port" }, { UPNPPORT, "port" },
{ UPNPPRESENTATIONURL, "presentation_url" }, { UPNPPRESENTATIONURL, "presentation_url" },
{ UPNPNOTIFY_INTERVAL, "notify_interval" }, { UPNPNOTIFY_INTERVAL, "notify_interval" },
{ UPNPSYSTEM_UPTIME, "system_uptime" },
{ UPNPUUID, "uuid"}, { UPNPUUID, "uuid"},
{ UPNPSERIAL, "serial"}, { UPNPSERIAL, "serial"},
{ UPNPMODEL_NAME, "model_name"}, { UPNPMODEL_NAME, "model_name"},

View File

@ -40,7 +40,6 @@ enum upnpconfigoptions {
UPNPPORT, /* port */ UPNPPORT, /* port */
UPNPPRESENTATIONURL, /* presentation_url */ UPNPPRESENTATIONURL, /* presentation_url */
UPNPNOTIFY_INTERVAL, /* notify_interval */ UPNPNOTIFY_INTERVAL, /* notify_interval */
UPNPSYSTEM_UPTIME, /* system_uptime */
UPNPUUID, /* uuid */ UPNPUUID, /* uuid */
UPNPSERIAL, /* serial */ UPNPSERIAL, /* serial */
UPNPMODEL_NAME, /* model_name */ UPNPMODEL_NAME, /* model_name */

View File

@ -926,12 +926,21 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
if(strcmp(ROOTDESC_PATH, HttpUrl) == 0) if(strcmp(ROOTDESC_PATH, HttpUrl) == 0)
{ {
/* If it's a Xbox360, we might need a special friendly_name to be recognized */ /* If it's a Xbox360, we might need a special friendly_name to be recognized */
if( (h->req_client == EXbox) && !strchr(friendly_name, ':') ) if( h->req_client == EXbox )
{ {
i = strlen(friendly_name); char model_sav[2];
snprintf(friendly_name+i, FRIENDLYNAME_MAX_LEN-i, ": 1"); i = 0;
memcpy(model_sav, modelnumber, 2);
strcpy(modelnumber, "1");
if( !strchr(friendly_name, ':') )
{
i = strlen(friendly_name);
snprintf(friendly_name+i, FRIENDLYNAME_MAX_LEN-i, ": 1");
}
sendXMLdesc(h, genRootDesc); sendXMLdesc(h, genRootDesc);
friendly_name[i] = '\0'; if( i )
friendly_name[i] = '\0';
memcpy(modelnumber, model_sav, 2);
} }
else if( h->reqflags & FLAG_SAMSUNG_TV ) else if( h->reqflags & FLAG_SAMSUNG_TV )
{ {