head 1.2; access; symbols pkgsrc-2014Q4:1.1.0.18 pkgsrc-2014Q4-base:1.1 pkgsrc-2014Q3:1.1.0.16 pkgsrc-2014Q3-base:1.1 pkgsrc-2014Q2:1.1.0.14 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.12 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.10 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.8 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.6 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.4 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.2 pkgsrc-2012Q4-base:1.1; locks; strict; comment @# @; 1.2 date 2015.01.14.21.32.20; author degroote; state dead; branches; next 1.1; commitid plus0w8rPnJqp26y; 1.1 date 2012.10.15.22.48.02; author drochner; state Exp; branches; next ; desc @@ 1.2 log @Upgrade minidlan to 1.1.4 Changes since 1.0.24: 1.1.4 - Released 26-Aug-2014 -------------------------------- - Add magic container infrastructure. - Add magic containers for 50 recent items for each category. - Fix bad null termination in AAC parsing. - Fix requests for the last byte of a file, which affected MKV playback on Philips TV's. - Support 64-bit time_t values. 1.1.3 - Released 05-June-2014 -------------------------------- - Enhance log level settings. - Fix Samsung browsing when root_container is set. - Add Clang compiling support. - Fix compiling on systems without iconv. - Add merge_media_dirs option, to revert to the old behavior. - Add Asus O!Play client support. - Fix Broken SSDP multicast membership addition. - Fix crash bug with an emtpy filter argument. - Accept SMI subtitles in addition to SRT. - Add BubbleUPnP detection and enable subtitle support. - Allow the user to specify an arbitrary root container. - Add libavcodec > 54 / libav 10 compatibility. - Get embedded cover art from video files with recent libavformat versions. - Disable Samsung DCM10 capability, as it breaks compatibility with new models. - Add subtitle support for NetFront™ Living Connect middleware-based clients. 1.1.2 - Released 06-Mar-2014 -------------------------------- - Show client status on our basic presentation page. - Add a new force_sort_criteria option, to globally override the SortCriteria value sent by the client. - Fix a couple resource leaks. - Add configuration include file support. - Support DLNA/UPnP-AV searches issued by clients using the Grilo framework. - Fix some clients playing artwork instead of movie. - Fix bookmarks on Samsung Series E clients. - Add an extra folder level if there are multiple media locations. - Fix some multicast membership issues with changing network settings. - Make max number of children (connections) configurable. - Fix choppy playback with some file types on Panasonic clients by increasing the max connection limit. 1.1.1 - Released 01-Nov-2013 -------------------------------- - Add network interface monitoring support on Linux. - Don't require a configured network interface to start up. - Fix some minor spec compliance issues. 1.1.0 - Released 04-April-2013 -------------------------------- - Add support for other operating systems. - Switch to autoconf from our handcrafted genconfig.sh. - Add configuration option for UUID. - Add configuration option to specify the user to run as. - Add support for limiting a media dir to multiple media types. - Force a rescan if we detect a new or missing media_dir entry. - Fix crash caused by certain TiVo clients. - Fix crash bug on video files with some ffmpeg library versions. - Add support for TiVo MPEG-TS files. - Add some logging and forking tweaks to work better with systemd. - Validate or escape user input to prevent SQL injection. - Add forced sorting support for Panasonic devices. 1.0.25 - Released 13-July-2012 -------------------------------- - Fix a couple crash bugs on malformed WAV files. - Forcibly tweak the model number for Xbox360 clients, or they might ignore us. - Enable all network interfaces by default if none were specified. - Add flag to force downscaled thumbnails rather than using embedded ones. - Add DirecTV client detection, and fix image resolution issue. - Add support for the latest ffmpeg/libav library versions. - Fix a potential crash on requests for a resize of a non-existent image. - Make DeviceID checking more permissive for Sagem Radio. @ text @$NetBSD: patch-upnphttp,v 1.1 2012/10/15 22:48:02 drochner Exp $ --- upnphttp.c.orig 2012-06-30 00:31:43.000000000 +0000 +++ upnphttp.c @@@@ -58,7 +58,6 @@@@ #include #include #include -#include #include #include #include @@@@ -80,12 +79,18 @@@@ #include "tivo_utils.h" #include "tivo_commands.h" #endif +#if defined(__linux__) || defined(__NetBSD__) //#define MAX_BUFFER_SIZE 4194304 // 4MB -- Too much? #define MAX_BUFFER_SIZE 2147483647 // 2GB -- Too much? #define MIN_BUFFER_SIZE 65536 +#endif #include "icons.c" +#ifndef MSG_MORE /* A Linux-only flag for send(2) */ +# define MSG_MORE 0 +#endif + enum event_type { E_INVALID, E_SUBSCRIBE, @@@@ -1283,7 +1288,7 @@@@ SendResp_upnphttp(struct upnphttp * h) } } -int +static int send_data(struct upnphttp * h, char * header, size_t size, int flags) { int n; @@@@ -1306,9 +1311,10 @@@@ send_data(struct upnphttp * h, char * he return 1; } -void +static void send_file(struct upnphttp * h, int sendfd, off_t offset, off_t end_offset) { +#if defined(__linux__) || defined(__NetBSD__) off_t send_size; off_t ret; char *buf = NULL; @@@@ -1316,6 +1322,7 @@@@ send_file(struct upnphttp * h, int sendf while( offset < end_offset ) { +#if defined(__linux__) if( try_sendfile ) { send_size = ( ((end_offset - offset) < MAX_BUFFER_SIZE) ? (end_offset - offset + 1) : MAX_BUFFER_SIZE); @@@@ -1335,6 +1342,7 @@@@ send_file(struct upnphttp * h, int sendf continue; } } +#endif /* Fall back to regular I/O */ if( !buf ) buf = malloc(MIN_BUFFER_SIZE); @@@@ -1356,6 +1364,27 @@@@ send_file(struct upnphttp * h, int sendf } free(buf); } +#elif defined(__FreeBSD__) || \ + defined(__OpenBSD__) || defined(__DragonFlyBSD__) +{ + + off_t sent; + + while (offset < end_offset) + { + if (sendfile(sendfd, h->socket, offset, + end_offset - offset + 1, NULL, &sent, SF_MNOWAIT) == -1) { + DPRINTF(E_ERROR, L_HTTP, + "sendfile error :: error no. %d [%s]\n", + errno, strerror(errno)); + if (errno != EAGAIN) + break; + } + offset += sent; + + } +} +#endif void SendResp_icon(struct upnphttp * h, char * icon) @@@@ -1853,7 +1882,7 @@@@ SendResp_dlnafile(struct upnphttp * h, c char path[PATH_MAX]; char mime[32]; char dlna[96]; - } last_file = { 0, 0 }; + } last_file = { 0, 0, { '\0' }, { '\0' }, { '\0' } }; #if USE_FORK pid_t newpid = 0; #endif @ 1.1 log @import the FreeBSD port of minidlna, with minor adaptions to make it build and start up on NetBSD not tested with a real media renderer yet @ text @d1 1 a1 1 $NetBSD$ @