Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-iOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
311
Issues
311
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-iOS
Commits
67a26d83
Commit
67a26d83
authored
May 19, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http uploader: expose httpserver as a property so our object friends can ask for information
parent
9471bb9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
AspenProject/VLCHTTPUploaderController.h
AspenProject/VLCHTTPUploaderController.h
+3
-3
AspenProject/VLCHTTPUploaderController.m
AspenProject/VLCHTTPUploaderController.m
+7
-9
No files found.
AspenProject/VLCHTTPUploaderController.h
View file @
67a26d83
...
...
@@ -11,9 +11,9 @@
@class
HTTPServer
;
@interface
VLCHTTPUploaderController
:
NSObject
{
HTTPServer
*
httpServer
;
}
@interface
VLCHTTPUploaderController
:
NSObject
@property
(
nonatomic
,
readonly
)
HTTPServer
*
httpServer
;
-
(
BOOL
)
changeHTTPServerState
:(
BOOL
)
state
;
...
...
AspenProject/VLCHTTPUploaderController.m
View file @
67a26d83
...
...
@@ -39,32 +39,30 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
[
DDLog
addLogger
:[
DDTTYLogger
sharedInstance
]];
// Initalize our http server
httpServer
=
[[
HTTPServer
alloc
]
init
];
_
httpServer
=
[[
HTTPServer
alloc
]
init
];
// Tell the server to broadcast its presence via Bonjour.
// This allows browsers such as Safari to automatically discover our service.
[
httpServer
setType
:
@"_http._tcp."
];
[
self
.
httpServer
setType
:
@"_http._tcp."
];
// Serve files from the standard Sites folder
NSString
*
docRoot
=
[[[
NSBundle
mainBundle
]
pathForResource
:
@"index"
ofType
:
@"html"
]
stringByDeletingLastPathComponent
];
DDLogInfo
(
@"Setting document root: %@"
,
docRoot
);
[
httpServer
setDocumentRoot
:
docRoot
];
[
self
.
httpServer
setDocumentRoot
:
docRoot
];
[
httpServer
setConnectionClass
:[
VLCHTTPConnection
class
]];
[
self
.
httpServer
setConnectionClass
:[
VLCHTTPConnection
class
]];
NSError
*
error
=
nil
;
if
(
!
[
httpServer
start
:
&
error
])
if
(
!
[
self
.
httpServer
start
:
&
error
])
{
DDLogError
(
@"Error starting HTTP Server: %@"
,
error
);
return
false
;
}
return
true
;
}
else
{
[
httpServer
stop
];
}
else
{
[
self
.
httpServer
stop
];
return
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment