aboutsummaryrefslogtreecommitdiff
path: root/lib/libUPnP/Platinum/Source
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libUPnP/Platinum/Source')
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MediaCrawler/MediaCrawler.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MediaCrawler/StreamHandler.h5
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MicroMediaController/PltMicroMediaController.h3
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MicroMediaController/main.cpp12
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.h17
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.m45
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/LaunchScreen.xib41
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/Main.storyboard25
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.h14
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.mm70
-rw-r--r--lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/main.m16
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp26
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltDatagramStream.cpp7
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltDeviceData.cpp3
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp11
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltEvent.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltHttp.cpp114
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltHttp.h67
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltHttpClientTask.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp3
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltIconsData.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltMimeType.cpp16
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltProtocolInfo.cpp6
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltSsdp.cpp10
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltTaskManager.cpp4
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltTaskManager.h1
-rw-r--r--lib/libUPnP/Platinum/Source/Core/PltUPnP.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaConnect/PltMediaConnect.cpp9
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaConnect/X_MS_MediaReceiverRegistrarSCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaRenderer/AVTransportSCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RdrConnectionManagerSCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RenderingControlSCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaServer/ConnectionManagerSCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorySCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorywSearchSCPD.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Devices/MediaServer/PltFileMediaServer.cpp4
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.h17
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.mm64
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.h12
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.mm52
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/PltDownloader.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/PltFrameServer.cpp5
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/PltRingBufferStream.h4
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/PltStreamPump.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Extras/PltStreamPump.h3
-rw-r--r--lib/libUPnP/Platinum/Source/Platform/Android/module/platinum/jni/Android.mk5
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/Http/HttpTest.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/LightSample/LightSampleTest.cpp3
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/LightSample/PltLightSample.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTestController.mm8
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTest_AppDelegate.mm21
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/Simple/PltSimple.cpp2
-rw-r--r--lib/libUPnP/Platinum/Source/Tests/Ssdp/SsdpTest1.cpp1
55 files changed, 445 insertions, 317 deletions
diff --git a/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/MediaCrawler.cpp b/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/MediaCrawler.cpp
index 95593b8dba..ed0c726399 100644
--- a/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/MediaCrawler.cpp
+++ b/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/MediaCrawler.cpp
@@ -495,7 +495,7 @@ CMediaCrawler::ProcessFileRequest(NPT_HttpRequest& request,
{
NPT_COMPILER_UNUSED(context);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINE, "CMediaCrawler::ProcessFileRequest:", &request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINE, "CMediaCrawler::ProcessFileRequest:", &request);
if (request.GetMethod().Compare("GET", true) && request.GetMethod().Compare("HEAD", true)) {
response.SetStatus(500, "Internal Server Error");
diff --git a/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/StreamHandler.h b/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/StreamHandler.h
index 6042a983c6..1f03fde2d0 100644
--- a/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/StreamHandler.h
+++ b/lib/libUPnP/Platinum/Source/Apps/MediaCrawler/StreamHandler.h
@@ -38,10 +38,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
-#include "NptStreams.h"
-#include "NptStrings.h"
-#include "NptTime.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| forward declarations
diff --git a/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/PltMicroMediaController.h b/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/PltMicroMediaController.h
index 77a91a1ff2..c5b17bfb3f 100644
--- a/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/PltMicroMediaController.h
+++ b/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/PltMicroMediaController.h
@@ -42,8 +42,7 @@
#include "PltMediaServer.h"
#include "PltSyncMediaBrowser.h"
#include "PltMediaController.h"
-#include "NptMap.h"
-#include "NptStack.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| definitions
diff --git a/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/main.cpp b/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/main.cpp
index 20e5e32585..4813db0dfd 100644
--- a/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/main.cpp
+++ b/lib/libUPnP/Platinum/Source/Apps/MicroMediaController/main.cpp
@@ -57,7 +57,7 @@
int main(void)
{
// setup Neptune logging
- NPT_LogManager::GetDefault().Configure("plist:.level=FINE;.handlers=ConsoleHandler;.ConsoleHandler.colors=off;.ConsoleHandler.filter=24");
+ NPT_LogManager::GetDefault().Configure("plist:.level=INFO;.handlers=ConsoleHandler;.ConsoleHandler.colors=off;.ConsoleHandler.filter=24");
// Create upnp engine
PLT_UPnP upnp;
@@ -101,9 +101,9 @@ int main(void)
#ifdef SIMULATE_XBOX_360
// override default headers
- NPT_HttpClient::m_UserAgentHeader = "Xbox/2.0.8955.0 UPnP/1.0 Xbox/2.0.8955.0";
- NPT_HttpServer::m_ServerHeader = "Xbox/2.0.8955.0 UPnP/1.0 Xbox/2.0.8955.0";
-
+ PLT_Constants::GetInstance().SetDefaultUserAgent("Xbox/2.0.8955.0 UPnP/1.0 Xbox/2.0.8955.0");
+// NPT_HttpServer::m_ServerHeader = "Xbox/2.0.8955.0 UPnP/1.0 Xbox/2.0.8955.0";
+
// create device
PLT_DeviceHostReference xbox(new PLT_Xbox360("30848576-1775-2000-0000-00125a8fefad"));
xbox->SetByeByeFirst(false);
@@ -119,10 +119,10 @@ int main(void)
ctrlPoint->Search(
NPT_HttpUrl("239.255.255.250", 1900, "*"),
- "urn:schemas-microsoft-com:service:MSContentDirectory:1", 2, 10000, NPT_TimeInterval(10, 0));
+ "urn:schemas-microsoft-com:service:MSContentDirectory:1", 2, NPT_TimeInterval(10.), NPT_TimeInterval(10.));
ctrlPoint->Search(
NPT_HttpUrl("239.255.255.250", 1900, "*"),
- "urn:schemas-upnp-org:service:ContentDirectory:1", 2, 10000, NPT_TimeInterval(10, 0));
+ "urn:schemas-upnp-org:service:ContentDirectory:1", 2, NPT_TimeInterval(10.), NPT_TimeInterval(10.));
#endif
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.h b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.h
new file mode 100644
index 0000000000..4c061b4c76
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.h
@@ -0,0 +1,17 @@
+//
+// AppDelegate.h
+// MobileMediaServer
+//
+// Created by Sylvain Rebaud on 3/10/15.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+
+@end
+
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.m b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.m
new file mode 100644
index 0000000000..49e7db5c4d
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/AppDelegate.m
@@ -0,0 +1,45 @@
+//
+// AppDelegate.m
+// MobileMediaServer
+//
+// Created by Sylvain Rebaud on 3/10/15.
+//
+//
+
+#import "AppDelegate.h"
+
+@interface AppDelegate ()
+
+@end
+
+@implementation AppDelegate
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+ // Override point for customization after application launch.
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/LaunchScreen.xib b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/LaunchScreen.xib
new file mode 100644
index 0000000000..92aedf8254
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/LaunchScreen.xib
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14D127a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
+ <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
+ </dependencies>
+ <objects>
+ <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+ <view contentMode="scaleToFill" id="iN0-l3-epB">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
+ <rect key="frame" x="20" y="439" width="441" height="21"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MobileMediaServer" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
+ <rect key="frame" x="20" y="140" width="441" height="43"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
+ <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
+ <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
+ <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
+ <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
+ <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
+ </constraints>
+ <nil key="simulatedStatusBarMetrics"/>
+ <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+ <point key="canvasLocation" x="548" y="455"/>
+ </view>
+ </objects>
+</document>
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/Main.storyboard b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/Main.storyboard
new file mode 100644
index 0000000000..f56d2f3bb5
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/Main.storyboard
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="tne-QT-ifu">
+ <objects>
+ <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+ <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+ </objects>
+ </scene>
+ </scenes>
+</document>
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.h b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.h
new file mode 100644
index 0000000000..9f253abdd2
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.h
@@ -0,0 +1,14 @@
+//
+// ViewController.h
+// MobileMediaServer
+//
+// Created by Sylvain Rebaud on 3/10/15.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ViewController : UIViewController
+
+@end
+
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.mm b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.mm
new file mode 100644
index 0000000000..33d715c49a
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/ViewController.mm
@@ -0,0 +1,70 @@
+//
+// ViewController.m
+// MobileMediaServer
+//
+// Created by Sylvain Rebaud on 3/10/15.
+//
+//
+
+#import "ViewController.h"
+#import <Neptune/Neptune.h>
+#import <Platinum/PltUPnPObject.h>
+#import <Platinum/PltMediaServerObject.h>
+
+@interface ViewController () <PLT_MediaServerDelegateObject>
+
+@property (nonatomic) PLT_UPnPObject* upnp;
+
+@end
+
+@implementation ViewController
+
++ (void)initialize {
+ NPT_LogManager::GetDefault().Configure("plist:.level=INFO;.handlers=ConsoleHandler;.ConsoleHandler.outputs=1;.ConsoleHandler.filter=61");
+}
+
+- (void)awakeFromNib {
+ self.upnp = [[PLT_UPnPObject alloc] init];
+
+ // create server and add ourselves as the delegate
+ PLT_MediaServerObject* server = [[PLT_MediaServerObject alloc] init];
+ server.delegate = self;
+
+ [self.upnp addDevice:server];
+}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ // Do any additional setup after loading the view, typically from a nib.
+ [self.upnp start];
+}
+
+- (void)didReceiveMemoryWarning {
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+#pragma mark - PLT_MediaServerDelegateObject
+
+- (NPT_Result)onBrowseMetadata:(PLT_MediaServerBrowseCapsule*)info
+{
+ return NPT_FAILURE;
+}
+
+- (NPT_Result)onBrowseDirectChildren:(PLT_MediaServerBrowseCapsule*)info
+{
+ return NPT_FAILURE;
+}
+
+- (NPT_Result)onSearchContainer:(PLT_MediaServerSearchCapsule*)info
+{
+ return NPT_FAILURE;
+}
+
+- (NPT_Result)onFileRequest:(PLT_MediaServerFileRequestCapsule*)info
+{
+ return NPT_FAILURE;
+}
+
+@end
diff --git a/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/main.m b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/main.m
new file mode 100644
index 0000000000..31847c9f3d
--- /dev/null
+++ b/lib/libUPnP/Platinum/Source/Apps/MobileMediaServer/main.m
@@ -0,0 +1,16 @@
+//
+// main.m
+// MobileMediaServer
+//
+// Created by Sylvain Rebaud on 3/10/15.
+//
+//
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
diff --git a/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp b/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp
index 2871facfb1..bae654572c 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp
@@ -235,6 +235,7 @@ public:
PLT_CtrlPoint::PLT_CtrlPoint(const char* search_criteria /* = "upnp:rootdevice" */) :
m_EventHttpServer(NULL),
m_TaskManager(NULL),
+ m_Lock(true),
m_SearchCriteria(search_criteria),
m_Started(false)
{
@@ -371,7 +372,7 @@ PLT_CtrlPoint::CreateSearchTask(const NPT_HttpUrl& url,
if (mx<1) mx=1;
// create socket
- NPT_Reference<NPT_UdpMulticastSocket> socket(new NPT_UdpMulticastSocket());
+ NPT_Reference<NPT_UdpMulticastSocket> socket(new NPT_UdpMulticastSocket(NPT_SOCKET_FLAG_CANCELLABLE));
socket->SetInterface(address);
socket->SetTimeToLive(PLT_Constants::GetInstance().GetSearchMulticastTimeToLive());
@@ -472,7 +473,7 @@ PLT_CtrlPoint::Discover(const NPT_HttpUrl& url,
if (mx<1) mx = 1;
// create socket
- NPT_UdpSocket* socket = new NPT_UdpSocket();
+ NPT_UdpSocket* socket = new NPT_UdpSocket(NPT_SOCKET_FLAG_CANCELLABLE);
// create request
NPT_HttpRequest* request = new NPT_HttpRequest(url, "M-SEARCH", NPT_HTTP_PROTOCOL_1_1);
@@ -871,7 +872,7 @@ PLT_CtrlPoint::ProcessPendingEventNotifications()
service = sub->GetService();
// Reprocess notification
- NPT_LOG_WARNING_1("Reprocessing delayed notification for subscriber", (const char*)notification->m_SID);
+ NPT_LOG_WARNING_1("Reprocessing delayed notification for subscriber %s", (const char*)notification->m_SID);
NPT_Result result = ProcessEventNotification(sub, notification, vars);
delete notification;
@@ -904,7 +905,7 @@ PLT_CtrlPoint::ProcessHttpNotify(const NPT_HttpRequest& request,
PLT_EventSubscriberReference sub;
NPT_Result result;
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, "PLT_CtrlPoint::ProcessHttpNotify:", request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINER, "PLT_CtrlPoint::ProcessHttpNotify:", &request);
// Create notification from request
PLT_EventNotification* notification = PLT_EventNotification::Parse(request, context, response);
@@ -962,7 +963,7 @@ PLT_CtrlPoint::ProcessSsdpSearchResponse(NPT_Result res,
NPT_String prefix = NPT_String::Format("PLT_CtrlPoint::ProcessSsdpSearchResponse from %s:%d",
(const char*)context.GetRemoteAddress().GetIpAddress().ToString() ,
context.GetRemoteAddress().GetPort());
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, prefix, response);
// any 2xx responses are ok
if (response->GetStatusCode()/100 == 2) {
@@ -1033,7 +1034,7 @@ PLT_CtrlPoint::ProcessSsdpNotify(const NPT_HttpRequest& request,
context.GetRemoteAddress().GetIpAddress().ToString().GetChars(),
context.GetRemoteAddress().GetPort(),
usn?usn->GetChars():"unknown");
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINER, prefix, &request);
if ((uri.Compare("*") != 0) || (protocol.Compare("HTTP/1.1") != 0))
return NPT_FAILURE;
@@ -1341,7 +1342,7 @@ PLT_CtrlPoint::ProcessGetDescriptionResponse(NPT_Result res,
NPT_CHECK_POINTER_LABEL_FATAL(response, bad_response);
// log response
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, prefix, response);
// get response body
res = PLT_HttpHelper::GetBody(*response, desc);
@@ -1418,7 +1419,7 @@ PLT_CtrlPoint::ProcessGetSCPDResponse(NPT_Result res,
NPT_CHECK_LABEL_FATAL(res, bad_response);
NPT_CHECK_POINTER_LABEL_FATAL(response, bad_response);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, prefix, response);
// make sure root device hasn't disappeared
NPT_CHECK_LABEL_WARNING(FindDevice(device->GetUUID(), root_device, true),
@@ -1608,7 +1609,7 @@ PLT_CtrlPoint::ProcessSubscribeResponse(NPT_Result res,
NPT_AutoLock lock(m_Lock);
const NPT_String* sid = NULL;
- NPT_Int32 seconds;
+ NPT_Int32 seconds = -1;
PLT_EventSubscriberReference sub;
bool subscription = (request.GetMethod().ToUppercase() == "SUBSCRIBE");
@@ -1617,7 +1618,7 @@ PLT_CtrlPoint::ProcessSubscribeResponse(NPT_Result res,
(const char*)service->GetServiceID(),
res,
response?response->GetStatusCode():0);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, prefix, response);
// if there's a failure or it's a response to a cancellation
// we get out (any 2xx status code ok)
@@ -1731,6 +1732,8 @@ PLT_CtrlPoint::ProcessActionResponse(NPT_Result res,
PLT_ActionReference& action,
void* userdata)
{
+ NPT_COMPILER_UNUSED(request);
+
NPT_String service_type;
NPT_String str;
NPT_XmlElementNode* xml = NULL;
@@ -1748,6 +1751,7 @@ PLT_CtrlPoint::ProcessActionResponse(NPT_Result res,
// check context validity
if (NPT_FAILED(res) || response == NULL) {
PLT_Service* service = action_desc.GetService();
+ NPT_COMPILER_UNUSED(service);
NPT_LOG_WARNING_4("Failed to reach %s for %s.%s (%d)",
request.GetUrl().ToString().GetChars(),
service->GetDevice()->GetUUID().GetChars(),
@@ -1756,7 +1760,7 @@ PLT_CtrlPoint::ProcessActionResponse(NPT_Result res,
goto failure;
}
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, "PLT_CtrlPoint::ProcessActionResponse:", response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, "PLT_CtrlPoint::ProcessActionResponse:", response);
NPT_LOG_FINER("Reading/Parsing Action Response Body...");
if (NPT_FAILED(PLT_HttpHelper::ParseBody(*response, xml))) {
diff --git a/lib/libUPnP/Platinum/Source/Core/PltDatagramStream.cpp b/lib/libUPnP/Platinum/Source/Core/PltDatagramStream.cpp
index 431a50afc2..6138007e67 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltDatagramStream.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltDatagramStream.cpp
@@ -36,6 +36,9 @@
| includes
+---------------------------------------------------------------------*/
#include "PltDatagramStream.h"
+#include "NptLogging.h"
+
+NPT_SET_LOCAL_LOGGER("platinum.inputdatagramstream")
/*----------------------------------------------------------------------
| PLT_InputDatagramStream::PLT_InputDatagramStream
@@ -76,6 +79,8 @@ PLT_InputDatagramStream::Read(void* buffer,
// update info
m_Socket->GetInfo(m_Info);
m_Info.remote_address = addr;
+
+ NPT_LOG_FINE_1("PLT_InputDatagramStream received %d", m_Buffer.GetDataSize());
}
if (bytes_to_read == 0) return res;
@@ -93,6 +98,8 @@ PLT_InputDatagramStream::Read(void* buffer,
m_BufferOffset = 0;
m_Buffer.SetDataSize(0);
}
+
+ NPT_LOG_FINE_3("PLT_InputDatagramStream requested %d, consumed %d, left %d", bytes_to_read, _bytes_to_read, m_Buffer.GetDataSize());
}
return res;
diff --git a/lib/libUPnP/Platinum/Source/Core/PltDeviceData.cpp b/lib/libUPnP/Platinum/Source/Core/PltDeviceData.cpp
index 747779a3e9..a092b77833 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltDeviceData.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltDeviceData.cpp
@@ -57,8 +57,7 @@ PLT_DeviceData::PLT_DeviceData(NPT_HttpUrl description_url,
m_DeviceType(device_type),
m_FriendlyName(friendly_name),
m_BootId(0),
- m_NextBootId(0),
- m_ConfigId(-1)
+ m_NextBootId(0)
{
if (uuid == NULL || strlen(uuid) == 0) {
PLT_UPnPMessageHelper::GenerateGUID(m_UUID);
diff --git a/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp b/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
index 6fbe7a7fd5..b6de5c202d 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
@@ -392,7 +392,7 @@ PLT_DeviceHost::SetupResponse(NPT_HttpRequest& request,
NPT_String method = request.GetMethod();
NPT_String protocol = request.GetProtocol();
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, "PLT_DeviceHost::SetupResponse:", &request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINER, "PLT_DeviceHost::SetupResponse:", &request);
if (method.Compare("POST") == 0) {
return ProcessHttpPostRequest(request, context, response);
@@ -807,7 +807,7 @@ PLT_DeviceHost::OnSsdpPacket(const NPT_HttpRequest& request,
NPT_String prefix = NPT_String::Format("PLT_DeviceHost::OnSsdpPacket M-SEARCH for %s from %s:%d",
st?st->GetChars():"Unknown",
(const char*) ip_address, remote_port);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINE, prefix, &request);
/*
// DLNA 7.2.3.5 support
@@ -836,7 +836,12 @@ PLT_DeviceHost::OnSsdpPacket(const NPT_HttpRequest& request,
PLT_SsdpDeviceSearchResponseTask* task = new PLT_SsdpDeviceSearchResponseTask(this, context.GetRemoteAddress(), *st);
m_TaskManager->StartTask(task, &timer);
return NPT_SUCCESS;
- }
+ } else {
+ NPT_String prefix = NPT_String::Format("Ignoring %s request from %s:%d",
+ method.GetChars(),
+ (const char*) ip_address, remote_port);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINE, prefix, &request);
+ }
return NPT_FAILURE;
}
diff --git a/lib/libUPnP/Platinum/Source/Core/PltEvent.cpp b/lib/libUPnP/Platinum/Source/Core/PltEvent.cpp
index 0defb73c30..7bc699baf3 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltEvent.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltEvent.cpp
@@ -55,7 +55,7 @@ PLT_EventNotification::Parse(const NPT_HttpRequest& request,
{
NPT_COMPILER_UNUSED(context);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, "PLT_CtrlPoint::ProcessHttpNotify:", request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINER, "PLT_CtrlPoint::ProcessHttpNotify:", &request);
PLT_EventNotification *notification = new PLT_EventNotification();
notification->m_RequestUrl = request.GetUrl();
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttp.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttp.cpp
index 644859917c..41159bed5b 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltHttp.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltHttp.cpp
@@ -69,28 +69,6 @@ class NPT_HttpHeaderFinder
};
/*----------------------------------------------------------------------
-| NPT_HttpHeaderPrinter
-+---------------------------------------------------------------------*/
-class NPT_HttpHeaderPrinter
-{
-public:
- // methods
- NPT_HttpHeaderPrinter(NPT_OutputStreamReference& stream) :
- m_Stream(stream) {}
- NPT_Result operator()(NPT_HttpHeader*& header) const {
- m_Stream->WriteString(header->GetName());
- m_Stream->Write(": ", 2);
- m_Stream->WriteString(header->GetValue());
- m_Stream->Write("\r\n", 2, NULL);
- return NPT_SUCCESS;
- }
-
-private:
- // members
- NPT_OutputStreamReference& m_Stream;
-};
-
-/*----------------------------------------------------------------------
| NPT_HttpHeaderLogger
+---------------------------------------------------------------------*/
class NPT_HttpHeaderLogger
@@ -321,48 +299,6 @@ PLT_HttpHelper::SetHost(NPT_HttpRequest& request, const char* host)
}
/*----------------------------------------------------------------------
-| PLT_HttpHelper::ToLog
-+---------------------------------------------------------------------*/
-NPT_Result
-PLT_HttpHelper::ToLog(NPT_LoggerReference logger,
- int level,
- const char* prefix,
- NPT_HttpRequest* request)
-{
- if (!request) {
- NPT_LOG_L(logger, level, "NULL HTTP Request!");
- return NPT_FAILURE;
- }
-
- return ToLog(logger, level, prefix, *request);
-}
-
-/*----------------------------------------------------------------------
-| PLT_HttpHelper::ToLog
-+---------------------------------------------------------------------*/
-NPT_Result
-PLT_HttpHelper::ToLog(NPT_LoggerReference logger,
- int level,
- const char* prefix,
- const NPT_HttpRequest& request)
-{
- NPT_COMPILER_UNUSED(logger);
- NPT_COMPILER_UNUSED(level);
-
- NPT_StringOutputStreamReference stream(new NPT_StringOutputStream);
- NPT_OutputStreamReference output = stream;
- request.GetHeaders().GetHeaders().Apply(NPT_HttpHeaderPrinter(output));
-
- NPT_LOG_L5(logger, level, "%s\n%s %s %s\n%s",
- prefix,
- (const char*)request.GetMethod(),
- (const char*)request.GetUrl().ToRequestString(true),
- (const char*)request.GetProtocol(),
- (const char*)stream->GetString());
- return NPT_SUCCESS;
-}
-
-/*----------------------------------------------------------------------
| PLT_HttpHelper::GetDeviceSignature
+---------------------------------------------------------------------*/
PLT_DeviceSignature
@@ -371,10 +307,14 @@ PLT_HttpHelper::GetDeviceSignature(const NPT_HttpRequest& request)
const NPT_String* agent = request.GetHeaders().GetHeaderValue(NPT_HTTP_HEADER_USER_AGENT);
const NPT_String* hdr = request.GetHeaders().GetHeaderValue("X-AV-Client-Info");
const NPT_String* server = request.GetHeaders().GetHeaderValue(NPT_HTTP_HEADER_SERVER);
+ const NPT_String* dlna_friendly_name = request.GetHeaders().GetHeaderValue("FriendlyName.DLNA.ORG");
+ NPT_LOG_FINEST_2("agent: %s, server: %s", agent?agent->GetChars():"none", server?server->GetChars():"none");
if ((agent && (agent->Find("XBox", 0, true) >= 0 || agent->Find("Xenon", 0, true) >= 0)) ||
(server && server->Find("Xbox", 0, true) >= 0)) {
- return PLT_DEVICE_XBOX;
+ return PLT_DEVICE_XBOX_360;
+ } else if(dlna_friendly_name && (dlna_friendly_name->Find("XBOX-ONE", 0, true) >= 0)) {
+ return PLT_DEVICE_XBOX_ONE;
} else if (agent && (agent->Find("Windows Media Player", 0, true) >= 0 || agent->Find("Windows-Media-Player", 0, true) >= 0 || agent->Find("Mozilla/4.0", 0, true) >= 0 || agent->Find("WMFSDK", 0, true) >= 0)) {
return PLT_DEVICE_WMP;
} else if (agent && (agent->Find("Sonos", 0, true) >= 0)) {
@@ -389,55 +329,13 @@ PLT_HttpHelper::GetDeviceSignature(const NPT_HttpRequest& request)
} else if (agent && (agent->Find("VLC", 0, true) >= 0 || agent->Find("VideoLan", 0, true) >= 0)) {
return PLT_DEVICE_VLC;
} else {
- NPT_LOG_FINER_1("Unknown device signature (ua=%s)", agent?agent->GetChars():"none");
+ NPT_LOG_FINER_2("Unknown device signature (ua=%s, server=%s)", agent?agent->GetChars():"none", server?server->GetChars():"none");
}
return PLT_DEVICE_UNKNOWN;
}
/*----------------------------------------------------------------------
-| NPT_HttpResponse::ToLog
-+---------------------------------------------------------------------*/
-NPT_Result
-PLT_HttpHelper::ToLog(NPT_LoggerReference logger,
- int level,
- const char* prefix,
- NPT_HttpResponse* response)
-{
- if (!response) {
- NPT_LOG_L(logger, level, "NULL HTTP Response!");
- return NPT_FAILURE;
- }
-
- return ToLog(logger, level, prefix, *response);
-}
-
-/*----------------------------------------------------------------------
-| NPT_HttpResponse::ToLog
-+---------------------------------------------------------------------*/
-NPT_Result
-PLT_HttpHelper::ToLog(NPT_LoggerReference logger,
- int level,
- const char* prefix,
- const NPT_HttpResponse& response)
-{
- NPT_COMPILER_UNUSED(logger);
- NPT_COMPILER_UNUSED(level);
-
- NPT_StringOutputStreamReference stream(new NPT_StringOutputStream);
- NPT_OutputStreamReference output = stream;
- response.GetHeaders().GetHeaders().Apply(NPT_HttpHeaderPrinter(output));
-
- NPT_LOG_L5(logger, level, "%s\n%s %d %s\n%s",
- prefix,
- (const char*)response.GetProtocol(),
- response.GetStatusCode(),
- (const char*)response.GetReasonPhrase(),
- (const char*)stream->GetString());
- return NPT_SUCCESS;
-}
-
-/*----------------------------------------------------------------------
| PLT_HttpHelper::SetBasicAuthorization
+---------------------------------------------------------------------*/
void
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttp.h b/lib/libUPnP/Platinum/Source/Core/PltHttp.h
index 00e2b9f570..7c03c28d7d 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltHttp.h
+++ b/lib/libUPnP/Platinum/Source/Core/PltHttp.h
@@ -61,7 +61,8 @@
+---------------------------------------------------------------------*/
typedef enum {
PLT_DEVICE_UNKNOWN,
- PLT_DEVICE_XBOX,
+ PLT_DEVICE_XBOX_360,
+ PLT_DEVICE_XBOX_ONE,
PLT_DEVICE_PS3,
PLT_DEVICE_WMP,
PLT_DEVICE_SONOS,
@@ -82,11 +83,6 @@ public:
static bool IsConnectionKeepAlive(NPT_HttpMessage& message);
static bool IsBodyStreamSeekable(NPT_HttpMessage& message);
- static NPT_Result ToLog(NPT_LoggerReference logger, int level, const char* prefix, NPT_HttpRequest* request);
- static NPT_Result ToLog(NPT_LoggerReference logger, int level, const char* prefix, const NPT_HttpRequest& request);
- static NPT_Result ToLog(NPT_LoggerReference logger, int level, const char* prefix, NPT_HttpResponse* response);
- static NPT_Result ToLog(NPT_LoggerReference logger, int level, const char* prefix, const NPT_HttpResponse& response);
-
static NPT_Result GetContentType(const NPT_HttpMessage& message, NPT_String& type);
static NPT_Result GetContentLength(const NPT_HttpMessage& message, NPT_LargeSize& len);
@@ -130,17 +126,64 @@ private:
};
/*----------------------------------------------------------------------
+| NPT_HttpHeaderPrinter
++---------------------------------------------------------------------*/
+class NPT_HttpHeaderPrinter
+{
+public:
+ // methods
+ NPT_HttpHeaderPrinter(NPT_OutputStreamReference& stream) :
+ m_Stream(stream) {}
+ NPT_Result operator()(NPT_HttpHeader*& header) const {
+ m_Stream->WriteString(header->GetName());
+ m_Stream->Write(": ", 2);
+ m_Stream->WriteString(header->GetValue());
+ m_Stream->Write("\r\n", 2, NULL);
+ return NPT_SUCCESS;
+ }
+
+private:
+ // members
+ NPT_OutputStreamReference& m_Stream;
+};
+
+/*----------------------------------------------------------------------
| macros
+---------------------------------------------------------------------*/
#if defined(NPT_CONFIG_ENABLE_LOGGING)
-#define PLT_LOG_HTTP_MESSAGE_L(_logger, _level, _prefix, _msg) \
- PLT_HttpHelper::ToLog((_logger), (_level), (_prefix), (_msg))
-#define PLT_LOG_HTTP_MESSAGE(_level, _prefix, _msg) \
- PLT_HttpHelper::ToLog((_NPT_LocalLogger), (_level), (_prefix), (_msg))
+#define PLT_LOG_HTTP_REQUEST_L(_logger, _level, _prefix, _request) \
+do { \
+ if (!_request) break; \
+ NPT_LOG_GET_LOGGER((_logger)) \
+ if ((_logger).logger && (_level) >= (_logger).logger->GetLevel()) { \
+ NPT_StringOutputStreamReference stream(new NPT_StringOutputStream); \
+ NPT_OutputStreamReference output = stream; \
+ _request->GetHeaders().GetHeaders().Apply(NPT_HttpHeaderPrinter(output)); \
+ NPT_LOG_X((_logger),(_level),((_level),__FILE__,__LINE__,(NPT_LocalFunctionName),"%s\n%s %s %s\n%s", (const char*)_prefix, (const char*)_request->GetMethod(), (const char*)_request->GetUrl().ToRequestString(true), (const char*)_request->GetProtocol(), (const char*)stream->GetString())); \
+ } \
+} while (0)
+
+#define PLT_LOG_HTTP_RESPONSE_L(_logger, _level, _prefix, _response) \
+do { \
+ if (!_response) break; \
+ NPT_LOG_GET_LOGGER((_logger)) \
+ if ((_logger).logger && (_level) >= (_logger).logger->GetLevel()) { \
+ NPT_StringOutputStreamReference stream(new NPT_StringOutputStream); \
+ NPT_OutputStreamReference output = stream; \
+ _response->GetHeaders().GetHeaders().Apply(NPT_HttpHeaderPrinter(output)); \
+ NPT_LOG_X((_logger),(_level),((_level),__FILE__,__LINE__,(NPT_LocalFunctionName),"%s\n%s %d %s\n%s", (const char*)_prefix, (const char*)_response->GetProtocol(), _response->GetStatusCode(), (const char*)_response->GetReasonPhrase(), (const char*)stream->GetString())); \
+ } \
+} while (0)
+
+#define PLT_LOG_HTTP_REQUEST(_level,_prefix,_request) PLT_LOG_HTTP_REQUEST_L(_NPT_LocalLogger,(_level),(_prefix),(_request))
+
+#define PLT_LOG_HTTP_RESPONSE(_level,_prefix,_response) PLT_LOG_HTTP_RESPONSE_L(_NPT_LocalLogger,(_level),(_prefix),(_response))
#else /* NPT_CONFIG_ENABLE_LOGGING */
-#define PLT_LOG_HTTP_MESSAGE_L(_logger, _level, _prefix, _msg)
-#define PLT_LOG_HTTP_MESSAGE(_level, _prefix, _msg)
+#define PLT_LOG_HTTP_REQUEST_L(_logger, _level, _prefix, _request)
+#define PLT_LOG_HTTP_RESPONSE_L(_logger, _level, _prefix, _response)
+#define PLT_LOG_HTTP_REQUEST(_level,_prefix,_request)
+#define PLT_LOG_HTTP_RESPONSE(_level,_prefix,_response)
#endif /* NPT_CONFIG_ENABLE_LOGGING */
/*----------------------------------------------------------------------
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpClientTask.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpClientTask.cpp
index a2547bce11..82c4acd39a 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltHttpClientTask.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltHttpClientTask.cpp
@@ -125,7 +125,7 @@ PLT_HttpClientSocketTask::DoRun()
res = m_Client.SendRequest(*request, response, &context);
NPT_String prefix = NPT_String::Format("PLT_HttpClientSocketTask::DoRun (res = %d):", res);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, prefix, response);
// process response
ProcessResponse(res, *request, context, response);
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp
index 89f568eb26..3d9180c6a3 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltHttpServer.cpp
@@ -53,6 +53,7 @@ PLT_HttpServer::PLT_HttpServer(NPT_IpAddress address,
bool allow_random_port_on_bind_failure, /* = false */
NPT_Cardinal max_clients, /* = 50 */
bool reuse_address) : /* = false */
+ NPT_HttpServer(address, port, true),
m_TaskManager(new PLT_TaskManager(max_clients)),
m_Address(address),
m_Port(port),
@@ -159,7 +160,7 @@ PLT_HttpServer::SetupResponse(NPT_HttpRequest& request,
(const char*) request.GetMethod(),
(const char*) context.GetRemoteAddress().ToString(),
(const char*) request.GetUrl().ToString());
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINE, prefix, &request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINE, prefix, &request);
NPT_List<NPT_HttpRequestHandler*> handlers = FindRequestHandlers(request);
if (handlers.GetItemCount() == 0) return NPT_ERROR_NO_SUCH_ITEM;
diff --git a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
index 41931a648a..ed23d47be8 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltHttpServerTask.cpp
@@ -338,7 +338,7 @@ PLT_HttpServerSocketTask::SendResponseHeaders(NPT_HttpResponse* response,
}
headers.SetHeader(NPT_HTTP_HEADER_SERVER, PLT_HTTP_DEFAULT_SERVER, false); // set but don't replace
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINE, "PLT_HttpServerSocketTask::Write", response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINE, "PLT_HttpServerSocketTask::Write", response);
// create a memory stream to buffer the headers
NPT_MemoryStream header_stream;
diff --git a/lib/libUPnP/Platinum/Source/Core/PltIconsData.cpp b/lib/libUPnP/Platinum/Source/Core/PltIconsData.cpp
index 9ce63d078b..56b60b57c0 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltIconsData.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltIconsData.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Core/PltMimeType.cpp b/lib/libUPnP/Platinum/Source/Core/PltMimeType.cpp
index f53ede2379..a4665953ed 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltMimeType.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltMimeType.cpp
@@ -53,18 +53,16 @@ PLT_HttpFileRequestHandler_DefaultFileTypeMap[] = {
{"wavm", "audio/wav"},
{"alac", "audio/x-alac"},
//{"wavm", "audio/x-wav"},
- {"l16m32", "audio/L16;rate=32000;channels=1"}
};
const NPT_HttpFileRequestHandler_FileTypeMapEntry
PLT_HttpFileRequestHandler_360FileTypeMap[] = {
- {"l16", "audio/L16"},
- {"l16m", "audio/L16"},
- {"l16m32", "audio/L16"},
- {"avi", "video/avi"},
- {"divx", "video/avi"},
- {"xvid", "video/avi"},
- {"mov", "video/quicktime"}
+ {"l16", "audio/L16"},
+ {"l16m", "audio/L16;rate=44100;channels=1"},
+ {"avi", "video/avi"},
+ {"divx", "video/avi"},
+ {"xvid", "video/avi"},
+ {"mov", "video/quicktime"}
};
const NPT_HttpFileRequestHandler_FileTypeMapEntry
@@ -125,7 +123,7 @@ PLT_MimeType::GetMimeTypeFromExtension(const NPT_String& extension,
{
if (signature != PLT_DEVICE_UNKNOWN) {
// look for special case for 360
- if (signature == PLT_DEVICE_XBOX /*|| signature == PLT_DEVICE_WMP*/ ) {
+ if (signature == PLT_DEVICE_XBOX_360 || signature == PLT_DEVICE_XBOX_ONE) {
for (unsigned int i=0; i<NPT_ARRAY_SIZE(PLT_HttpFileRequestHandler_360FileTypeMap); i++) {
if (extension.Compare(PLT_HttpFileRequestHandler_360FileTypeMap[i].extension, true) == 0) {
return PLT_HttpFileRequestHandler_360FileTypeMap[i].mime_type;
diff --git a/lib/libUPnP/Platinum/Source/Core/PltProtocolInfo.cpp b/lib/libUPnP/Platinum/Source/Core/PltProtocolInfo.cpp
index 9581ea5736..d22dc02bcf 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltProtocolInfo.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltProtocolInfo.cpp
@@ -81,7 +81,8 @@ PLT_HttpFileRequestHandler_DefaultDlnaMap[] = {
{"image/jp2", "DLNA.ORG_PN=JPEG_LRG"},
{"image/png", "DLNA.ORG_PN=PNG_LRG"},
{"image/bmp", "DLNA.ORG_PN=BMP_LRG"},
- {"image/tiff", "DLNA.ORG_PN=TIFF_LRG"},
+ {"image/tiff", "DLNA.ORG_PN=TIFF_LRG"},
+ {"audio/L16", "DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"},
{"audio/L16;rate=44100;channels=2", "DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"},
{"audio/L16;rate=44100;channels=1", "DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"},
{"audio/L16;rate=32000;channels=1", "DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"},
@@ -108,7 +109,6 @@ PLT_HttpFileRequestHandler_360DlnaMap[] = {
{"audio/wav", "DLNA.ORG_OP=01;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000"},
{"audio/mp4", "DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01500000000000000000000000000000"},
{"audio/mpeg", "DLNA.ORG_PN=MP3;DLNA.ORG_OP=01"},
- {"audio/L16", "DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_CI=1"},
{"audio/x-ms-wma", "DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_CI=0"}
};
@@ -514,7 +514,7 @@ PLT_ProtocolInfo::GetDlnaExtension(const char* mime_type,
if (signature != PLT_DEVICE_UNKNOWN) {
// look for special case for 360
- if (signature == PLT_DEVICE_XBOX || signature == PLT_DEVICE_WMP) {
+ if (signature == PLT_DEVICE_XBOX_360 || signature == PLT_DEVICE_XBOX_ONE || signature == PLT_DEVICE_WMP) {
for (unsigned int i=0; i<NPT_ARRAY_SIZE(PLT_HttpFileRequestHandler_360DlnaMap); i++) {
if (_mime_type.Compare(PLT_HttpFileRequestHandler_360DlnaMap[i].mime_type, true) == 0) {
return PLT_HttpFileRequestHandler_360DlnaMap[i].dlna_ext;
diff --git a/lib/libUPnP/Platinum/Source/Core/PltSsdp.cpp b/lib/libUPnP/Platinum/Source/Core/PltSsdp.cpp
index dc1e7c1c9f..fda6f35892 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltSsdp.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltSsdp.cpp
@@ -61,7 +61,7 @@ PLT_SsdpSender::SendSsdp(NPT_HttpRequest& request,
NPT_String prefix = NPT_String::Format("Sending SSDP %s packet for %s",
(const char*)request.GetMethod(),
usn);
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, &request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINER, prefix, &request);
// use a memory stream to write all the data
NPT_MemoryStream stream;
@@ -93,7 +93,7 @@ PLT_SsdpSender::SendSsdp(NPT_HttpResponse& response,
// logging
NPT_String prefix = NPT_String::Format("Sending SSDP Response:");
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINER, prefix, &response);
+ PLT_LOG_HTTP_RESPONSE(NPT_LOG_LEVEL_FINER, prefix, &response);
// use a memory stream to write all the data
NPT_MemoryStream stream;
@@ -147,7 +147,7 @@ PLT_SsdpDeviceSearchResponseInterfaceIterator::operator()(NPT_NetworkInterface*&
if (!niaddr) return NPT_SUCCESS;
// don't try to bind on port 1900 or connect will fail later
- NPT_UdpSocket socket;
+ NPT_UdpSocket socket(NPT_SOCKET_FLAG_CANCELLABLE);
//socket.Bind(NPT_SocketAddress(NPT_IpAddress::Any, 1900), true);
// by connecting, the kernel chooses which interface to use to route to the remote
@@ -238,8 +238,8 @@ PLT_SsdpAnnounceInterfaceIterator::operator()(NPT_NetworkInterface*& net_if) con
}
NPT_HttpUrl url;
- NPT_UdpMulticastSocket multicast_socket;
- NPT_UdpSocket broadcast_socket;
+ NPT_UdpMulticastSocket multicast_socket(NPT_SOCKET_FLAG_CANCELLABLE);
+ NPT_UdpSocket broadcast_socket(NPT_SOCKET_FLAG_CANCELLABLE);
NPT_UdpSocket* socket;
if (m_Broadcast) {
diff --git a/lib/libUPnP/Platinum/Source/Core/PltTaskManager.cpp b/lib/libUPnP/Platinum/Source/Core/PltTaskManager.cpp
index 93624ac73b..368a05732b 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltTaskManager.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltTaskManager.cpp
@@ -190,7 +190,7 @@ PLT_TaskManager::AddTask(PLT_ThreadTask* task)
return result;
}
- NPT_LOG_FINER_3("[TaskManager 0x%08x] %d/%d running tasks", this, ++m_RunningTasks, m_MaxTasks);
+ NPT_LOG_FINER_3("[TaskManager 0x%p] %d/%d running tasks", (void*)this, ++m_RunningTasks, m_MaxTasks);
// keep track of running task
result = m_Tasks.Add(task);
@@ -223,7 +223,7 @@ PLT_TaskManager::RemoveTask(PLT_ThreadTask* task)
}
}
- NPT_LOG_FINER_3("[TaskManager 0x%08x] %d/%d running tasks", this, --m_RunningTasks, m_MaxTasks);
+ NPT_LOG_FINER_3("[TaskManager 0x%p] %d/%d running tasks", (void*)this, --m_RunningTasks, m_MaxTasks);
m_Tasks.Remove(task);
}
diff --git a/lib/libUPnP/Platinum/Source/Core/PltTaskManager.h b/lib/libUPnP/Platinum/Source/Core/PltTaskManager.h
index cf8f4cb428..aa1a58d6a5 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltTaskManager.h
+++ b/lib/libUPnP/Platinum/Source/Core/PltTaskManager.h
@@ -105,7 +105,6 @@ private:
private:
NPT_List<PLT_ThreadTask*> m_Tasks;
NPT_Mutex m_TasksLock;
- NPT_Mutex m_CallbackLock;
NPT_Queue<int>* m_Queue;
NPT_Cardinal m_MaxTasks;
NPT_Cardinal m_RunningTasks;
diff --git a/lib/libUPnP/Platinum/Source/Core/PltUPnP.cpp b/lib/libUPnP/Platinum/Source/Core/PltUPnP.cpp
index cb118755b6..e0b1e8b734 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltUPnP.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltUPnP.cpp
@@ -165,7 +165,7 @@ PLT_UPnP::Start()
/* Create multicast socket and bind on 1900. If other apps didn't
play nicely by setting the REUSE_ADDR flag, this could fail */
- NPT_Reference<NPT_UdpMulticastSocket> socket(new NPT_UdpMulticastSocket());
+ NPT_Reference<NPT_UdpMulticastSocket> socket(new NPT_UdpMulticastSocket(NPT_SOCKET_FLAG_CANCELLABLE));
NPT_CHECK_SEVERE(socket->Bind(NPT_SocketAddress(NPT_IpAddress::Any, 1900), true));
/* Join multicast group for every ip we found */
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaConnect/PltMediaConnect.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaConnect/PltMediaConnect.cpp
index 32503feaf3..ccac60d49d 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaConnect/PltMediaConnect.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaConnect/PltMediaConnect.cpp
@@ -117,7 +117,7 @@ PLT_MediaConnect::ProcessGetDescription(NPT_HttpRequest& request,
PLT_DeviceSignature signature = PLT_HttpHelper::GetDeviceSignature(request);
- if (signature == PLT_DEVICE_XBOX /*|| signature == PLT_SONOS*/) {
+ if (signature == PLT_DEVICE_XBOX_360 || signature == PLT_DEVICE_XBOX_ONE /*|| signature == PLT_SONOS*/) {
// XBox needs to see something behind a ':' to even show it
if (m_AddHostname && hostname.GetLength() > 0) {
m_FriendlyName += ": " + hostname;
@@ -130,7 +130,7 @@ PLT_MediaConnect::ProcessGetDescription(NPT_HttpRequest& request,
}
// change some things based on device signature from request
- if (signature == PLT_DEVICE_XBOX || signature == PLT_DEVICE_WMP /*|| signature == PLT_SONOS*/) {
+ if (signature == PLT_DEVICE_XBOX_360 || signature == PLT_DEVICE_XBOX_ONE || signature == PLT_DEVICE_WMP /*|| signature == PLT_SONOS*/) {
m_ModelName = "Windows Media Player Sharing";
m_ModelNumber = (signature == PLT_DEVICE_SONOS)?"3.0":"12.0";
m_ModelURL = "http://www.microsoft.com/";//"http://go.microsoft.com/fwlink/?LinkId=105926";
@@ -183,7 +183,10 @@ PLT_MediaConnect::ProcessGetSCPD(PLT_Service* service,
// Override SCPD response by providing an SCPD without a Search action
// to all devices except XBox or WMP which need it
if (service->GetServiceType() == "urn:schemas-upnp-org:service:ContentDirectory:1" &&
- signature != PLT_DEVICE_XBOX && signature != PLT_DEVICE_WMP && signature != PLT_DEVICE_SONOS) {
+ signature != PLT_DEVICE_XBOX_360 &&
+ signature != PLT_DEVICE_XBOX_ONE &&
+ signature != PLT_DEVICE_WMP &&
+ signature != PLT_DEVICE_SONOS) {
NPT_HttpEntity* entity;
PLT_HttpHelper::SetBody(response, (const char*) MS_ContentDirectorySCPD, &entity);
entity->SetContentType("text/xml; charset=\"utf-8\"");
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaConnect/X_MS_MediaReceiverRegistrarSCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaConnect/X_MS_MediaReceiverRegistrarSCPD.cpp
index 4ffd2d51d9..e05504bbd2 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaConnect/X_MS_MediaReceiverRegistrarSCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaConnect/X_MS_MediaReceiverRegistrarSCPD.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/AVTransportSCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/AVTransportSCPD.cpp
index 64014edbb6..4803a33cd3 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/AVTransportSCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/AVTransportSCPD.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RdrConnectionManagerSCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RdrConnectionManagerSCPD.cpp
index daf011c5d8..4cc0e029aa 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RdrConnectionManagerSCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RdrConnectionManagerSCPD.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RenderingControlSCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RenderingControlSCPD.cpp
index 43ba48eb81..a01b1c93d3 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RenderingControlSCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaRenderer/RenderingControlSCPD.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/ConnectionManagerSCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/ConnectionManagerSCPD.cpp
index e57e805976..973b3b1213 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/ConnectionManagerSCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/ConnectionManagerSCPD.cpp
@@ -39,7 +39,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorySCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorySCPD.cpp
index 726a021792..03f0924814 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorySCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorySCPD.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorywSearchSCPD.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorywSearchSCPD.cpp
index 3e8cc89499..bc16048bfe 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorywSearchSCPD.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/ContentDirectorywSearchSCPD.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| globals
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltFileMediaServer.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltFileMediaServer.cpp
index b45677ef6e..421d0c2042 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltFileMediaServer.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltFileMediaServer.cpp
@@ -79,7 +79,7 @@ PLT_FileMediaServerDelegate::ProcessFileRequest(NPT_HttpRequest& re
{
NPT_HttpUrlQuery query(request.GetUrl().GetQuery());
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINE, "PLT_FileMediaServerDelegate::ProcessFileRequest:", &request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINE, "PLT_FileMediaServerDelegate::ProcessFileRequest:", &request);
if (request.GetMethod().Compare("GET") && request.GetMethod().Compare("HEAD")) {
response.SetStatus(500, "Internal Server Error");
@@ -252,7 +252,7 @@ PLT_FileMediaServerDelegate::OnBrowseDirectChildren(PLT_ActionReference&
didl += didl_footer;
- NPT_LOG_FINE_6("BrowseDirectChildren from %s returning %d-%d/%d objects (%d out of %d requested)",
+ NPT_LOG_FINE_6("BrowseDirectChildren from %s returning %d-%lu/%lu objects (%lu out of %d requested)",
(const char*)context.GetLocalAddress().GetIpAddress().ToString(),
starting_index, starting_index+num_returned, total_matches, num_returned, requested_count);
diff --git a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.h b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.h
index ceeeb64e9b..bbc674304f 100644
--- a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.h
+++ b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.h
@@ -6,7 +6,7 @@
// Copyright 2010 Plutinosoft LLC. All rights reserved.
//
-#import "NptConfig.h"
+#import "Neptune.h"
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#include <UIKit/UIKit.h>
@@ -25,11 +25,8 @@ typedef class NPT_HttpResponse NPT_HttpResponse;
/*----------------------------------------------------------------------
| PLT_MediaServerObject
+---------------------------------------------------------------------*/
-@interface PLT_MediaServerObject : PLT_DeviceHostObject {
- id delegate;
-}
-
-@property (nonatomic, assign) id delegate; // we do not retain to avoid circular ref count
+@interface PLT_MediaServerObject : PLT_DeviceHostObject
+@property (nonatomic, assign) id delegate;
@end
/*----------------------------------------------------------------------
@@ -46,11 +43,11 @@ typedef class NPT_HttpResponse NPT_HttpResponse;
- (id)initWithAction:(PLT_Action*)action objectId:(const char*)objectId filter:(const char*)filter start:(NPT_UInt32)start count:(NPT_UInt32)count sort:(const char*)sort context:(PLT_HttpRequestContext*)context;
-@property (readonly, assign) NSString* objectId;
+@property (readonly, copy) NSString* objectId;
@property (readonly) NPT_UInt32 start;
@property (readonly) NPT_UInt32 count;
-@property (readonly, assign) NSString* filter;
-@property (readonly, assign) NSString* sort;
+@property (readonly, copy) NSString* filter;
+@property (readonly, copy) NSString* sort;
@end
/*----------------------------------------------------------------------
@@ -62,7 +59,7 @@ typedef class NPT_HttpResponse NPT_HttpResponse;
- (id)initWithAction:(PLT_Action*)action objectId:(const char*)objectId search:(const char*)search filter:(const char*)filter start:(NPT_UInt32)start count:(NPT_UInt32)count sort:(const char*)sort context:(PLT_HttpRequestContext*)context;
-@property (readonly, assign) NSString* search;
+@property (readonly, copy) NSString* search;
@end
/*----------------------------------------------------------------------
diff --git a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.mm b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.mm
index eab2c7acd9..0900819999 100644
--- a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.mm
+++ b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltMediaServerObject.mm
@@ -24,7 +24,7 @@ public:
NPT_UInt32 requested_count,
const char* sort_criteria,
const PLT_HttpRequestContext& context) {
- if (![[m_Target delegate] respondsToSelector:@selector(onBrowseMetadata:)])
+ if (![m_Target.delegate respondsToSelector:@selector(onBrowseMetadata:)])
return NPT_FAILURE;
PLT_MediaServerBrowseCapsule* capsule =
@@ -35,8 +35,7 @@ public:
count:requested_count
sort:sort_criteria
context:(PLT_HttpRequestContext*)&context];
- NPT_Result result = [[m_Target delegate] onBrowseMetadata:capsule];
- [capsule release];
+ NPT_Result result = [m_Target.delegate onBrowseMetadata:capsule];
return result;
}
@@ -48,7 +47,7 @@ public:
NPT_UInt32 requested_count,
const char* sort_criteria,
const PLT_HttpRequestContext& context) {
- if (![[m_Target delegate] respondsToSelector:@selector(onBrowseDirectChildren:)])
+ if (![m_Target.delegate respondsToSelector:@selector(onBrowseDirectChildren:)])
return NPT_FAILURE;
PLT_MediaServerBrowseCapsule* capsule =
@@ -59,8 +58,7 @@ public:
count:requested_count
sort:sort_criteria
context:(PLT_HttpRequestContext*)&context];
- NPT_Result result = [[m_Target delegate] onBrowseDirectChildren:capsule];
- [capsule release];
+ NPT_Result result = [m_Target.delegate onBrowseDirectChildren:capsule];
return result;
}
@@ -73,7 +71,7 @@ public:
NPT_UInt32 requested_count,
const char* sort_criteria,
const PLT_HttpRequestContext& context) {
- if (![[m_Target delegate] respondsToSelector:@selector(onSearchContainer:)])
+ if (![m_Target.delegate respondsToSelector:@selector(onSearchContainer:)])
return NPT_FAILURE;
PLT_MediaServerSearchCapsule* capsule =
@@ -85,8 +83,7 @@ public:
count:requested_count
sort:sort_criteria
context:(PLT_HttpRequestContext*)&context];
- NPT_Result result = [[m_Target delegate] onSearchContainer:capsule];
- [capsule release];
+ NPT_Result result = [m_Target.delegate onSearchContainer:capsule];
return result;
}
@@ -98,8 +95,7 @@ public:
PLT_MediaServerFileRequestCapsule* capsule =
[[PLT_MediaServerFileRequestCapsule alloc] initWithResponse:&response
context:&_context];
- NPT_Result result = [[m_Target delegate] onFileRequest:capsule];
- [capsule release];
+ NPT_Result result = [m_Target.delegate onFileRequest:capsule];
return result;
}
@@ -130,14 +126,6 @@ private:
return self;
}
-- (void)dealloc
-{
- [objectId release];
- [filter release];
- [sort release];
- [super dealloc];
-}
-
@end
/*----------------------------------------------------------------------
@@ -161,12 +149,6 @@ private:
return self;
}
-- (void)dealloc
-{
- [search release];
- [super dealloc];
-}
-
@end
/*----------------------------------------------------------------------
@@ -183,42 +165,34 @@ private:
return self;
}
-- (void)dealloc
-{
- [super dealloc];
-}
-
@end
/*----------------------------------------------------------------------
-| PLT_DeviceHostObject
+| PLT_MediaServerObject
+---------------------------------------------------------------------*/
-@interface PLT_DeviceHostObject (priv)
-- (PLT_DeviceHostReference&)getDevice;
+@interface PLT_MediaServerObject () {
+ PLT_MediaServerDelegate_Wrapper *_wrapper;
+}
@end
-/*----------------------------------------------------------------------
-| PLT_MediaServerObject
-+---------------------------------------------------------------------*/
@implementation PLT_MediaServerObject
-@synthesize delegate;
-
- (id)init
{
- PLT_MediaConnect* server = new PLT_MediaConnect("Test");
- PLT_DeviceHostReference _device(server);
- if ((self = [super initWithDeviceHost:&_device])) {
- server->SetDelegate(new PLT_MediaServerDelegate_Wrapper(self));
+ if ((self = [super init])) {
+ PLT_MediaConnect* server = new PLT_MediaConnect("Test");
+ PLT_DeviceHostReference _device(server);
+ [self setDevice:&_device];
+
+ _wrapper = new PLT_MediaServerDelegate_Wrapper(self);
+ server->SetDelegate(_wrapper);
}
return self;
}
- (void)dealloc
{
- PLT_DeviceHostReference& host = [self getDevice];
- delete ((PLT_MediaServer*)host.AsPointer())->GetDelegate();
- [super dealloc];
+ delete _wrapper;
}
@end
diff --git a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.h b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.h
index b7bf9e790b..4c9b8edc6d 100644
--- a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.h
+++ b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.h
@@ -6,9 +6,7 @@
// Copyright 2010 Plutinosoft LLC. All rights reserved.
//
-#import "NptConfig.h"
-#import "NptTypes.h"
-#import "NptResults.h"
+#import "Neptune.h"
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#include <UIKit/UIKit.h>
@@ -44,16 +42,14 @@ typedef struct PLT_DeviceHostReference PLT_DeviceHostReference;
PLT_DeviceHostReference* device;
}
-- (id)initWithDeviceHost:(PLT_DeviceHostReference*)device;
+- (void)setDevice:(PLT_DeviceHostReference*)_device;
+- (PLT_DeviceHostReference&)getDevice;
@end
/*----------------------------------------------------------------------
| PLT_UPnPObject
+---------------------------------------------------------------------*/
-@interface PLT_UPnPObject : NSObject {
-@private
- PLT_UPnP* upnp;
-}
+@interface PLT_UPnPObject : NSObject
- (NPT_Result)start;
- (NPT_Result)stop;
diff --git a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.mm b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.mm
index ea7562cc69..d49f1f557f 100644
--- a/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.mm
+++ b/lib/libUPnP/Platinum/Source/Extras/ObjectiveC/PltUPnPObject.mm
@@ -12,10 +12,6 @@
/*----------------------------------------------------------------------
| PLT_ActionObject
+---------------------------------------------------------------------*/
-/*@interface PLT_ActionObject (priv)
-- (id)initWithAction:(PLT_Action*)action;
-@end*/
-
@implementation PLT_ActionObject
- (id)initWithAction:(PLT_Action *)_action
@@ -26,11 +22,6 @@
return self;
}
-- (void)dealloc
-{
- [super dealloc];
-}
-
- (NPT_Result)setValue:(NSString *)value forArgument:(NSString *)argument
{
return action->SetArgumentValue([argument UTF8String], [value UTF8String]);
@@ -46,24 +37,22 @@
/*----------------------------------------------------------------------
| PLT_DeviceHostObject
+---------------------------------------------------------------------*/
-@interface PLT_DeviceHostObject (priv)
-- (PLT_DeviceHostReference&)getDevice;
-@end
-
@implementation PLT_DeviceHostObject
-- (id)initWithDeviceHost:(PLT_DeviceHostReference*)_device
+- (id)init
{
- if ((self = [super init])) {
- device = new PLT_DeviceHostReference(*_device);
- }
- return self;
+ return [super init];
+}
+
+- (void)setDevice:(PLT_DeviceHostReference*)_device
+{
+ delete device;
+ device = new PLT_DeviceHostReference(*_device);
}
- (void)dealloc
{
delete device;
- [super dealloc];
}
- (PLT_DeviceHostReference&)getDevice
@@ -76,45 +65,54 @@
/*----------------------------------------------------------------------
| PLT_UPnPObject
+---------------------------------------------------------------------*/
+
+@interface PLT_UPnPObject () {
+ PLT_UPnP *_upnp;
+ NSMutableArray *_devices;
+}
+@end
+
@implementation PLT_UPnPObject
- (id)init
{
if ((self = [super init])) {
- upnp = new PLT_UPnP();
+ _upnp = new PLT_UPnP();
+ _devices = [NSMutableArray array];
}
return self;
}
-(void) dealloc
{
- delete upnp;
- [super dealloc];
+ delete _upnp;
}
- (NPT_Result)start
{
- return upnp->Start();
+ return _upnp->Start();
}
- (NPT_Result)stop
{
- return upnp->Stop();
+ return _upnp->Stop();
}
- (bool)isRunning
{
- return upnp->IsRunning();
+ return _upnp->IsRunning();
}
- (NPT_Result)addDevice:(PLT_DeviceHostObject*)device
{
- return upnp->AddDevice([device getDevice]);
+ [_devices addObject:device];
+ return _upnp->AddDevice([device getDevice]);
}
- (NPT_Result)removeDevice:(PLT_DeviceHostObject*)device
{
- return upnp->RemoveDevice([device getDevice]);
+ [_devices removeObject:device];
+ return _upnp->RemoveDevice([device getDevice]);
}
@end
diff --git a/lib/libUPnP/Platinum/Source/Extras/PltDownloader.cpp b/lib/libUPnP/Platinum/Source/Extras/PltDownloader.cpp
index 598f87958d..a910370ceb 100644
--- a/lib/libUPnP/Platinum/Source/Extras/PltDownloader.cpp
+++ b/lib/libUPnP/Platinum/Source/Extras/PltDownloader.cpp
@@ -37,7 +37,7 @@
+---------------------------------------------------------------------*/
#include "PltDownloader.h"
#include "PltTaskManager.h"
-#include "NptLogging.h"
+#include "Neptune.h"
NPT_SET_LOCAL_LOGGER("platinum.extra.downloader")
diff --git a/lib/libUPnP/Platinum/Source/Extras/PltFrameServer.cpp b/lib/libUPnP/Platinum/Source/Extras/PltFrameServer.cpp
index db90d07d79..d01d414317 100644
--- a/lib/libUPnP/Platinum/Source/Extras/PltFrameServer.cpp
+++ b/lib/libUPnP/Platinum/Source/Extras/PltFrameServer.cpp
@@ -55,6 +55,7 @@ public:
PLT_SocketPolicyServer(const char* policy,
NPT_IpPort port = 0,
const char* authorized_ports = "5900") :
+ m_Socket(NPT_SOCKET_FLAG_CANCELLABLE),
m_Policy(policy),
m_Port(port),
m_AuthorizedPorts(authorized_ports),
@@ -109,7 +110,7 @@ public:
NPT_SocketInfo client_info;
client->GetInfo(client_info);
- NPT_LOG_FINE_2("client connected (%s)",
+ NPT_LOG_FINE_2("client connected (%s -> %s)",
client_info.local_address.ToString().GetChars(),
client_info.remote_address.ToString().GetChars());
@@ -149,7 +150,7 @@ PLT_HttpStreamRequestHandler::SetupResponse(NPT_HttpRequest& reques
const NPT_HttpRequestContext& context,
NPT_HttpResponse& response)
{
- PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINE, "PLT_HttpStreamRequestHandler::SetupResponse:", &request);
+ PLT_LOG_HTTP_REQUEST(NPT_LOG_LEVEL_FINE, "PLT_HttpStreamRequestHandler::SetupResponse:", &request);
if (request.GetMethod().Compare("GET") &&
request.GetMethod().Compare("HEAD")) {
diff --git a/lib/libUPnP/Platinum/Source/Extras/PltRingBufferStream.h b/lib/libUPnP/Platinum/Source/Extras/PltRingBufferStream.h
index e5f98b2f35..bd56b8a0b4 100644
--- a/lib/libUPnP/Platinum/Source/Extras/PltRingBufferStream.h
+++ b/lib/libUPnP/Platinum/Source/Extras/PltRingBufferStream.h
@@ -38,9 +38,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptStreams.h"
-#include "NptRingBuffer.h"
-#include "NptThreads.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| PLT_RingBufferStream class
diff --git a/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.cpp b/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.cpp
index 59829f145b..80d161450c 100644
--- a/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.cpp
+++ b/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.cpp
@@ -36,7 +36,7 @@
| includes
+---------------------------------------------------------------------*/
#include "PltStreamPump.h"
-#include "NptUtils.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| PLT_StreamPump::PLT_StreamPump
diff --git a/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.h b/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.h
index a022b88518..f8fa719e03 100644
--- a/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.h
+++ b/lib/libUPnP/Platinum/Source/Extras/PltStreamPump.h
@@ -38,8 +38,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptStreams.h"
-#include "NptRingBuffer.h"
+#include "Neptune.h"
/*----------------------------------------------------------------------
| PLT_PipeInputStream
diff --git a/lib/libUPnP/Platinum/Source/Platform/Android/module/platinum/jni/Android.mk b/lib/libUPnP/Platinum/Source/Platform/Android/module/platinum/jni/Android.mk
index 3acdd619ea..e39fe62772 100644
--- a/lib/libUPnP/Platinum/Source/Platform/Android/module/platinum/jni/Android.mk
+++ b/lib/libUPnP/Platinum/Source/Platform/Android/module/platinum/jni/Android.mk
@@ -27,10 +27,12 @@ LOCAL_SRC_FILES := $(PLT_PREBUILT_PATH)/libNeptune.a
LOCAL_EXPORT_C_INCLUDES += $(PLT_ROOT)/../Neptune/Source/Core
include $(PREBUILT_STATIC_LIBRARY)
+ifneq ($(NPT_CONFIG_NO_SSL),1)
include $(CLEAR_VARS)
LOCAL_MODULE := axTLS
LOCAL_SRC_FILES := $(PLT_PREBUILT_PATH)/libaxTLS.a
include $(PREBUILT_STATIC_LIBRARY)
+endif
include $(CLEAR_VARS)
LOCAL_MODULE := platinum-jni
@@ -42,6 +44,9 @@ LOCAL_CFLAGS += -DNPT_CONFIG_ENABLE_LOGGING
LOCAL_STATIC_LIBRARIES := Platinum
LOCAL_STATIC_LIBRARIES += Neptune
+
+ifneq ($(NPT_CONFIG_NO_SSL),1)
LOCAL_STATIC_LIBRARIES += axTLS
+endif
include $(BUILD_SHARED_LIBRARY)
diff --git a/lib/libUPnP/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp b/lib/libUPnP/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp
index a757ef69ee..0d1223baa4 100644
--- a/lib/libUPnP/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp
+++ b/lib/libUPnP/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp
@@ -112,7 +112,7 @@ int
main(int /* argc */, char** argv)
{
// setup Neptune logging
- NPT_LogManager::GetDefault().Configure("plist:.level=FINE;.handlers=ConsoleHandler;.ConsoleHandler.colors=off;.ConsoleHandler.filter=42");
+ NPT_LogManager::GetDefault().Configure("plist:.level=FINE;.handlers=ConsoleHandler;.ConsoleHandler.colors=off;.ConsoleHandler.filter=56");
/* parse command line */
ParseCommandLine(argv+1);
diff --git a/lib/libUPnP/Platinum/Source/Tests/Http/HttpTest.cpp b/lib/libUPnP/Platinum/Source/Tests/Http/HttpTest.cpp
index eb0f2b8e5f..00b1f522fc 100644
--- a/lib/libUPnP/Platinum/Source/Tests/Http/HttpTest.cpp
+++ b/lib/libUPnP/Platinum/Source/Tests/Http/HttpTest.cpp
@@ -35,9 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptUtils.h"
#include "Neptune.h"
-#include "NptLogging.h"
#include "PltTaskManager.h"
#include "PltHttpServer.h"
#include "PltDownloader.h"
diff --git a/lib/libUPnP/Platinum/Source/Tests/LightSample/LightSampleTest.cpp b/lib/libUPnP/Platinum/Source/Tests/LightSample/LightSampleTest.cpp
index 9a4ff18f69..d9f35a0a93 100644
--- a/lib/libUPnP/Platinum/Source/Tests/LightSample/LightSampleTest.cpp
+++ b/lib/libUPnP/Platinum/Source/Tests/LightSample/LightSampleTest.cpp
@@ -46,6 +46,9 @@
int
main(int /* argc */, char** /* argv */)
{
+ // setup Neptune logging
+ NPT_LogManager::GetDefault().Configure("plist:.level=FINE;.handlers=ConsoleHandler;.ConsoleHandler.colors=off;.ConsoleHandler.filter=42");
+
PLT_UPnP upnp;
PLT_DeviceHostReference device(new PLT_LightSampleDevice("Platinum Light Bulb"));
diff --git a/lib/libUPnP/Platinum/Source/Tests/LightSample/PltLightSample.cpp b/lib/libUPnP/Platinum/Source/Tests/LightSample/PltLightSample.cpp
index ce6f5572ff..f31ffe1c8c 100644
--- a/lib/libUPnP/Platinum/Source/Tests/LightSample/PltLightSample.cpp
+++ b/lib/libUPnP/Platinum/Source/Tests/LightSample/PltLightSample.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
#include "Platinum.h"
#include "PltLightSample.h"
diff --git a/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTestController.mm b/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTestController.mm
index a9bec5a766..d7b9a29c4b 100644
--- a/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTestController.mm
+++ b/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTestController.mm
@@ -7,7 +7,7 @@
//
#import "MediaServerCocoaTestController.h"
-#import "Neptune.h"
+#import <Neptune/Neptune.h>
@implementation MediaServerCocoaTestController
@@ -39,12 +39,8 @@
}
}
-- (void)dealloc {
- [upnp release];
- [super dealloc];
-}
+#pragma mark - PLT_MediaServerDelegateObject
-#pragma mark PLT_MediaServerDelegateObject
- (NPT_Result)onBrowseMetadata:(PLT_MediaServerBrowseCapsule*)info
{
return NPT_FAILURE;
diff --git a/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTest_AppDelegate.mm b/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTest_AppDelegate.mm
index 743b652302..c6fb49a324 100644
--- a/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTest_AppDelegate.mm
+++ b/lib/libUPnP/Platinum/Source/Tests/MediaServerCocoaTest/MediaServerCocoaTest_AppDelegate.mm
@@ -36,7 +36,7 @@
if (managedObjectModel) return managedObjectModel;
- managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];
+ managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
return managedObjectModel;
}
@@ -79,7 +79,7 @@
options:nil
error:&error]){
[[NSApplication sharedApplication] presentError:error];
- [persistentStoreCoordinator release], persistentStoreCoordinator = nil;
+ persistentStoreCoordinator = nil;
return nil;
}
@@ -183,7 +183,6 @@
[alert addButtonWithTitle:cancelButton];
NSInteger answer = [alert runModal];
- [alert release];
alert = nil;
if (answer == NSAlertAlternateReturn) return NSTerminateCancel;
@@ -193,20 +192,4 @@
return NSTerminateNow;
}
-
-/**
- Implementation of dealloc, to release the retained variables.
- */
-
-- (void)dealloc {
-
- [window release];
- [managedObjectContext release];
- [persistentStoreCoordinator release];
- [managedObjectModel release];
-
- [super dealloc];
-}
-
-
@end
diff --git a/lib/libUPnP/Platinum/Source/Tests/Simple/PltSimple.cpp b/lib/libUPnP/Platinum/Source/Tests/Simple/PltSimple.cpp
index e729a5e648..0d32ec2f77 100644
--- a/lib/libUPnP/Platinum/Source/Tests/Simple/PltSimple.cpp
+++ b/lib/libUPnP/Platinum/Source/Tests/Simple/PltSimple.cpp
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptTypes.h"
+#include "Neptune.h"
#include "Platinum.h"
#include "PltSimple.h"
diff --git a/lib/libUPnP/Platinum/Source/Tests/Ssdp/SsdpTest1.cpp b/lib/libUPnP/Platinum/Source/Tests/Ssdp/SsdpTest1.cpp
index 7051a1ebf3..1e1f6aa42e 100644
--- a/lib/libUPnP/Platinum/Source/Tests/Ssdp/SsdpTest1.cpp
+++ b/lib/libUPnP/Platinum/Source/Tests/Ssdp/SsdpTest1.cpp
@@ -35,7 +35,6 @@
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
-#include "NptUtils.h"
#include "Neptune.h"
#include "Platinum.h"