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
13ba609b
Commit
13ba609b
authored
Aug 28, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Use default values when empty strings are passed for verb, object and version parameters.
parent
f732065c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
3 deletions
+43
-3
session.c
dlls/winhttp/session.c
+3
-3
winhttp.c
dlls/winhttp/tests/winhttp.c
+40
-0
No files found.
dlls/winhttp/session.c
View file @
13ba609b
...
...
@@ -272,9 +272,9 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
if
(
!
netconn_init
(
&
request
->
netconn
,
request
->
hdr
.
flags
&
WINHTTP_FLAG_SECURE
))
goto
end
;
if
(
!
verb
)
verb
=
get
;
if
(
!
object
)
object
=
slash
;
if
(
!
version
)
version
=
http1_1
;
if
(
!
verb
||
!*
verb
)
verb
=
get
;
if
(
!
object
||
!*
object
)
object
=
slash
;
if
(
!
version
||
!*
version
)
version
=
http1_1
;
if
(
!
(
request
->
verb
=
strdupW
(
verb
)))
goto
end
;
if
(
!
(
request
->
path
=
strdupW
(
object
)))
goto
end
;
...
...
dlls/winhttp/tests/winhttp.c
View file @
13ba609b
...
...
@@ -573,6 +573,45 @@ static void test_secure_connection(void)
WinHttpCloseHandle
(
ses
);
}
static
void
test_request_parameter_defaults
(
void
)
{
static
const
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
codeweavers
[]
=
{
'c'
,
'o'
,
'd'
,
'e'
,
'w'
,
'e'
,
'a'
,
'v'
,
'e'
,
'r'
,
's'
,
'.'
,
'c'
,
'o'
,
'm'
,
0
};
HANDLE
ses
,
con
,
req
;
BOOL
ret
;
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
codeweavers
,
0
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
());
req
=
WinHttpOpenRequest
(
con
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
());
WinHttpCloseHandle
(
req
);
req
=
WinHttpOpenRequest
(
con
,
empty
,
empty
,
empty
,
NULL
,
NULL
,
0
);
ok
(
req
!=
NULL
,
"failed to open a request %u
\n
"
,
GetLastError
());
ret
=
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
0
);
ok
(
ret
,
"failed to send request %u
\n
"
,
GetLastError
());
ret
=
WinHttpReceiveResponse
(
req
,
NULL
);
ok
(
ret
,
"failed to receive response %u
\n
"
,
GetLastError
());
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
WinHttpCloseHandle
(
ses
);
}
START_TEST
(
winhttp
)
{
test_OpenRequest
();
...
...
@@ -581,4 +620,5 @@ START_TEST (winhttp)
test_WinHttpTimeToSystemTime
();
test_WinHttpAddHeaders
();
test_secure_connection
();
test_request_parameter_defaults
();
}
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