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
1cd00dae
Commit
1cd00dae
authored
Feb 25, 2003
by
Uwe Bonnes
Committed by
Alexandre Julliard
Feb 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InternetOpenUrlA (http/s case): Use client for HttpOpenRequestA, don't
insert HOST: twice. HttpAddRequestHeadersA: allow lpszHeader == NULL.
parent
1b74cf2c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
2 deletions
+69
-2
http.c
dlls/wininet/http.c
+2
-0
internet.c
dlls/wininet/internet.c
+1
-2
http.c
dlls/wininet/tests/http.c
+66
-0
No files found.
dlls/wininet/http.c
View file @
1cd00dae
...
...
@@ -119,6 +119,8 @@ BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest,
return
FALSE
;
}
if
(
!
lpszHeader
)
return
TRUE
;
buffer
=
HTTP_strdup
(
lpszHeader
);
lpszStart
=
buffer
;
...
...
dlls/wininet/internet.c
View file @
1cd00dae
...
...
@@ -1736,13 +1736,12 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
password
,
INTERNET_SERVICE_HTTP
,
dwFlags
,
dwContext
);
if
(
client
==
NULL
)
return
NULL
;
client1
=
HttpOpenRequestA
(
hInterne
t
,
NULL
,
path
,
NULL
,
NULL
,
accept
,
dwFlags
,
dwContext
);
client1
=
HttpOpenRequestA
(
clien
t
,
NULL
,
path
,
NULL
,
NULL
,
accept
,
dwFlags
,
dwContext
);
if
(
client1
==
NULL
)
{
InternetCloseHandle
(
client
);
return
NULL
;
}
HttpAddRequestHeadersA
(
client1
,
lpszHeaders
,
dwHeadersLength
,
HTTP_ADDREQ_FLAG_ADD
);
HttpAddRequestHeadersA
(
client1
,
hostreq
,
-
1L
,
HTTP_ADDREQ_FLAG_ADD_IF_NEW
);
if
(
!
HttpSendRequestA
(
client1
,
NULL
,
0
,
NULL
,
0
))
{
InternetCloseHandle
(
client1
);
InternetCloseHandle
(
client
);
...
...
dlls/wininet/tests/http.c
View file @
1cd00dae
...
...
@@ -202,9 +202,75 @@ abort:
}
}
void
InternetOpenUrlA_test
(
void
)
{
HINTERNET
myhinternet
,
myhttp
;
char
buffer
[
0x400
];
URL_COMPONENTSA
urlComponents
;
char
protocol
[
32
],
hostName
[
1024
],
userName
[
1024
];
char
password
[
1024
],
extra
[
1024
],
path
[
1024
];
DWORD
size
,
readbytes
,
totalbytes
=
0
;
myhinternet
=
InternetOpen
(
"Winetest"
,
0
,
NULL
,
NULL
,
INTERNET_FLAG_NO_CACHE_WRITE
);
ok
((
myhinternet
!=
0
),
"InternetOpen failed, error %lx
\n
"
,
GetLastError
());
size
=
0x400
;
ok
(
InternetCanonicalizeUrl
(
"http://LTspice.linear-tech.com/fieldsync2/release.log.gz"
,
buffer
,
&
size
,
ICU_BROWSER_MODE
),
"InternetCanonicalizeUrl failed, error %lx
\n
"
,
GetLastError
());
urlComponents
.
dwStructSize
=
sizeof
(
URL_COMPONENTSA
);
urlComponents
.
lpszScheme
=
protocol
;
urlComponents
.
dwSchemeLength
=
32
;
urlComponents
.
lpszHostName
=
hostName
;
urlComponents
.
dwHostNameLength
=
1024
;
urlComponents
.
lpszUserName
=
userName
;
urlComponents
.
dwUserNameLength
=
1024
;
urlComponents
.
lpszPassword
=
password
;
urlComponents
.
dwPasswordLength
=
1024
;
urlComponents
.
lpszUrlPath
=
path
;
urlComponents
.
dwUrlPathLength
=
2048
;
urlComponents
.
lpszExtraInfo
=
extra
;
urlComponents
.
dwExtraInfoLength
=
1024
;
ok
((
InternetCrackUrl
(
"http://LTspice.linear-tech.com/fieldsync2/release.log.gz"
,
0
,
0
,
&
urlComponents
)),
"InternetCrackUrl failed, error %lx
\n
"
,
GetLastError
());
myhttp
=
InternetOpenUrl
(
myhinternet
,
"http://LTspice.linear-tech.com/fieldsync2/release.log.gz"
,
0
,
0
,
INTERNET_FLAG_RELOAD
|
INTERNET_FLAG_NO_CACHE_WRITE
|
INTERNET_FLAG_TRANSFER_BINARY
,
0
);
ok
((
myhttp
!=
0
),
"InternetOpenUrl failed, error %lx
\n
"
,
GetLastError
());
ok
(
InternetReadFile
(
myhttp
,
buffer
,
0x400
,
&
readbytes
),
"InternetReadFile failed, error %lx
\n
"
,
GetLastError
());
totalbytes
+=
readbytes
;
while
(
readbytes
&&
InternetReadFile
(
myhttp
,
buffer
,
0x400
,
&
readbytes
))
totalbytes
+=
readbytes
;
printf
(
"read 0x%08lx bytes
\n
"
,
totalbytes
);
}
void
InternetCrackUrl_test
(
void
)
{
URL_COMPONENTSA
urlComponents
;
char
protocol
[
32
],
hostName
[
1024
],
userName
[
1024
];
char
password
[
1024
],
extra
[
1024
],
path
[
1024
];
urlComponents
.
dwStructSize
=
sizeof
(
URL_COMPONENTSA
);
urlComponents
.
lpszScheme
=
protocol
;
urlComponents
.
dwSchemeLength
=
32
;
urlComponents
.
lpszHostName
=
hostName
;
urlComponents
.
dwHostNameLength
=
1024
;
urlComponents
.
lpszUserName
=
userName
;
urlComponents
.
dwUserNameLength
=
1024
;
urlComponents
.
lpszPassword
=
password
;
urlComponents
.
dwPasswordLength
=
1024
;
urlComponents
.
lpszUrlPath
=
path
;
urlComponents
.
dwUrlPathLength
=
2048
;
urlComponents
.
lpszExtraInfo
=
extra
;
urlComponents
.
dwExtraInfoLength
=
1024
;
ok
((
InternetCrackUrl
(
"http://LTspice.linear-tech.com/fieldsync2/release.log.gz"
,
0
,
0
,
&
urlComponents
)),
"InternetCrackUrl failed, error %lx
\n
"
,
GetLastError
());
ok
((
strcmp
(
"/fieldsync2/release.log.gz"
,
path
)
==
0
),
"path cracked wrong"
);
}
START_TEST
(
http
)
{
winapi_test
(
0x10000000
);
winapi_test
(
0x00000000
);
InternetCrackUrl_test
();
InternetOpenUrlA_test
();
}
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