diff --git a/minidlna.c b/minidlna.c index 8c2df3e..3c2371d 100644 --- a/minidlna.c +++ b/minidlna.c @@ -489,6 +489,10 @@ init(int argc, char * * argv) case 'f': i++; /* discarding, the config file is already read */ break; + case 'V': + printf("Version " MINIDLNA_VERSION "\n"); + exit(0); + break; default: fprintf(stderr, "Unknown option: %s\n", argv[i]); } @@ -512,6 +516,7 @@ init(int argc, char * * argv) "of daemon uptime.\n" "\t-B sets bitrates reported by daemon in bits per second.\n" "\t-w sets the presentation url. Default is http address on port 80\n" + "\t-V print the version number\n" "", argv[0], pidfilename); return 1; } @@ -554,8 +559,13 @@ init(int argc, char * * argv) } else { +#ifdef READYNAS + snprintf(presentationurl, PRESENTATIONURL_MAX_LEN, + "https://%s/admin/", lan_addr[0].str); +#else snprintf(presentationurl, PRESENTATIONURL_MAX_LEN, "http://%s/", lan_addr[0].str); +#endif } /* set signal handler */ @@ -609,10 +619,10 @@ main(int argc, char * * argv) return 1; #ifdef READYNAS - DPRINTF(E_WARN, L_GENERAL, "Starting ReadyDLNA...\n"); + DPRINTF(E_WARN, L_GENERAL, "Starting ReadyDLNA version " MINIDLNA_VERSION ".\n"); unlink("/ramfs/.upnp-av_scan"); #else - DPRINTF(E_WARN, L_GENERAL, "Starting MiniDLNA...\n"); + DPRINTF(E_WARN, L_GENERAL, "Starting MiniDLNA version " MINIDLNA_VERSION ".\n"); #endif LIST_INIT(&upnphttphead); diff --git a/minidlnatypes.h b/minidlnatypes.h index ef5c638..edec0d2 100644 --- a/minidlnatypes.h +++ b/minidlnatypes.h @@ -32,7 +32,7 @@ enum client_types { EXbox = 1, EPS3, ESamsungTV, - EUnknownClient + EStandardDLNA150 = 100 }; struct media_dir_s { diff --git a/upnpglobalvars.h b/upnpglobalvars.h index f3b9c11..2eabad0 100644 --- a/upnpglobalvars.h +++ b/upnpglobalvars.h @@ -15,6 +15,8 @@ #include +#define MINIDLNA_VERSION "1.0.8" + #define CLIENT_CACHE_SLOTS 20 #define USE_FORK 1 #define DB_VERSION 1 diff --git a/upnphttp.c b/upnphttp.c index 7fa5a4b..ec5e42f 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -227,7 +227,7 @@ intervening space) by either an integer or the keyword "infinite". */ } else if(strcasestr(p, "DLNADOC/1.50")) { - h->req_client = EUnknownClient; + h->req_client = EStandardDLNA150; h->reqflags |= FLAG_DLNA; } } @@ -335,7 +335,7 @@ next_header: break; } } - else if( (n < EUnknownClient) && (h->req_client == EUnknownClient) ) + else if( (n < EStandardDLNA150) && (h->req_client == EStandardDLNA150) ) { /* If we know the client, but our new detection is generic, use our cached info */ h->reqflags |= clients[n].flags;