Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
8063f5cb
Commit
8063f5cb
authored
16 years ago
by
Hans Leidekker
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
winhttp: Move handling of default request parameters into build_request_string().
parent
9f8d4fe0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/winhttp/request.c
+11
-3
11 additions, 3 deletions
dlls/winhttp/request.c
dlls/winhttp/session.c
+3
-11
3 additions, 11 deletions
dlls/winhttp/session.c
with
14 additions
and
14 deletions
dlls/winhttp/request.c
+
11
−
3
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
));
...
...
This diff is collapsed.
Click to expand it.
dlls/winhttp/session.c
+
3
−
11
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment