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
8063f5cb
Commit
8063f5cb
authored
Sep 03, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Move handling of default request parameters into build_request_string().
parent
9f8d4fe0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
request.c
dlls/winhttp/request.c
+11
-3
session.c
dlls/winhttp/session.c
+3
-11
No files found.
dlls/winhttp/request.c
View file @
8063f5cb
...
...
@@ -458,17 +458,25 @@ BOOL WINAPI WinHttpAddRequestHeaders( HINTERNET hrequest, LPCWSTR headers, DWORD
return
ret
;
}
static
WCHAR
*
build_request_string
(
request_t
*
request
,
LPCWSTR
verb
,
LPCWSTR
path
,
LPCWSTR
version
)
static
WCHAR
*
build_request_string
(
request_t
*
request
)
{
static
const
WCHAR
space
[]
=
{
' '
,
0
};
static
const
WCHAR
crlf
[]
=
{
'\r'
,
'\n'
,
0
};
static
const
WCHAR
colon
[]
=
{
':'
,
' '
,
0
};
static
const
WCHAR
twocrlf
[]
=
{
'\r'
,
'\n'
,
'\r'
,
'\n'
,
0
};
static
const
WCHAR
get
[]
=
{
'G'
,
'E'
,
'T'
,
0
};
static
const
WCHAR
slash
[]
=
{
'/'
,
0
};
static
const
WCHAR
http1_1
[]
=
{
'H'
,
'T'
,
'T'
,
'P'
,
'/'
,
'1'
,
'.'
,
'1'
,
0
};
WCHAR
*
ret
;
const
WCHAR
**
headers
,
**
p
;
const
WCHAR
*
verb
=
get
,
*
path
=
slash
,
*
version
=
http1_1
;
unsigned
int
len
,
i
=
0
,
j
;
if
(
request
->
verb
&&
request
->
verb
[
0
])
verb
=
request
->
verb
;
if
(
request
->
path
&&
request
->
path
[
0
])
path
=
request
->
path
;
if
(
request
->
version
&&
request
->
version
[
0
])
version
=
request
->
version
;
/* allocate space for an array of all the string pointers to be added */
len
=
request
->
num_headers
*
4
+
7
;
if
(
!
(
headers
=
heap_alloc
(
len
*
sizeof
(
LPCWSTR
)
)))
return
NULL
;
...
...
@@ -537,7 +545,7 @@ static BOOL query_headers( request_t *request, DWORD level, LPCWSTR name, LPVOID
DWORD
len
;
if
(
request_only
)
headers
=
build_request_string
(
request
,
request
->
verb
,
request
->
path
,
request
->
version
);
headers
=
build_request_string
(
request
);
else
headers
=
request
->
raw_headers
;
...
...
@@ -752,7 +760,7 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
}
if
(
!
(
ret
=
open_connection
(
request
)))
goto
end
;
if
(
!
(
req
=
build_request_string
(
request
,
request
->
verb
,
request
->
path
,
request
->
version
)))
goto
end
;
if
(
!
(
req
=
build_request_string
(
request
)))
goto
end
;
if
(
!
(
req_ascii
=
strdupWA
(
req
)))
goto
end
;
TRACE
(
"full request: %s
\n
"
,
debugstr_a
(
req_ascii
));
...
...
dlls/winhttp/session.c
View file @
8063f5cb
...
...
@@ -232,10 +232,6 @@ static const object_vtbl_t request_vtbl =
HINTERNET
WINAPI
WinHttpOpenRequest
(
HINTERNET
hconnect
,
LPCWSTR
verb
,
LPCWSTR
object
,
LPCWSTR
version
,
LPCWSTR
referrer
,
LPCWSTR
*
types
,
DWORD
flags
)
{
static
const
WCHAR
get
[]
=
{
'G'
,
'E'
,
'T'
,
0
};
static
const
WCHAR
slash
[]
=
{
'/'
,
0
};
static
const
WCHAR
http1_1
[]
=
{
'H'
,
'T'
,
'T'
,
'P'
,
'/'
,
'1'
,
'.'
,
'1'
,
0
};
request_t
*
request
;
connect_t
*
connect
;
HINTERNET
hrequest
=
NULL
;
...
...
@@ -272,13 +268,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
)
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
;
if
(
!
(
request
->
version
=
strdupW
(
version
)))
goto
end
;
if
(
verb
&&
!
(
request
->
verb
=
strdupW
(
verb
)))
goto
end
;
if
(
object
&&
!
(
request
->
path
=
strdupW
(
object
)))
goto
end
;
if
(
version
&&
!
(
request
->
version
=
strdupW
(
version
)))
goto
end
;
if
(
!
(
hrequest
=
alloc_handle
(
&
request
->
hdr
)))
goto
end
;
request
->
hdr
.
handle
=
hrequest
;
...
...
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