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
4ae5741c
Commit
4ae5741c
authored
Sep 16, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Move handling of default request parameters back to WinHttpOpenRequest.
Avoids special casing all over the place.
parent
8df906f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
request.c
dlls/winhttp/request.c
+6
-14
session.c
dlls/winhttp/session.c
+7
-3
winhttp_private.h
dlls/winhttp/winhttp_private.h
+5
-0
No files found.
dlls/winhttp/request.c
View file @
4ae5741c
...
...
@@ -480,28 +480,20 @@ static WCHAR *build_request_string( request_t *request )
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
;
headers
[
i
++
]
=
verb
;
headers
[
i
++
]
=
request
->
verb
;
headers
[
i
++
]
=
space
;
headers
[
i
++
]
=
path
;
headers
[
i
++
]
=
request
->
path
;
headers
[
i
++
]
=
space
;
headers
[
i
++
]
=
version
;
headers
[
i
++
]
=
request
->
version
;
for
(
j
=
0
;
j
<
request
->
num_headers
;
j
++
)
{
...
...
@@ -797,7 +789,6 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
static
const
WCHAR
keep_alive
[]
=
{
'K'
,
'e'
,
'e'
,
'p'
,
'-'
,
'A'
,
'l'
,
'i'
,
'v'
,
'e'
,
0
};
static
const
WCHAR
no_cache
[]
=
{
'n'
,
'o'
,
'-'
,
'c'
,
'a'
,
'c'
,
'h'
,
'e'
,
0
};
static
const
WCHAR
length_fmt
[]
=
{
'%'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
post
[]
=
{
'P'
,
'O'
,
'S'
,
'T'
,
0
};
BOOL
ret
=
FALSE
;
connect_t
*
connect
=
request
->
connect
;
...
...
@@ -813,7 +804,7 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
if
(
connect
->
hostname
)
add_host_header
(
request
,
connect
->
hostname
,
connect
->
hostport
,
WINHTTP_ADDREQ_FLAG_ADD_IF_NEW
);
if
(
total_len
||
(
request
->
verb
&&
!
strcmpW
(
request
->
verb
,
post
)))
if
(
total_len
||
(
request
->
verb
&&
!
strcmpW
(
request
->
verb
,
post
W
)))
{
WCHAR
length
[
21
];
/* decimal long int + null */
sprintfW
(
length
,
length_fmt
,
total_len
);
...
...
@@ -1114,6 +1105,7 @@ static BOOL handle_redirect( request_t *request )
if
(
!
(
request
->
path
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
end
;
strcpyW
(
request
->
path
,
uc
.
lpszUrlPath
);
}
else
request
->
path
=
strdupW
(
slashW
);
}
/* remove content-type/length headers */
...
...
@@ -1122,7 +1114,7 @@ static BOOL handle_redirect( request_t *request )
/* redirects are always GET requests */
heap_free
(
request
->
verb
);
request
->
verb
=
NULL
;
request
->
verb
=
strdupW
(
getW
)
;
ret
=
TRUE
;
end:
...
...
dlls/winhttp/session.c
View file @
4ae5741c
...
...
@@ -480,9 +480,13 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
if
(
!
netconn_init
(
&
request
->
netconn
,
request
->
hdr
.
flags
&
WINHTTP_FLAG_SECURE
))
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
(
!
verb
||
!
verb
[
0
])
verb
=
getW
;
if
(
!
object
||
!
object
[
0
])
object
=
slashW
;
if
(
!
version
||
!
version
[
0
])
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
(
!
(
hrequest
=
alloc_handle
(
&
request
->
hdr
)))
goto
end
;
request
->
hdr
.
handle
=
hrequest
;
...
...
dlls/winhttp/winhttp_private.h
View file @
4ae5741c
...
...
@@ -36,6 +36,11 @@
# include <ws2tcpip.h>
#endif
static
const
WCHAR
getW
[]
=
{
'G'
,
'E'
,
'T'
,
0
};
static
const
WCHAR
postW
[]
=
{
'P'
,
'O'
,
'S'
,
'T'
,
0
};
static
const
WCHAR
slashW
[]
=
{
'/'
,
0
};
static
const
WCHAR
http1_1
[]
=
{
'H'
,
'T'
,
'T'
,
'P'
,
'/'
,
'1'
,
'.'
,
'1'
,
0
};
typedef
struct
_object_header_t
object_header_t
;
typedef
struct
...
...
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