Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
065c0198
Commit
065c0198
authored
Oct 16, 2018
by
Benjamin REIS
Browse files
use full path instead of just directory for rootca resource
parent
d4676fb9
Pipeline
#433
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
src/core/platform-helpers/ios-platform-helpers.cpp
src/core/platform-helpers/ios-platform-helpers.cpp
+12
-5
No files found.
src/core/platform-helpers/ios-platform-helpers.cpp
View file @
065c0198
...
...
@@ -59,7 +59,8 @@ public:
private:
void
bgTaskTimeout
();
static
void
sBgTaskTimeout
(
void
*
data
);
static
std
::
string
directoryForResource
(
CFStringRef
framework
,
CFStringRef
resource
);
static
string
getResourceDirPath
(
CFStringRef
framework
,
CFStringRef
resource
);
static
string
getResourcePath
(
CFStringRef
framework
,
CFStringRef
resource
);
long
int
mCpuLockTaskId
;
int
mCpuLockCount
;
...
...
@@ -71,20 +72,20 @@ IosPlatformHelpers::IosPlatformHelpers (LinphoneCore *lc, void *system_context)
mCpuLockCount
=
0
;
mCpuLockTaskId
=
0
;
string
rootCaPath
=
directoryFor
Resource
(
CFSTR
(
"org.linphone.linphone"
),
CFSTR
(
"rootca.pem"
));
string
rootCaPath
=
get
Resource
Path
(
CFSTR
(
"org.linphone.linphone"
),
CFSTR
(
"rootca.pem"
));
if
(
!
rootCaPath
.
empty
())
linphone_core_set_root_ca
(
lc
,
rootCaPath
.
c_str
());
else
lError
()
<<
"IosPlatformHelpers did not find rootca.pem resource"
;
string
cpimPath
=
directoryFor
Resource
(
CFSTR
(
"org.linphone.linphone"
),
CFSTR
(
"cpim_grammar"
));
string
cpimPath
=
get
Resource
DirPath
(
CFSTR
(
"org.linphone.linphone"
),
CFSTR
(
"cpim_grammar"
));
if
(
!
cpimPath
.
empty
())
belr
::
GrammarLoader
::
get
().
addPath
(
cpimPath
);
else
lError
()
<<
"IosPlatformHelpers did not find cpim grammar resource directory..."
;
#ifdef VCARD_ENABLED
string
vcardPath
=
directoryFor
Resource
(
CFSTR
(
"org.linphone.belcard"
),
CFSTR
(
"vcard_grammar"
));
string
vcardPath
=
get
Resource
DirPath
(
CFSTR
(
"org.linphone.belcard"
),
CFSTR
(
"vcard_grammar"
));
if
(
!
vcardPath
.
empty
())
belr
::
GrammarLoader
::
get
().
addPath
(
vcardPath
);
else
...
...
@@ -133,7 +134,7 @@ void IosPlatformHelpers::releaseCpuLock () {
mCpuLockTaskId
=
0
;
}
string
IosPlatformHelpers
::
directoryFor
Resource
(
CFStringRef
framework
,
CFStringRef
resource
)
{
string
IosPlatformHelpers
::
get
Resource
DirPath
(
CFStringRef
framework
,
CFStringRef
resource
)
{
CFBundleRef
bundle
=
CFBundleGetBundleWithIdentifier
(
framework
);
CFURLRef
resourceUrl
=
CFBundleCopyResourceURL
(
bundle
,
resource
,
nullptr
,
nullptr
);
CFURLRef
resourceUrlDirectory
=
CFURLCreateCopyDeletingLastPathComponent
(
nullptr
,
resourceUrl
);
...
...
@@ -146,6 +147,12 @@ string IosPlatformHelpers::directoryForResource (CFStringRef framework, CFString
return
path
;
}
string
IosPlatformHelpers
::
getResourcePath
(
CFStringRef
framework
,
CFStringRef
resource
)
{
CFStringEncoding
encodingMethod
=
CFStringGetSystemEncoding
();
string
resourceFile
(
CFStringGetCStringPtr
(
resource
,
encodingMethod
));
return
getResourceDirPath
(
framework
,
resource
)
+
"/"
+
resourceFile
;
}
// -----------------------------------------------------------------------------
PlatformHelpers
*
createIosPlatformHelpers
(
LinphoneCore
*
lc
,
void
*
system_context
)
{
...
...
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