Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
93d79ee1
Commit
93d79ee1
authored
Jul 18, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Aug 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Implemented a path parser for opaque URIs.
parent
0ecec6d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
uri.c
dlls/urlmon/tests/uri.c
+32
-1
uri.c
dlls/urlmon/uri.c
+34
-1
No files found.
dlls/urlmon/tests/uri.c
View file @
93d79ee1
...
@@ -2245,6 +2245,34 @@ static const uri_properties uri_tests[] = {
...
@@ -2245,6 +2245,34 @@ static const uri_properties uri_tests[] = {
{
URL_SCHEME_UNKNOWN
,
S_OK
,
FALSE
},
{
URL_SCHEME_UNKNOWN
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
}
},
{
"urn:excepts:bad:%XY:encoded"
,
0
,
S_OK
,
FALSE
,
Uri_HAS_ABSOLUTE_URI
|
Uri_HAS_DISPLAY_URI
|
Uri_HAS_PATH
|
Uri_HAS_PATH_AND_QUERY
|
Uri_HAS_RAW_URI
|
Uri_HAS_SCHEME_NAME
|
Uri_HAS_HOST_TYPE
|
Uri_HAS_SCHEME
,
TRUE
,
{
{
"urn:excepts:bad:%XY:encoded"
,
S_OK
,
TRUE
},
{
""
,
S_FALSE
,
FALSE
},
{
"urn:excepts:bad:%XY:encoded"
,
S_OK
,
TRUE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
TRUE
},
{
""
,
S_FALSE
,
TRUE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
"excepts:bad:%XY:encoded"
,
S_OK
,
TRUE
},
{
"excepts:bad:%XY:encoded"
,
S_OK
,
TRUE
},
{
""
,
S_FALSE
,
TRUE
},
{
"urn:excepts:bad:%XY:encoded"
,
S_OK
,
FALSE
},
{
"urn"
,
S_OK
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
},
{
""
,
S_FALSE
,
FALSE
}
},
{
{
Uri_HOST_UNKNOWN
,
S_OK
,
FALSE
},
{
0
,
S_FALSE
,
FALSE
},
{
URL_SCHEME_UNKNOWN
,
S_OK
,
FALSE
},
{
URLZONE_INVALID
,
E_NOTIMPL
,
FALSE
}
}
}
}
};
};
...
@@ -2294,7 +2322,10 @@ static const invalid_uri invalid_uri_tests[] = {
...
@@ -2294,7 +2322,10 @@ static const invalid_uri invalid_uri_tests[] = {
/* Invalid port with IPv6 address. */
/* Invalid port with IPv6 address. */
{
"http://[::ffff]:32xy"
,
0
,
FALSE
},
{
"http://[::ffff]:32xy"
,
0
,
FALSE
},
/* Not allowed to have backslashes with NO_CANONICALIZE. */
/* Not allowed to have backslashes with NO_CANONICALIZE. */
{
"gopher://www.google.com
\\
test"
,
Uri_CREATE_NO_CANONICALIZE
,
FALSE
}
{
"gopher://www.google.com
\\
test"
,
Uri_CREATE_NO_CANONICALIZE
,
FALSE
},
/* Not allowed to have invalid % encoded data in opaque URI path. */
{
"news:test%XX"
,
0
,
FALSE
},
{
"mailto:wine@winehq%G8.com"
,
0
,
FALSE
}
};
};
typedef
struct
_uri_equality
{
typedef
struct
_uri_equality
{
...
...
dlls/urlmon/uri.c
View file @
93d79ee1
...
@@ -1553,6 +1553,37 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f
...
@@ -1553,6 +1553,37 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f
return
TRUE
;
return
TRUE
;
}
}
/* Parses the path of a opaque URI (much less strict then the parser
* for a hierarchical URI).
*
* NOTE:
* Windows allows invalid % encoded data to appear in opaque URI paths
* for unknown scheme types.
*/
static
BOOL
parse_path_opaque
(
const
WCHAR
**
ptr
,
parse_data
*
data
,
DWORD
flags
)
{
const
BOOL
known_scheme
=
data
->
scheme_type
!=
URL_SCHEME_UNKNOWN
;
data
->
path
=
*
ptr
;
while
(
!
is_path_delim
(
**
ptr
))
{
if
(
**
ptr
==
'%'
&&
known_scheme
)
{
if
(
!
check_pct_encoded
(
ptr
))
{
*
ptr
=
data
->
path
;
data
->
path
=
NULL
;
return
FALSE
;
}
else
continue
;
}
++
(
*
ptr
);
}
data
->
path_len
=
*
ptr
-
data
->
path
;
TRACE
(
"(%p %p %x): Parsed opaque URI path %s len=%d
\n
"
,
ptr
,
data
,
flags
,
debugstr_wn
(
data
->
path
,
data
->
path_len
),
data
->
path_len
);
return
TRUE
;
}
/* Determines how the URI should be parsed after the scheme information.
/* Determines how the URI should be parsed after the scheme information.
*
*
* If the scheme is followed, by "//" then, it is treated as an hierarchical URI
* If the scheme is followed, by "//" then, it is treated as an hierarchical URI
...
@@ -1615,7 +1646,9 @@ static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) {
...
@@ -1615,7 +1646,9 @@ static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) {
TRACE
(
"(%p %p %x): Treating URI as an opaque URI.
\n
"
,
ptr
,
data
,
flags
);
TRACE
(
"(%p %p %x): Treating URI as an opaque URI.
\n
"
,
ptr
,
data
,
flags
);
data
->
is_opaque
=
TRUE
;
data
->
is_opaque
=
TRUE
;
/* TODO: Handle opaque URI's, parse path. */
if
(
!
parse_path_opaque
(
ptr
,
data
,
flags
))
return
FALSE
;
return
TRUE
;
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