Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
ngx_http_voms_module
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Federico Fornari
ngx_http_voms_module
Commits
cf553629
Commit
cf553629
authored
7 years ago
by
Francesco Giacomini
Browse files
Options
Downloads
Patches
Plain Diff
restructure if statement
parent
013ad439
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ngx_http_voms_module.cpp
+15
-15
15 additions, 15 deletions
src/ngx_http_voms_module.cpp
with
15 additions
and
15 deletions
src/ngx_http_voms_module.cpp
+
15
−
15
View file @
cf553629
...
...
@@ -375,25 +375,25 @@ std::string get_voms_not_after(VomsAc const& ac)
std
::
string
escape_uri
(
std
::
string
const
&
src
)
{
// the following just counts the number of characters that need escaping
auto
const
n_escape
=
ngx_escape_uri
(
nullptr
,
// <--
reinterpret_cast
<
u_char
*>
(
const_cast
<
char
*>
(
src
.
data
())),
src
.
size
(),
NGX_ESCAPE_URI_COMPONENT
);
auto
const
n_escape
=
ngx_escape_uri
(
nullptr
,
// <--
reinterpret_cast
<
u_char
*>
(
const_cast
<
char
*>
(
src
.
data
())),
src
.
size
(),
NGX_ESCAPE_URI_COMPONENT
);
if
(
n_escape
==
0
)
{
return
src
;
}
else
{
std
::
string
result
;
result
.
resize
(
src
.
size
()
+
2
*
n_escape
);
auto
last
=
reinterpret_cast
<
char
*>
(
ngx_escape_uri
(
reinterpret_cast
<
u_char
*>
(
const_cast
<
char
*>
(
result
.
data
())),
reinterpret_cast
<
u_char
*>
(
const_cast
<
char
*>
(
src
.
data
())),
src
.
size
(),
NGX_ESCAPE_URI_COMPONENT
));
assert
(
last
==
&
result
.
back
());
return
result
;
}
std
::
string
result
;
result
.
resize
(
src
.
size
()
+
2
*
n_escape
);
auto
last
=
reinterpret_cast
<
char
*>
(
ngx_escape_uri
(
reinterpret_cast
<
u_char
*>
(
const_cast
<
char
*>
(
result
.
data
())),
reinterpret_cast
<
u_char
*>
(
const_cast
<
char
*>
(
src
.
data
())),
src
.
size
(),
NGX_ESCAPE_URI_COMPONENT
));
assert
(
last
==
&
result
.
back
());
return
result
;
}
static
std
::
string
encode
(
attribute
const
&
a
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment