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
b0fcaf9d
Commit
b0fcaf9d
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: Further InternetCreateFileW fixes.
- Add the slash after the port number. - Only add the port number if the host name is present.
parent
d3047aae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
23 deletions
+45
-23
internet.c
dlls/wininet/internet.c
+28
-21
http.c
dlls/wininet/tests/http.c
+17
-2
No files found.
dlls/wininet/internet.c
View file @
b0fcaf9d
...
...
@@ -3783,20 +3783,23 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
if
(
lpUrlComponents
->
lpszHostName
)
{
*
lpdwUrlLength
+=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
HostName
);
if
(
!
url_uses_default_port
(
nScheme
,
lpUrlComponents
->
nPort
))
{
char
szPort
[
MAX_WORD_DIGITS
];
sprintf
(
szPort
,
"%d"
,
lpUrlComponents
->
nPort
);
*
lpdwUrlLength
+=
strlen
(
szPort
);
*
lpdwUrlLength
+=
strlen
(
":"
);
}
if
(
lpUrlComponents
->
lpszUrlPath
&&
*
lpUrlComponents
->
lpszUrlPath
!=
'/'
)
(
*
lpdwUrlLength
)
++
;
/* '/' */
}
if
(
!
url_uses_default_port
(
nScheme
,
lpUrlComponents
->
nPort
))
{
char
szPort
[
MAX_WORD_DIGITS
];
sprintf
(
szPort
,
"%d"
,
lpUrlComponents
->
nPort
);
*
lpdwUrlLength
+=
strlen
(
szPort
);
*
lpdwUrlLength
+=
strlen
(
":"
);
}
if
(
lpUrlComponents
->
lpszUrlPath
)
*
lpdwUrlLength
+=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
UrlPath
);
*
lpdwUrlLength
+=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
UrlPath
);
return
TRUE
;
}
...
...
@@ -4016,6 +4019,18 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
memcpy
(
lpszUrl
,
lpUrlComponents
->
lpszHostName
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
if
(
!
url_uses_default_port
(
nScheme
,
lpUrlComponents
->
nPort
))
{
WCHAR
szPort
[
MAX_WORD_DIGITS
];
sprintfW
(
szPort
,
percentD
,
lpUrlComponents
->
nPort
);
*
lpszUrl
=
':'
;
lpszUrl
++
;
dwLen
=
strlenW
(
szPort
);
memcpy
(
lpszUrl
,
szPort
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
}
/* add slash between hostname and path if necessary */
if
(
lpUrlComponents
->
lpszUrlPath
&&
*
lpUrlComponents
->
lpszUrlPath
!=
'/'
)
{
...
...
@@ -4024,22 +4039,14 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
}
}
if
(
!
url_uses_default_port
(
nScheme
,
lpUrlComponents
->
nPort
))
{
WCHAR
szPort
[
MAX_WORD_DIGITS
];
sprintfW
(
szPort
,
percentD
,
lpUrlComponents
->
nPort
);
*
lpszUrl
=
':'
;
lpszUrl
++
;
dwLen
=
strlenW
(
szPort
);
memcpy
(
lpszUrl
,
szPort
,
dwLen
*
sizeof
(
WCHAR
));
if
(
lpUrlComponents
->
lpszUrlPath
)
{
dwLen
=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
UrlPath
);
memcpy
(
lpszUrl
,
lpUrlComponents
->
lpszUrlPath
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
}
dwLen
=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
UrlPath
);
memcpy
(
lpszUrl
,
lpUrlComponents
->
lpszUrlPath
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
*
lpszUrl
=
'\0'
;
return
TRUE
;
...
...
dlls/wininet/tests/http.c
View file @
b0fcaf9d
...
...
@@ -49,6 +49,7 @@
#define CREATE_URL8 "https://username:password@www.winehq.org/site/about"
#define CREATE_URL9 "about:blank"
#define CREATE_URL10 "about://host/blank"
#define CREATE_URL11 "about:"
static
HANDLE
hCompleteEvent
;
...
...
@@ -1129,8 +1130,22 @@ static void InternetCreateUrlA_test(void)
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
len
==
strlen
(
CREATE_URL10
),
"Expected len %d, got %ld
\n
"
,
strlen
(
CREATE_URL9
),
len
);
ok
(
!
strcmp
(
szUrl
,
CREATE_URL10
),
"Expected %s, got %s
\n
"
,
CREATE_URL9
,
szUrl
);
ok
(
len
==
strlen
(
CREATE_URL10
),
"Expected len %d, got %ld
\n
"
,
strlen
(
CREATE_URL10
),
len
);
ok
(
!
strcmp
(
szUrl
,
CREATE_URL10
),
"Expected %s, got %s
\n
"
,
CREATE_URL10
,
szUrl
);
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
nPort
=
8080
;
urlComp
.
lpszScheme
=
"about"
;
len
=
strlen
(
CREATE_URL11
);
len
++
;
/* work around bug in native wininet */
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
len
==
strlen
(
CREATE_URL11
),
"Expected len %d, got %ld
\n
"
,
strlen
(
CREATE_URL11
),
len
);
ok
(
!
strcmp
(
szUrl
,
CREATE_URL11
),
"Expected %s, got %s
\n
"
,
CREATE_URL11
,
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