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
3099fda2
Commit
3099fda2
authored
Oct 16, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Try reconnecting when to server in IRpcSend on broken connection.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3b4f3ff3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
21 deletions
+42
-21
rpc_assoc.c
dlls/rpcrt4/rpc_assoc.c
+9
-3
rpc_assoc.h
dlls/rpcrt4/rpc_assoc.h
+1
-1
rpc_binding.c
dlls/rpcrt4/rpc_binding.c
+2
-2
rpc_binding.h
dlls/rpcrt4/rpc_binding.h
+2
-1
rpc_message.c
dlls/rpcrt4/rpc_message.c
+28
-14
No files found.
dlls/rpcrt4/rpc_assoc.c
View file @
3099fda2
...
...
@@ -391,14 +391,18 @@ static RpcConnection *RpcAssoc_GetIdleConnection(RpcAssoc *assoc,
RPC_STATUS
RpcAssoc_GetClientConnection
(
RpcAssoc
*
assoc
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
,
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
,
RpcAuthInfo
*
AuthInfo
,
RpcQualityOfService
*
QOS
,
LPCWSTR
CookieAuth
,
RpcConnection
**
Connection
)
RpcQualityOfService
*
QOS
,
LPCWSTR
CookieAuth
,
RpcConnection
**
Connection
,
BOOL
*
from_cache
)
{
RpcConnection
*
NewConnection
;
RPC_STATUS
status
;
*
Connection
=
RpcAssoc_GetIdleConnection
(
assoc
,
InterfaceId
,
TransferSyntax
,
AuthInfo
,
QOS
);
if
(
*
Connection
)
if
(
*
Connection
)
{
TRACE
(
"return idle connection %p for association %p
\n
"
,
*
Connection
,
assoc
);
if
(
from_cache
)
*
from_cache
=
TRUE
;
return
RPC_S_OK
;
}
/* create a new connection */
status
=
RPCRT4_CreateConnection
(
&
NewConnection
,
FALSE
/* is this a server connection? */
,
...
...
@@ -424,8 +428,10 @@ RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc,
}
InterlockedIncrement
(
&
assoc
->
connection_cnt
);
*
Connection
=
NewConnection
;
TRACE
(
"return new connection %p for association %p
\n
"
,
*
Connection
,
assoc
);
*
Connection
=
NewConnection
;
if
(
from_cache
)
*
from_cache
=
FALSE
;
return
RPC_S_OK
;
}
...
...
dlls/rpcrt4/rpc_assoc.h
View file @
3099fda2
...
...
@@ -50,7 +50,7 @@ typedef struct _RpcAssoc
RPC_STATUS
RPCRT4_GetAssociation
(
LPCSTR
Protseq
,
LPCSTR
NetworkAddr
,
LPCSTR
Endpoint
,
LPCWSTR
NetworkOptions
,
RpcAssoc
**
assoc
)
DECLSPEC_HIDDEN
;
RPC_STATUS
RpcAssoc_GetClientConnection
(
RpcAssoc
*
assoc
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
,
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
,
RpcAuthInfo
*
AuthInfo
,
RpcQualityOfService
*
QOS
,
LPCWSTR
CookieAuth
,
RpcConnection
**
Connection
)
DECLSPEC_HIDDEN
;
LPCWSTR
CookieAuth
,
RpcConnection
**
Connection
,
BOOL
*
from_cache
)
DECLSPEC_HIDDEN
;
void
RpcAssoc_ReleaseIdleConnection
(
RpcAssoc
*
assoc
,
RpcConnection
*
Connection
)
DECLSPEC_HIDDEN
;
ULONG
RpcAssoc_Release
(
RpcAssoc
*
assoc
)
DECLSPEC_HIDDEN
;
RPC_STATUS
RpcServerAssoc_GetAssociation
(
LPCSTR
Protseq
,
LPCSTR
NetworkAddr
,
LPCSTR
Endpoint
,
LPCWSTR
NetworkOptions
,
ULONG
assoc_gid
,
RpcAssoc
**
assoc_out
)
DECLSPEC_HIDDEN
;
...
...
dlls/rpcrt4/rpc_binding.c
View file @
3099fda2
...
...
@@ -272,13 +272,13 @@ RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding* Binding)
RPC_STATUS
RPCRT4_OpenBinding
(
RpcBinding
*
Binding
,
RpcConnection
**
Connection
,
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
)
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
,
BOOL
*
from_cache
)
{
TRACE
(
"(Binding == ^%p)
\n
"
,
Binding
);
if
(
!
Binding
->
server
)
{
return
RpcAssoc_GetClientConnection
(
Binding
->
Assoc
,
InterfaceId
,
TransferSyntax
,
Binding
->
AuthInfo
,
Binding
->
QOS
,
Binding
->
CookieAuth
,
Connection
);
TransferSyntax
,
Binding
->
AuthInfo
,
Binding
->
QOS
,
Binding
->
CookieAuth
,
Connection
,
from_cache
);
}
else
{
/* we already have a connection with acceptable binding, so use it */
if
(
Binding
->
FromConn
)
{
...
...
dlls/rpcrt4/rpc_binding.h
View file @
3099fda2
...
...
@@ -174,7 +174,8 @@ RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection) D
void
RPCRT4_AddRefBinding
(
RpcBinding
*
Binding
)
DECLSPEC_HIDDEN
;
RPC_STATUS
RPCRT4_ReleaseBinding
(
RpcBinding
*
Binding
)
DECLSPEC_HIDDEN
;
RPC_STATUS
RPCRT4_OpenBinding
(
RpcBinding
*
Binding
,
RpcConnection
**
Connection
,
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
)
DECLSPEC_HIDDEN
;
const
RPC_SYNTAX_IDENTIFIER
*
TransferSyntax
,
const
RPC_SYNTAX_IDENTIFIER
*
InterfaceId
,
BOOL
*
from_cache
)
DECLSPEC_HIDDEN
;
RPC_STATUS
RPCRT4_CloseBinding
(
RpcBinding
*
Binding
,
RpcConnection
*
Connection
)
DECLSPEC_HIDDEN
;
void
rpcrt4_conn_release_and_wait
(
RpcConnection
*
connection
)
DECLSPEC_HIDDEN
;
...
...
dlls/rpcrt4/rpc_message.c
View file @
3099fda2
...
...
@@ -38,6 +38,7 @@
#include "rpc_binding.h"
#include "rpc_defs.h"
#include "rpc_message.h"
#include "rpc_assoc.h"
#include "ncastatus.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
rpc
);
...
...
@@ -1598,7 +1599,7 @@ RPC_STATUS WINAPI I_RpcNegotiateTransferSyntax(PRPC_MESSAGE pMsg)
}
status
=
RPCRT4_OpenBinding
(
bind
,
&
conn
,
&
cif
->
TransferSyntax
,
&
cif
->
InterfaceId
);
&
cif
->
InterfaceId
,
NULL
);
if
(
status
==
RPC_S_OK
)
{
...
...
@@ -1789,26 +1790,39 @@ static DWORD WINAPI async_notifier_proc(LPVOID p)
RPC_STATUS
WINAPI
I_RpcSend
(
PRPC_MESSAGE
pMsg
)
{
RpcBinding
*
bind
=
pMsg
->
Handle
;
RPC_CLIENT_INTERFACE
*
cif
;
RpcConnection
*
conn
;
RPC_STATUS
status
;
RpcPktHdr
*
hdr
;
BOOL
from_cache
=
TRUE
;
TRACE
(
"(%p)
\n
"
,
pMsg
);
if
(
!
bind
||
bind
->
server
||
!
pMsg
->
ReservedForRuntime
)
return
RPC_S_INVALID_BINDING
;
conn
=
pMsg
->
ReservedForRuntime
;
hdr
=
RPCRT4_BuildRequestHeader
(
pMsg
->
DataRepresentation
,
pMsg
->
BufferLength
,
pMsg
->
ProcNum
&
~
RPC_FLAGS_VALID_BIT
,
&
bind
->
ObjectUuid
);
if
(
!
hdr
)
return
ERROR_OUTOFMEMORY
;
hdr
->
common
.
call_id
=
conn
->
NextCallId
++
;
status
=
RPCRT4_Send
(
conn
,
hdr
,
pMsg
->
Buffer
,
pMsg
->
BufferLength
);
RPCRT4_FreeHeader
(
hdr
);
for
(;;)
{
conn
=
pMsg
->
ReservedForRuntime
;
hdr
=
RPCRT4_BuildRequestHeader
(
pMsg
->
DataRepresentation
,
pMsg
->
BufferLength
,
pMsg
->
ProcNum
&
~
RPC_FLAGS_VALID_BIT
,
&
bind
->
ObjectUuid
);
if
(
!
hdr
)
return
ERROR_OUTOFMEMORY
;
hdr
->
common
.
call_id
=
conn
->
NextCallId
++
;
status
=
RPCRT4_Send
(
conn
,
hdr
,
pMsg
->
Buffer
,
pMsg
->
BufferLength
);
RPCRT4_FreeHeader
(
hdr
);
if
(
status
==
RPC_S_OK
||
conn
->
server
||
!
from_cache
)
break
;
WARN
(
"Send failed, trying to reconnect
\n
"
);
cif
=
pMsg
->
RpcInterfaceInformation
;
RPCRT4_ReleaseConnection
(
conn
);
pMsg
->
ReservedForRuntime
=
NULL
;
status
=
RPCRT4_OpenBinding
(
bind
,
&
conn
,
&
cif
->
TransferSyntax
,
&
cif
->
InterfaceId
,
&
from_cache
);
if
(
status
!=
RPC_S_OK
)
break
;
pMsg
->
ReservedForRuntime
=
conn
;
}
if
(
status
==
RPC_S_OK
&&
pMsg
->
RpcFlags
&
RPC_BUFFER_ASYNC
)
{
...
...
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