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
e3a7c603
Commit
e3a7c603
authored
Aug 28, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpapi: Implement HttpCreateUrlGroup() and HttpCloseUrlGroup().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
76eb42a7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
0 deletions
+71
-0
httpapi.spec
dlls/httpapi/httpapi.spec
+2
-0
httpapi_main.c
dlls/httpapi/httpapi_main.c
+67
-0
http.h
include/http.h
+2
-0
No files found.
dlls/httpapi/httpapi.spec
View file @
e3a7c603
...
...
@@ -7,7 +7,9 @@
@ stub HttpCreateFilter
@ stdcall HttpCreateHttpHandle(ptr long)
@ stdcall HttpCreateServerSession(long ptr long)
@ stdcall HttpCreateUrlGroup(int64 ptr long)
@ stdcall HttpCloseServerSession(int64)
@ stdcall HttpCloseUrlGroup(int64)
@ stub HttpDeleteConfigGroup
@ stdcall HttpDeleteServiceConfiguration(ptr long ptr long ptr)
@ stub HttpFilterAccept
...
...
dlls/httpapi/httpapi_main.c
View file @
e3a7c603
...
...
@@ -471,9 +471,28 @@ ULONG WINAPI HttpSendHttpResponse(HANDLE queue, HTTP_REQUEST_ID id, ULONG flags,
return
ret
;
}
struct
url_group
{
struct
list
entry
,
session_entry
;
};
static
struct
list
url_groups
=
LIST_INIT
(
url_groups
);
static
struct
url_group
*
get_url_group
(
HTTP_URL_GROUP_ID
id
)
{
struct
url_group
*
group
;
LIST_FOR_EACH_ENTRY
(
group
,
&
url_groups
,
struct
url_group
,
entry
)
{
if
((
HTTP_URL_GROUP_ID
)(
ULONG_PTR
)
group
==
id
)
return
group
;
}
return
NULL
;
}
struct
server_session
{
struct
list
entry
;
struct
list
groups
;
};
static
struct
list
server_sessions
=
LIST_INIT
(
server_sessions
);
...
...
@@ -510,6 +529,7 @@ ULONG WINAPI HttpCreateServerSession(HTTPAPI_VERSION version, HTTP_SERVER_SESSIO
return
ERROR_OUTOFMEMORY
;
list_add_tail
(
&
server_sessions
,
&
session
->
entry
);
list_init
(
&
session
->
groups
);
*
id
=
(
ULONG_PTR
)
session
;
return
ERROR_SUCCESS
;
...
...
@@ -520,6 +540,7 @@ ULONG WINAPI HttpCreateServerSession(HTTPAPI_VERSION version, HTTP_SERVER_SESSIO
*/
ULONG
WINAPI
HttpCloseServerSession
(
HTTP_SERVER_SESSION_ID
id
)
{
struct
url_group
*
group
,
*
group_next
;
struct
server_session
*
session
;
TRACE
(
"id %s.
\n
"
,
wine_dbgstr_longlong
(
id
));
...
...
@@ -527,7 +548,53 @@ ULONG WINAPI HttpCloseServerSession(HTTP_SERVER_SESSION_ID id)
if
(
!
(
session
=
get_server_session
(
id
)))
return
ERROR_INVALID_PARAMETER
;
LIST_FOR_EACH_ENTRY_SAFE
(
group
,
group_next
,
&
session
->
groups
,
struct
url_group
,
session_entry
)
{
HttpCloseUrlGroup
((
ULONG_PTR
)
group
);
}
list_remove
(
&
session
->
entry
);
heap_free
(
session
);
return
ERROR_SUCCESS
;
}
/***********************************************************************
* HttpCreateUrlGroup (HTTPAPI.@)
*/
ULONG
WINAPI
HttpCreateUrlGroup
(
HTTP_SERVER_SESSION_ID
session_id
,
HTTP_URL_GROUP_ID
*
group_id
,
ULONG
reserved
)
{
struct
server_session
*
session
;
struct
url_group
*
group
;
TRACE
(
"session_id %#I64x, group_id %p, reserved %#x.
\n
"
,
session_id
,
group_id
,
reserved
);
if
(
!
(
session
=
get_server_session
(
session_id
)))
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
group
=
heap_alloc_zero
(
sizeof
(
*
group
))))
return
ERROR_OUTOFMEMORY
;
list_add_tail
(
&
url_groups
,
&
group
->
entry
);
list_add_tail
(
&
session
->
groups
,
&
group
->
session_entry
);
*
group_id
=
(
ULONG_PTR
)
group
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
* HttpCloseUrlGroup (HTTPAPI.@)
*/
ULONG
WINAPI
HttpCloseUrlGroup
(
HTTP_URL_GROUP_ID
id
)
{
struct
url_group
*
group
;
TRACE
(
"id %#I64x.
\n
"
,
id
);
if
(
!
(
group
=
get_url_group
(
id
)))
return
ERROR_INVALID_PARAMETER
;
list_remove
(
&
group
->
session_entry
);
list_remove
(
&
group
->
entry
);
heap_free
(
group
);
return
ERROR_SUCCESS
;
}
include/http.h
View file @
e3a7c603
...
...
@@ -399,8 +399,10 @@ typedef struct _HTTP_LOG_DATA
ULONG
WINAPI
HttpAddUrl
(
HANDLE
,
PCWSTR
,
PVOID
);
ULONG
WINAPI
HttpCloseServerSession
(
HTTP_SERVER_SESSION_ID
id
);
ULONG
WINAPI
HttpCloseUrlGroup
(
HTTP_URL_GROUP_ID
id
);
ULONG
WINAPI
HttpCreateHttpHandle
(
PHANDLE
,
ULONG
);
ULONG
WINAPI
HttpCreateServerSession
(
HTTPAPI_VERSION
,
PHTTP_SERVER_SESSION_ID
,
ULONG
);
ULONG
WINAPI
HttpCreateUrlGroup
(
HTTP_SERVER_SESSION_ID
session_id
,
HTTP_URL_GROUP_ID
*
group_id
,
ULONG
reserved
);
ULONG
WINAPI
HttpDeleteServiceConfiguration
(
HANDLE
,
HTTP_SERVICE_CONFIG_ID
,
PVOID
,
ULONG
,
LPOVERLAPPED
);
ULONG
WINAPI
HttpInitialize
(
HTTPAPI_VERSION
version
,
ULONG
flags
,
void
*
reserved
);
ULONG
WINAPI
HttpTerminate
(
ULONG
flags
,
void
*
reserved
);
...
...
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