Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
8eab78c2
Commit
8eab78c2
authored
Mar 09, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: More InternetCreateUrlW fixes.
- Don't add double slashes for opaque URLs. - The default port number for all other schemes is 0.
parent
e58a448c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
internet.c
dlls/wininet/internet.c
+27
-4
http.c
dlls/wininet/tests/http.c
+0
-2
No files found.
dlls/wininet/internet.c
View file @
8eab78c2
...
...
@@ -3700,9 +3700,23 @@ static BOOL url_uses_default_port(INTERNET_SCHEME nScheme, INTERNET_PORT nPort)
(
nPort
==
INTERNET_DEFAULT_GOPHER_PORT
))
return
TRUE
;
if
(
nPort
==
INTERNET_INVALID_PORT_NUMBER
)
return
TRUE
;
return
FALSE
;
}
/* opaque urls do not fit into the standard url hierarchy and don't have
* two following slashes */
static
inline
BOOL
scheme_is_opaque
(
INTERNET_SCHEME
nScheme
)
{
return
(
nScheme
!=
INTERNET_SCHEME_FTP
)
&&
(
nScheme
!=
INTERNET_SCHEME_GOPHER
)
&&
(
nScheme
!=
INTERNET_SCHEME_HTTP
)
&&
(
nScheme
!=
INTERNET_SCHEME_HTTPS
)
&&
(
nScheme
!=
INTERNET_SCHEME_FILE
);
}
static
LPCWSTR
INTERNET_GetSchemeString
(
INTERNET_SCHEME
scheme
)
{
int
index
;
...
...
@@ -3742,7 +3756,9 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
*
lpdwUrlLength
+=
strlenW
(
scheme
);
}
*
lpdwUrlLength
+=
strlen
(
"://"
);
(
*
lpdwUrlLength
)
++
;
/* ':' */
if
(
!
scheme_is_opaque
(
nScheme
)
||
lpUrlComponents
->
lpszHostName
)
*
lpdwUrlLength
+=
strlen
(
"//"
);
if
(
lpUrlComponents
->
lpszUserName
)
{
...
...
@@ -3909,7 +3925,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
DWORD
dwLen
;
INTERNET_SCHEME
nScheme
;
static
const
WCHAR
colonSlashW
[]
=
{
':'
,
'/'
,
'/'
};
static
const
WCHAR
slashSlashW
[]
=
{
'/'
,
'/'
};
static
const
WCHAR
percentD
[]
=
{
'%'
,
'd'
,
0
};
TRACE
(
"(%p,%ld,%p,%p)
\n
"
,
lpUrlComponents
,
dwFlags
,
lpszUrl
,
lpdwUrlLength
);
...
...
@@ -3960,8 +3976,15 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
lpszUrl
+=
dwLen
;
}
memcpy
(
lpszUrl
,
colonSlashW
,
sizeof
(
colonSlashW
));
lpszUrl
+=
sizeof
(
colonSlashW
)
/
sizeof
(
colonSlashW
[
0
]);
/* all schemes are followed by at least a colon */
*
lpszUrl
=
':'
;
lpszUrl
++
;
if
(
!
scheme_is_opaque
(
nScheme
)
||
lpUrlComponents
->
lpszHostName
)
{
memcpy
(
lpszUrl
,
slashSlashW
,
sizeof
(
slashSlashW
));
lpszUrl
+=
sizeof
(
slashSlashW
)
/
sizeof
(
slashSlashW
[
0
]);
}
if
(
lpUrlComponents
->
lpszUserName
)
{
...
...
dlls/wininet/tests/http.c
View file @
8eab78c2
...
...
@@ -1111,11 +1111,9 @@ static void InternetCreateUrlA_test(void)
len
=
strlen
(
CREATE_URL9
);
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
todo_wine
{
ok
(
ret
,
"Expected success
\n
"
);
ok
(
len
==
strlen
(
CREATE_URL9
),
"Expected len %d, got %ld
\n
"
,
strlen
(
CREATE_URL9
),
len
);
ok
(
!
strcmp
(
szUrl
,
CREATE_URL9
),
"Expected %s, got %s
\n
"
,
CREATE_URL9
,
szUrl
);
}
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
}
...
...
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