Commit Graph

195 Commits

Author SHA1 Message Date
Juan Lang 76f4b9b053 rpcrt4: Don't abort reading from a pipe if a single read is short. 2009-02-09 12:09:01 +01:00
Andrew Talbot 273b40656b rpcrt4: Declare some functions static. 2009-01-19 13:36:26 +01:00
Alexandre Julliard 8e1b59cb9a rpcrt4: Disable TCP/IP connection support if we don't have socketpair. 2008-12-22 19:55:05 +01:00
Ricardo Filipe 16920c1da7 rpcrt4: Fixed dead increments (llvm/clang). 2008-11-19 12:15:37 +01:00
Andrew Talbot 99ae980c0d rpcrt4: Sign-compare warnings fix. 2008-11-07 10:56:48 +01:00
Alexandre Julliard 83b6c8a5fa rpcrt4: Convert source files to utf-8. 2008-10-18 19:20:44 +02:00
Rob Shearman 0a5e5a6e5b rpcrt4: Print a warning if connecting to a named pipe failed in rpcrt4_conn_open_pipe in the !wait case. 2008-08-18 14:36:33 +02:00
Rob Shearman ce085ed8ec rpcrt4: Check that strings in SMB, NB and pipe floors are nul-terminated before copying the data. 2008-08-18 14:35:43 +02:00
Rob Shearman 1e46fc672a rpcrt4: Fix the protid used in ncalrpc tower functions.
The epm tower for the ncalrpc protseq should have a floor with a
protid of EPM_PROTOCOL_PIPE instead of EPM_PROTOCOL_SMB.
2008-08-18 14:35:26 +02:00
Rob Shearman 498216fc11 rpcrt4: Fix crash in rpcrt4_ncalrpc_parse_top_of_tower due to unconditionally dereferencing networkaddr and endpoint variables.
These can be NULL when parts of the tower are not required.
2008-08-18 14:35:21 +02:00
Rob Shearman 54e904e780 rpcrt4: Fix crash calculation of tower size in rpcrt4_ncalrpc_get_top_of_tower.
The size depends on the length of the endpoint string, not the network
address string.
2008-08-18 14:35:15 +02:00
Alexandre Julliard 853db9a79d rpcrt4: Properly handle the case of a client having disconnected in rpcrt4_conn_listen_pipe. 2008-06-09 12:56:42 +02:00
Rob Shearman 8aeb2858e4 rpcrt4: Add a reference to the binding object in I_RpcNegotiateTransferSyntax and release the reference in I_RpcFreeBuffer.
This is needed because a context binding handle could be released on 
unmarshall, but it still needs to stay valid until the binding handle is 
no longer being used.

Re-use the previously unused RPCRT4_ExportBinding function as 
RPCRT4_AddRefBinding and rename RPCRT4_DestroyBinding to 
RPCRT4_ReleaseBinding to show that it's purpose is to release a 
reference count and destroy if necessary, not always destroy.
2008-04-01 19:11:00 +02:00
Dan Hipschman 764cf334d6 rpcrt4: Use correct count in rpcrt4_conn_np_write.
count is the total count passed into rpcrt4_conn_np_write.  If WriteFile
does a partial write it would end up writing too much subsequent times
through the loop.  All tests pass as before.
2008-03-20 14:27:34 +01:00
Rob Shearman a1e4bcda1a rpcrt4: Use closesocket to close sockets and define it to close on Unix platforms to make the code more portable. 2008-03-06 17:39:31 +01:00
Rob Shearman 0287289475 rpcrt4: Include ws2tcpip.h instead of Unix headers when targeting a build for Windows. 2008-02-25 13:27:54 +01:00
Rob Shearman 5f077bab07 rpcrt4: Implement asynchronous RPC support. 2008-01-21 12:41:51 +01:00
Rob Shearman 1a3d7c77a5 rpcrt4: Allow NULL networkaddr and endpoint in rpcrt4_np_get_top_of_tower.
Add tests for this.
2008-01-15 14:35:35 +01:00
Rob Shearman c370980dfa rpcrt4: Use send on a socket instead of write as it's more portable. 2008-01-09 12:25:46 +01:00
Rob Shearman 737510eeb6 rpcrt4: Move association code into a separate file. 2007-12-17 11:59:18 +01:00
Rob Shearman 22f530c835 rpcrt4: Make a server association when a bind packet is received in the server.
Support handing out association group IDs.
2007-12-17 11:59:13 +01:00
Rob Shearman 2bda19c6b0 rpcrt4: Return an error from rpcrt4_conn_tcp_read if recv returns 0. 2007-12-17 11:58:57 +01:00
Rob Shearman ba280fb1b0 rpcrt4: Fix a typo in rpcrt4_conn_tcp_read. 2007-12-14 12:27:09 +01:00
Rob Shearman 7092590c90 rpcrt4: Use an alertable wait in rpcrt4_protseq_np_wait_for_new_connection to fix a small memory leak flagged by Valgrind.
This is called only by the RPCRT4_server_thread so we don't have to 
worry about application user APCs being run at improper times.
2007-12-07 17:06:33 +01:00
Rob Shearman 867cc3c05f rpcrt4: Fix a memory leak when freeing an association by deleting the critical section. 2007-12-06 12:08:05 +01:00
Rob Shearman 5fb5fccac0 rpcrt4: Fix a memory leak in RpcAssoc_BindConnection. 2007-12-06 12:08:00 +01:00
Michael Stefaniuc 61ed0c99e6 rpcrt4: socket() returns -1 on error so check the return value against that. 2007-11-27 12:29:45 +01:00
Rob Shearman a51486c657 rpcrt4: Implement RpcCancelThread for the ncacn_ip_tcp protocol sequence. 2007-11-13 13:34:50 +01:00
Andrew Talbot 04e0986d60 rpcrt4: Constify some variables. 2007-08-22 11:58:13 +02:00
Rob Shearman 8a87d916b4 rpcrt4: Convert bind ack and nack reject reasons into RPC status codes when binding. 2007-07-23 11:48:13 +02:00
Rob Shearman c6dc14d81b rpcrt4: Make binding to an interface a function of RpcAssoc instead of
binding handles, since binding requires information from the
association and not from the binding handle.
2007-07-13 12:27:17 +02:00
Rob Shearman 680e35643d rpcrt4: Remove the unused AuthInfo field from the RpcAssoc structure and Used from RpcConnection. 2007-06-27 12:32:42 +02:00
Rob Shearman cbafe663b0 rpcrt4: Try a lot harder to resuse existing connections by comparing inside the RpcQualityOfService and RpcAuthInfo objects.
Store a copy of the SEC_WINNT_AUTH_IDENTITY structure passed in to
RpcBindingSetAuthInfo(Ex) to enable us to do this for RpcAuthInfo objects.
2007-06-25 23:21:54 +02:00
Rob Shearman 0ebcacca39 rpcrt4: Store the assoc_group_id field returned from the bind_ack packet and use it when creating further connections in the association group. 2007-06-25 23:21:53 +02:00
Andrew Talbot d5d056ef75 rpcrt4: Exclude unused headers. 2007-05-18 14:11:22 +02:00
Rob Shearman 763fe63213 rpcrt4: Use the correct authorization trailer length using information from the security provider.
Previously it was hardcoded to 16, so only the NTLM provider would work correctly.
2007-03-27 13:00:00 +02:00
Rob Shearman 88e9b3fad8 rpcrt4: Call InitializeSecurityContext from only one function.
This reduces the amount of code and ensures that the parameters passed 
to it stay the same, apart from the previous context and the output 
buffer description.
2007-03-27 12:42:05 +02:00
Rob Shearman adb7cca85c rpcrt4: Implement associations which are intermediary objects that track the relationship between the client and a given endpoint on the server.
Use these to encapsulate the connection pool so that the lifetimes of 
connections are properly handled again.
2007-03-27 12:39:05 +02:00
Rob Shearman 55a103ca5c rpcrt4: Use IPPROTO_TCP for SOL_TCP if SOL_TCP isn't defined.
Fixes compilation on *BSD systems.
2007-03-01 20:42:50 +01:00
Rob Shearman 829dfa8052 rpcrt4: Set TCP_NODELAY on the socket for the ncacn_ip_tcp transport to reduce latency. 2007-02-28 13:28:40 +01:00
Alexandre Julliard 639ffbfde7 rpcrt4: Enter new named pipe connections into the protocol connection list. 2007-02-12 14:13:22 +01:00
Rob Shearman 961455c7f0 rpcrt4: Stash away NetworkOptions passed in from the binding string so that transports can look at the string if needed. 2007-01-25 12:00:10 +01:00
Rob Shearman 2103bca4db rpcrt4: Fix a typo in rpcrt4_conn_open_pipe.
Fix a typo in rpcrt4_conn_open_pipe where the initial setting of dwFlags 
was done inside the switch statement instead of at the indented place of 
at the start of the block (thanks to Jan Zerebecki for noticing this bug).
2007-01-24 12:07:14 +01:00
Rob Shearman e6f4514512 rpcrt4: Try to avoid partial named pipe read/writes by looping. 2007-01-23 11:38:23 +01:00
Rob Shearman 0debcf5b1e rpcrt4: Handle security quality of service flags relevant to the ncacn_np protocol. 2007-01-22 12:01:57 +01:00
Rob Shearman 4b79a0252a rpcrt4: Track the security quality of service settings for bindings and connections. 2007-01-22 12:01:54 +01:00
Rob Shearman 48344f505b rpcrt4: Free the resource allocated by InitializeSecurityContext when the connection is closed. 2006-12-18 11:45:51 +01:00
Dmitry Timoshkov 8c3fdfea42 rpcrt4: Make some data const. 2006-12-14 20:11:34 +01:00
Rob Shearman 8bb10f1082 rpcrt4: Use SecInvalidateHandle and SecIsValidHandle for handling RpcConnection::ctx instead of setting/comparing the field to 0. 2006-11-15 11:25:57 +01:00
Rob Shearman 079b6b074c rpcrt4: Add a FIXME for unsupported client protocol sequences. 2006-11-15 11:25:35 +01:00
Rob Shearman 59a90143bf rpcrt4: Fix a comment and move a WARN to where it really indicates a problem, rather than falsely triggering on normal conditions. 2006-11-13 14:32:21 +01:00
Michael Stefaniuc de21efbadd rpcrt4: Win64 printf format warning fixes. 2006-11-10 11:31:59 +01:00
Rob Shearman 0345a578b5 rpcrt4: For TCP endpoints, bind to all the address and ports that getaddrinfo for the machine. 2006-11-09 10:37:29 +01:00
Rob Shearman 034eaa1cad rpcrt4: Use MaxCalls from the protseq when determining the backlog length to pass in to listen. 2006-11-09 10:37:15 +01:00
Rob Shearman 34577de406 rpcrt4: The error code RPC_S_SERVER_UNAVAILABLE doesn't make much sense on the server side
so replace it with some more appropriate endpoint error codes.
2006-11-09 10:37:07 +01:00
Rob Shearman 8b6c30ab4b 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.
2006-11-09 10:36:47 +01:00
Rob Shearman 85e28ae33d rpcrt4: Set the AI_PASSIVE flag to getaddrinfo in rpcrt4_ip_tcp_open so that the bound-to port is connectable from other machines. 2006-10-31 21:42:32 +01:00
Rob Shearman 3ed6a201c2 rpcrt4: Improve the debug messages for failures in rpcrt4_ip_tcp_open. 2006-10-31 21:42:25 +01:00
Rob Shearman 828c733f72 rpcrt4: Set the socket back to blocking in rpcrt4_conn_tcp_handoff as
the read and write function for the protseq assume that syscalls will block.
2006-10-31 21:42:17 +01:00
Rob Shearman e2e05d0493 rpcrt4: Fix a typo in rpcrt4_ip_tcp_open that would cause the function
to go into an infinite loop if getaddrinfo returned more than one entry.
2006-10-31 21:41:38 +01:00
Rob Shearman 593d0fbac0 rpcrt4: Convert the named pipe server code to look directly into the
connection to get at the wait handles, instead of using
get_connect_wait_handle which isn't generic enough to be used for
other protocols.
Remove the unneeded get_connect_wait_handle function from the connection 
operations function list.
2006-10-31 21:41:29 +01:00
Rob Shearman 7553a8990c rpcrt4: Eliminate the extra thread used for RPC over TCP/IP servers by adding socket-specific server protseq functions. 2006-10-31 21:41:07 +01:00
Rob Shearman c3918d9be4 rpcrt4: Move transport-specific server functions to rpc_transport.c. 2006-10-25 20:21:41 +02:00
Damjan Jovanovic 48ca62185b rpcrt4: Added support for RPC TCP servers. 2006-10-20 14:46:55 +02:00
Robert Shearman 92c3979433 rpcrt4: Rename protseq_ops to connection_ops to reflect the fact that
the functions operate on an RpcConnection object, not an
RpcServerProtseq object.
2006-10-16 19:55:37 +02:00
Francois Gouget 4794dc0e38 rpcrt4: Add RPC_CSTR, RPC_WSTR and update the prototypes accordingly. 2006-10-13 11:54:58 +02:00
Robert Shearman 2324aeec33 rpcrt4: Use I_Rpc{Allocate, Free} instead of Heap{Alloc, Free} as that
the former are exported by rpcrt4 seemingly to allow callers of tower
functions to free the allocated memory.
2006-10-03 16:14:57 +02:00
Robert Shearman b9423076ba rpcrt4: Don't use HEAP_ZERO_MEMORY when most of the fields will be initialised to non-zero values. 2006-10-03 16:14:47 +02:00
Andrew Talbot 8221beb225 rpcrt4: Cast-qual warnings fix. 2006-09-26 11:40:52 +02:00
Robert Shearman b3c04e032d rpcrt4: getaddrinfo returns any non-zero value on failure, not just negative values. 2006-06-14 12:47:05 +02:00
Alexandre Julliard 2a91838f0c rpcrt4: Don't use sizeof in traces to avoid printf format warnings. 2006-06-13 14:11:28 +02:00
Alexandre Julliard c32dc6744c rpcrt4: Make the protseq_ops structure constant. 2006-06-09 13:12:58 +02:00
Robert Shearman 58ec282bfb rpcrt4: Implement a process-wide connection pool for client connections,
rather than relying on the restriction of one connection per
binding. This also avoids the problem of two threads using the same
connection at the same time.
2006-06-08 10:16:00 +02:00
Robert Shearman 0fad0895d7 rpcrt4: Don't try to resolve the name when constructing a protocol tower.
Instead just fill it in with all zeros.
2006-06-03 11:42:54 +02:00
Robert Shearman 6a11aba526 rpcrt4: Skip over the right-hand-side data for the protocol floor so
that we can parse the towers received from native rpcrt4.
2006-06-03 11:42:03 +02:00
Robert Shearman 423e7e3089 rpcrt4: Print some more informative error messages when getaddrinfo fails. 2006-06-03 11:40:42 +02:00
Robert Shearman efc974d1f5 rpcrt4: All of the parameters to TowerExplode are optional. 2006-06-02 11:24:29 +02:00
Robert Shearman 37364b836f rpcrt4: Add functions for generating and parsing the upper floors in endpoint-mapper towers for different transports. 2006-06-02 11:24:03 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Robert Shearman cfa769fb9f rpcrt4: Warn if CreateNamedPipe fails. 2006-05-20 14:03:31 +02:00
Robert Shearman 4fb6295528 rpcrt4: Wait for all of the requested bytes to be returned for tcp connections. 2006-05-20 14:02:30 +02:00
Robert Shearman 9cebbdd80f rpcrt4: Fix for the open functions in the transports being transposed between ncacn_np and ncalrpc. 2006-05-20 14:00:48 +02:00
Robert Shearman c1a31cef3d rpcrt4: Don't release the auth info if it isn't present. 2006-05-20 14:00:43 +02:00
Mike McCormack c3a08421a2 rpcrt4: Fix and test RpcNetworkIsProtseqValid. 2006-05-18 16:36:34 +02:00
Robert Shearman 217ec275b8 rpcrt4: Store non-connection-specific authentication information in a ref-counted structure that is shared between connections and bindings. 2006-05-18 10:36:07 +02:00
Robert Shearman 5067ea70c0 rpcrt4: Increment the call id field of the request header.
This is necessary for compatibility with MS/RPC servers.
2006-05-18 10:34:33 +02:00
Francois Gouget 325912de98 rpcrt4: Fix some conditional includes.
Check for HAVE_UNISTD_H before including unistd.h.
There is no HAVE_SYS_TYPES to check.
Tweak the indentation of a few #include directives.
2006-05-15 11:09:41 +02:00
Robert Shearman cce073a777 rpcrt4: Use getaddrinfo to get the sockaddr.
Use getaddrinfo to get the sockaddr to use for connecting to a remote
server as Connection->NetworkAddr may be a hostname as well. Use a
loop to support both IP and IPv6.
2006-05-07 10:04:40 +02:00
Mike McCormack 481cec4006 rpcrt4: Invalid sockets should have a value of -1. 2006-04-21 12:44:45 +02:00
Mike McCormack 3d5e517e5b rpcrt4: Add support for the ncacn_ip_tcp transport layer. 2006-04-21 11:34:08 +02:00
Mike McCormack 5bfb579f9a rpcrt4: Add a stub transport layer for ncacn_ip_tcp. 2006-04-21 11:32:57 +02:00
Mike McCormack 87ddd7b53a rpcrt4: Hide the details of the rpc transport mechanism. 2006-04-21 11:32:44 +02:00
Mike McCormack 83109e4937 rpcrt4: Abstract RPCRT4_SpawnConnection. 2006-04-21 11:32:29 +02:00
Mike McCormack e7e209da64 rpcrt4: Move the connected check inside the named pipe code. 2006-04-21 11:32:07 +02:00
Mike McCormack 5c6f72873a rpcrt4: Split the transport layer into a different file. 2006-04-21 11:31:51 +02:00