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
216474c2
Commit
216474c2
authored
May 18, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use compose_request_url in INTERNET_OPTION_URL implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
453e0e11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
http.c
dlls/wininet/http.c
+8
-7
http.c
dlls/wininet/tests/http.c
+11
-1
No files found.
dlls/wininet/http.c
View file @
216474c2
...
...
@@ -2116,17 +2116,18 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
return
ERROR_SUCCESS
;
case
INTERNET_OPTION_URL
:
{
static
const
WCHAR
httpW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
0
}
;
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
]
;
WCHAR
*
url
;
DWORD
res
;
TRACE
(
"INTERNET_OPTION_URL
\n
"
);
strcpyW
(
url
,
httpW
);
strcatW
(
url
,
req
->
server
->
canon_host_port
);
strcatW
(
url
,
req
->
path
)
;
url
=
compose_request_url
(
req
);
if
(
!
url
)
return
ERROR_OUTOFMEMORY
;
TRACE
(
"INTERNET_OPTION_URL: %s
\n
"
,
debugstr_w
(
url
));
return
str_to_buffer
(
url
,
buffer
,
size
,
unicode
);
res
=
str_to_buffer
(
url
,
buffer
,
size
,
unicode
);
heap_free
(
url
);
return
res
;
}
case
INTERNET_OPTION_USER_AGENT
:
return
str_to_buffer
(
req
->
session
->
appInfo
->
agent
,
buffer
,
size
,
unicode
);
...
...
dlls/wininet/tests/http.c
View file @
216474c2
...
...
@@ -4720,8 +4720,9 @@ static void test_http_read(int port)
static
void
test_long_url
(
int
port
)
{
char
long_path
[
INTERNET_MAX_PATH_LENGTH
*
2
]
=
"/echo_request?"
;
char
buf
[
sizeof
(
long_path
)
*
2
];
char
buf
[
sizeof
(
long_path
)
*
2
]
,
url
[
sizeof
(
buf
)]
;
test_request_t
req
;
DWORD
size
,
len
;
BOOL
ret
;
memset
(
long_path
+
strlen
(
long_path
),
'x'
,
sizeof
(
long_path
)
-
strlen
(
long_path
));
...
...
@@ -4735,6 +4736,15 @@ static void test_long_url(int port)
receive_simple_request
(
req
.
request
,
buf
,
sizeof
(
buf
));
ok
(
strstr
(
buf
,
long_path
)
!=
NULL
,
"long pathnot found in %s
\n
"
,
buf
);
sprintf
(
url
,
"http://localhost:%u%s"
,
port
,
long_path
);
size
=
sizeof
(
buf
);
ret
=
InternetQueryOptionA
(
req
.
request
,
INTERNET_OPTION_URL
,
buf
,
&
size
);
ok
(
ret
,
"InternetQueryOptionA(INTERNET_OPTION_URL) failed: %u
\n
"
,
GetLastError
());
len
=
strlen
(
url
);
ok
(
size
==
len
,
"size = %u, expected %u
\n
"
,
size
,
len
);
ok
(
!
strcmp
(
buf
,
url
),
"Wrong URL %s, expected %s
\n
"
,
buf
,
url
);
close_request
(
&
req
);
}
...
...
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