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
e078f618
Commit
e078f618
authored
Sep 03, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement some more options.
parent
c614a248
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
6 deletions
+80
-6
request.c
dlls/winhttp/request.c
+2
-2
session.c
dlls/winhttp/session.c
+69
-3
winhttp.c
dlls/winhttp/tests/winhttp.c
+6
-1
winhttp_private.h
dlls/winhttp/winhttp_private.h
+3
-0
No files found.
dlls/winhttp/request.c
View file @
e078f618
...
...
@@ -768,7 +768,7 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
sprintfW
(
length
,
length_fmt
,
total_len
);
process_header
(
request
,
attr_content_length
,
length
,
WINHTTP_ADDREQ_FLAG_ADD_IF_NEW
,
TRUE
);
}
if
(
!
(
request
->
hdr
.
flags
&
WINHTTP_DISABLE_KEEP_ALIVE
))
if
(
!
(
request
->
hdr
.
disable_
flags
&
WINHTTP_DISABLE_KEEP_ALIVE
))
{
process_header
(
request
,
attr_connection
,
keep_alive
,
WINHTTP_ADDREQ_FLAG_ADD_IF_NEW
,
TRUE
);
}
...
...
@@ -1097,7 +1097,7 @@ BOOL WINAPI WinHttpReceiveResponse( HINTERNET hrequest, LPVOID reserved )
if
(
status
==
200
)
break
;
if
(
status
==
301
||
status
==
302
)
{
if
(
request
->
hdr
.
flags
&
WINHTTP_DISABLE_REDIRECTS
)
break
;
if
(
request
->
hdr
.
disable_
flags
&
WINHTTP_DISABLE_REDIRECTS
)
break
;
drain_content
(
request
);
if
(
!
(
ret
=
handle_redirect
(
request
)))
break
;
}
...
...
dlls/winhttp/session.c
View file @
e078f618
...
...
@@ -69,11 +69,36 @@ static void session_destroy( object_header_t *hdr )
heap_free
(
session
);
}
static
BOOL
session_set_option
(
object_header_t
*
hdr
,
DWORD
option
,
LPVOID
buffer
,
DWORD
buflen
)
{
switch
(
option
)
{
case
WINHTTP_OPTION_PROXY
:
{
WINHTTP_PROXY_INFO
*
pi
=
buffer
;
FIXME
(
"%u %s %s
\n
"
,
pi
->
dwAccessType
,
debugstr_w
(
pi
->
lpszProxy
),
debugstr_w
(
pi
->
lpszProxyBypass
));
return
TRUE
;
}
case
WINHTTP_OPTION_REDIRECT_POLICY
:
{
DWORD
policy
=
*
(
DWORD
*
)
buffer
;
TRACE
(
"0x%x
\n
"
,
policy
);
hdr
->
redirect_policy
=
policy
;
return
TRUE
;
}
default:
FIXME
(
"unimplemented option %u
\n
"
,
option
);
return
TRUE
;
}
}
static
const
object_vtbl_t
session_vtbl
=
{
session_destroy
,
NULL
,
NULL
session_set_option
};
/***********************************************************************
...
...
@@ -220,11 +245,52 @@ static void request_destroy( object_header_t *hdr )
heap_free
(
request
);
}
static
BOOL
request_set_option
(
object_header_t
*
hdr
,
DWORD
option
,
LPVOID
buffer
,
DWORD
buflen
)
{
switch
(
option
)
{
case
WINHTTP_OPTION_PROXY
:
{
WINHTTP_PROXY_INFO
*
pi
=
buffer
;
FIXME
(
"%u %s %s
\n
"
,
pi
->
dwAccessType
,
debugstr_w
(
pi
->
lpszProxy
),
debugstr_w
(
pi
->
lpszProxyBypass
));
return
TRUE
;
}
case
WINHTTP_OPTION_DISABLE_FEATURE
:
{
DWORD
disable
=
*
(
DWORD
*
)
buffer
;
TRACE
(
"0x%x
\n
"
,
disable
);
hdr
->
disable_flags
&=
disable
;
return
TRUE
;
}
case
WINHTTP_OPTION_AUTOLOGON_POLICY
:
{
DWORD
policy
=
*
(
DWORD
*
)
buffer
;
TRACE
(
"0x%x
\n
"
,
policy
);
hdr
->
logon_policy
=
policy
;
return
TRUE
;
}
case
WINHTTP_OPTION_REDIRECT_POLICY
:
{
DWORD
policy
=
*
(
DWORD
*
)
buffer
;
TRACE
(
"0x%x
\n
"
,
policy
);
hdr
->
redirect_policy
=
policy
;
return
TRUE
;
}
default:
FIXME
(
"unimplemented option %u
\n
"
,
option
);
return
TRUE
;
}
}
static
const
object_vtbl_t
request_vtbl
=
{
request_destroy
,
NULL
,
NULL
request_set_option
};
/***********************************************************************
...
...
@@ -350,7 +416,7 @@ BOOL WINAPI WinHttpQueryOption( HINTERNET handle, DWORD option, LPVOID buffer, L
static
BOOL
set_option
(
object_header_t
*
hdr
,
DWORD
option
,
LPVOID
buffer
,
DWORD
buflen
)
{
BOOL
ret
=
FALS
E
;
BOOL
ret
=
TRU
E
;
switch
(
option
)
{
...
...
dlls/winhttp/tests/winhttp.c
View file @
e078f618
...
...
@@ -532,12 +532,16 @@ static void test_secure_connection(void)
static
const
WCHAR
google
[]
=
{
'w'
,
'w'
,
'w'
,
'.'
,
'g'
,
'o'
,
'o'
,
'g'
,
'l'
,
'e'
,
'.'
,
'c'
,
'o'
,
'm'
,
0
};
HANDLE
ses
,
con
,
req
;
DWORD
size
,
status
;
DWORD
size
,
status
,
policy
;
BOOL
ret
;
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
policy
=
WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS
;
ret
=
WinHttpSetOption
(
ses
,
WINHTTP_OPTION_REDIRECT_POLICY
,
&
policy
,
sizeof
(
policy
));
ok
(
ret
,
"failed to set redirect policy %u
\n
"
,
GetLastError
());
con
=
WinHttpConnect
(
ses
,
google
,
443
,
0
);
ok
(
con
!=
NULL
,
"failed to open a connection %u
\n
"
,
GetLastError
());
...
...
@@ -569,6 +573,7 @@ static void test_secure_connection(void)
size
=
sizeof
(
status
);
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_STATUS_CODE
|
WINHTTP_QUERY_FLAG_NUMBER
,
NULL
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"failed unexpectedly %u
\n
"
,
GetLastError
());
ok
(
status
==
200
,
"request failed unexpectedly %u
\n
"
,
status
);
size
=
0
;
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_RAW_HEADERS_CRLF
,
NULL
,
NULL
,
&
size
,
NULL
);
...
...
dlls/winhttp/winhttp_private.h
View file @
e078f618
...
...
@@ -51,6 +51,9 @@ struct _object_header_t
HINTERNET
handle
;
const
object_vtbl_t
*
vtbl
;
DWORD
flags
;
DWORD
disable_flags
;
DWORD
logon_policy
;
DWORD
redirect_policy
;
DWORD
error
;
DWORD_PTR
context
;
LONG
refs
;
...
...
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