Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
30ab81b4
Commit
30ab81b4
authored
Mar 04, 2018
by
Pierre SAGASPE
Committed by
Carola Nitz
Mar 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLCOpenNetworkStreamViewController: replace deprecated NSURLConnection by NSURLSession
(cherry picked from commit
8f44ace8
)
parent
f666a8c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
Sources/VLCOpenNetworkStreamViewController.m
Sources/VLCOpenNetworkStreamViewController.m
+26
-2
No files found.
Sources/VLCOpenNetworkStreamViewController.m
View file @
30ab81b4
...
...
@@ -2,7 +2,7 @@
* VLCOpenNetworkStreamViewController.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013-201
5
VideoLAN. All rights reserved.
* Copyright (c) 2013-201
8
VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
...
...
@@ -379,7 +379,8 @@ forRowAtIndexPath:(NSIndexPath *)indexPath
request
.
HTTPMethod
=
@"HEAD"
;
NSURLResponse
*
response
=
nil
;
[
NSURLConnection
sendSynchronousRequest
:
request
returningResponse
:
&
response
error
:
nil
];
NSError
*
error
=
nil
;
[
self
sendSynchronousRequest
:
request
returningResponse
:
&
response
error
:&
error
];
NSInteger
httpStatus
=
[(
NSHTTPURLResponse
*
)
response
statusCode
];
if
(
httpStatus
==
200
)
{
...
...
@@ -419,6 +420,29 @@ forRowAtIndexPath:(NSIndexPath *)indexPath
return
fileSubtitlePath
;
}
-
(
NSData
*
)
sendSynchronousRequest
:(
NSURLRequest
*
)
request
returningResponse
:(
NSURLResponse
**
)
response
error
:(
NSError
**
)
error
{
NSError
__block
*
erreur
=
NULL
;
NSData
__block
*
data
;
BOOL
__block
reqProcessed
=
false
;
NSURLResponse
__block
*
urlResponse
;
[[[
NSURLSession
sharedSession
]
dataTaskWithRequest
:
request
completionHandler
:
^
(
NSData
*
_Nullable
_data
,
NSURLResponse
*
_Nullable
_response
,
NSError
*
_Nullable
_error
)
{
urlResponse
=
_response
;
erreur
=
_error
;
data
=
_data
;
reqProcessed
=
true
;
}]
resume
];
while
(
!
reqProcessed
)
{
[
NSThread
sleepForTimeInterval
:
0
];
}
*
response
=
urlResponse
;
*
error
=
erreur
;
return
data
;
}
#pragma mark - text view delegate
-
(
BOOL
)
textFieldShouldReturn
:(
UITextField
*
)
textField
{
...
...
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