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
d8263344
Commit
d8263344
authored
Sep 29, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Oct 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Restructured how ports are canonicalized.
parent
a057153c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
uri.c
dlls/urlmon/uri.c
+20
-19
No files found.
dlls/urlmon/uri.c
View file @
d8263344
...
@@ -2764,8 +2764,6 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
...
@@ -2764,8 +2764,6 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
USHORT
default_port
=
0
;
USHORT
default_port
=
0
;
DWORD
i
;
DWORD
i
;
uri
->
has_port
=
FALSE
;
/* Check if the scheme has a default port. */
/* Check if the scheme has a default port. */
for
(
i
=
0
;
i
<
sizeof
(
default_ports
)
/
sizeof
(
default_ports
[
0
]);
++
i
)
{
for
(
i
=
0
;
i
<
sizeof
(
default_ports
)
/
sizeof
(
default_ports
[
0
]);
++
i
)
{
if
(
default_ports
[
i
].
scheme
==
data
->
scheme_type
)
{
if
(
default_ports
[
i
].
scheme
==
data
->
scheme_type
)
{
...
@@ -2775,8 +2773,7 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
...
@@ -2775,8 +2773,7 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
}
}
}
}
if
(
data
->
port
||
has_default_port
)
uri
->
has_port
=
data
->
has_port
||
has_default_port
;
uri
->
has_port
=
TRUE
;
/* Possible cases:
/* Possible cases:
* 1) Has a port which is the default port.
* 1) Has a port which is the default port.
...
@@ -2784,38 +2781,42 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
...
@@ -2784,38 +2781,42 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO
* 3) Doesn't have a port, but, scheme has a default port.
* 3) Doesn't have a port, but, scheme has a default port.
* 4) No port.
* 4) No port.
*/
*/
if
(
has_default_port
&&
data
->
port
&&
data
->
port_value
==
default_port
)
{
if
(
has_default_port
&&
data
->
has_
port
&&
data
->
port_value
==
default_port
)
{
/* If it's the default port and this flag isn't set, don't do anything. */
/* If it's the default port and this flag isn't set, don't do anything. */
if
(
flags
&
Uri_CREATE_NO_CANONICALIZE
)
{
if
(
flags
&
Uri_CREATE_NO_CANONICALIZE
)
{
/* Copy the original port over. */
if
(
!
computeOnly
)
if
(
!
computeOnly
)
{
uri
->
canon_uri
[
uri
->
canon_len
]
=
':'
;
uri
->
canon_uri
[
uri
->
canon_len
]
=
':'
;
memcpy
(
uri
->
canon_uri
+
uri
->
canon_len
+
1
,
data
->
port
,
data
->
port_len
*
sizeof
(
WCHAR
));
++
uri
->
canon_len
;
if
(
data
->
port
)
{
/* Copy the original port over. */
if
(
!
computeOnly
)
memcpy
(
uri
->
canon_uri
+
uri
->
canon_len
,
data
->
port
,
data
->
port_len
*
sizeof
(
WCHAR
));
uri
->
canon_len
+=
data
->
port_len
;
}
else
{
if
(
!
computeOnly
)
uri
->
canon_len
+=
ui2str
(
uri
->
canon_uri
+
uri
->
canon_len
,
data
->
port_value
);
else
uri
->
canon_len
+=
ui2str
(
NULL
,
data
->
port_value
);
}
}
uri
->
canon_len
+=
data
->
port_len
+
1
;
}
}
uri
->
port
=
default_port
;
uri
->
port
=
default_port
;
}
else
if
(
data
->
port
)
{
}
else
if
(
data
->
has_
port
)
{
if
(
!
computeOnly
)
if
(
!
computeOnly
)
uri
->
canon_uri
[
uri
->
canon_len
]
=
':'
;
uri
->
canon_uri
[
uri
->
canon_len
]
=
':'
;
++
uri
->
canon_len
;
++
uri
->
canon_len
;
if
(
flags
&
Uri_CREATE_NO_CANONICALIZE
)
{
if
(
flags
&
Uri_CREATE_NO_CANONICALIZE
&&
data
->
port
)
{
/* Copy the original over without changes. */
/* Copy the original over without changes. */
if
(
!
computeOnly
)
if
(
!
computeOnly
)
memcpy
(
uri
->
canon_uri
+
uri
->
canon_len
,
data
->
port
,
data
->
port_len
*
sizeof
(
WCHAR
));
memcpy
(
uri
->
canon_uri
+
uri
->
canon_len
,
data
->
port
,
data
->
port_len
*
sizeof
(
WCHAR
));
uri
->
canon_len
+=
data
->
port_len
;
uri
->
canon_len
+=
data
->
port_len
;
}
else
{
}
else
{
const
WCHAR
formatW
[]
=
{
'%'
,
'u'
,
0
};
INT
len
=
0
;
if
(
!
computeOnly
)
if
(
!
computeOnly
)
len
=
sprintfW
(
uri
->
canon_uri
+
uri
->
canon_len
,
formatW
,
data
->
port_value
);
uri
->
canon_len
+=
ui2str
(
uri
->
canon_uri
+
uri
->
canon_len
,
data
->
port_value
);
else
{
else
WCHAR
tmp
[
6
];
uri
->
canon_len
+=
ui2str
(
NULL
,
data
->
port_value
);
len
=
sprintfW
(
tmp
,
formatW
,
data
->
port_value
);
}
uri
->
canon_len
+=
len
;
}
}
uri
->
port
=
data
->
port_value
;
uri
->
port
=
data
->
port_value
;
...
...
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