Commit 8b6c30ab authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Open the endpoint from the caller of RpcServerUseProtseq* instead of the…

rpcrt4: Open the endpoint from the caller of RpcServerUseProtseq* instead of the protseq server thread. This allows errors to be returned to the caller and to create more than one connection for an endpoint.
parent 433993ee
...@@ -258,7 +258,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, ...@@ -258,7 +258,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection,
RPCRT4_CreateConnection(&NewConnection, Binding->server, Binding->Protseq, RPCRT4_CreateConnection(&NewConnection, Binding->server, Binding->Protseq,
Binding->NetworkAddr, Binding->Endpoint, NULL, Binding->NetworkAddr, Binding->Endpoint, NULL,
Binding->AuthInfo, Binding); Binding->AuthInfo, Binding);
status = RPCRT4_OpenConnection(NewConnection); status = RPCRT4_OpenClientConnection(NewConnection);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
RPCRT4_DestroyConnection(NewConnection); RPCRT4_DestroyConnection(NewConnection);
......
...@@ -65,7 +65,7 @@ struct connection_ops { ...@@ -65,7 +65,7 @@ struct connection_ops {
const char *name; const char *name;
unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */ unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */
RpcConnection *(*alloc)(void); RpcConnection *(*alloc)(void);
RPC_STATUS (*open_connection)(RpcConnection *conn); RPC_STATUS (*open_connection_client)(RpcConnection *conn);
RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn); RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn);
int (*read)(RpcConnection *conn, void *buffer, unsigned int len); int (*read)(RpcConnection *conn, void *buffer, unsigned int len);
int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); int (*write)(RpcConnection *conn, const void *buffer, unsigned int len);
...@@ -108,7 +108,7 @@ RpcConnection *RPCRT4_GetIdleConnection(const RPC_SYNTAX_IDENTIFIER *InterfaceId ...@@ -108,7 +108,7 @@ RpcConnection *RPCRT4_GetIdleConnection(const RPC_SYNTAX_IDENTIFIER *InterfaceId
void RPCRT4_ReleaseIdleConnection(RpcConnection *Connection); void RPCRT4_ReleaseIdleConnection(RpcConnection *Connection);
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcBinding* Binding); RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcBinding* Binding);
RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection); RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection); RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection);
RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection); RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection); RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection);
......
...@@ -496,8 +496,7 @@ static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps) ...@@ -496,8 +496,7 @@ static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps)
{ {
RPC_STATUS status; RPC_STATUS status;
status = RPCRT4_CreateConnection(&ps->conn, TRUE, ps->Protseq, NULL, status = ps->ops->open_endpoint(ps, ps->Endpoint);
ps->Endpoint, NULL, NULL, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
return status; return status;
......
...@@ -56,6 +56,8 @@ struct protseq_ops ...@@ -56,6 +56,8 @@ struct protseq_ops
/* returns -1 for failure, 0 for server state changed and 1 to indicate a /* returns -1 for failure, 0 for server state changed and 1 to indicate a
* new connection was established */ * new connection was established */
int (*wait_for_new_connection)(RpcServerProtseq *protseq, unsigned int count, void *wait_array); int (*wait_for_new_connection)(RpcServerProtseq *protseq, unsigned int count, void *wait_array);
/* opens the endpoint and optionally begins listening */
RPC_STATUS (*open_endpoint)(RpcServerProtseq *protseq, LPSTR endpoint);
}; };
typedef struct _RpcServerInterface typedef struct _RpcServerInterface
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment