diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-04-28 15:05:30 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-05-27 07:13:53 +0200 |
commit | 9a77cb247d00828845df02030e7d174351daf432 (patch) | |
tree | e525d8a90d4d8688f2ce8359791f88c225563022 | |
parent | 8c0be920442778c24e19f8a52d9f8bc385218834 (diff) | |
download | samba-9a77cb247d00828845df02030e7d174351daf432.tar.gz samba-9a77cb247d00828845df02030e7d174351daf432.tar.bz2 samba-9a77cb247d00828845df02030e7d174351daf432.zip |
s3:rpc_server: add np_read_in_progress() function
metze
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 92c757b1ef..116db698e6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5209,6 +5209,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, const char *client_address, struct auth_serversupplied_info *server_info, struct fake_file_handle **phandle); +bool np_read_in_progress(struct fake_file_handle *handle); struct tevent_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct fake_file_handle *handle, const uint8_t *data, size_t len); diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 7b8602b0d6..b5b8379efa 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -1179,6 +1179,28 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, return NT_STATUS_OK; } +bool np_read_in_progress(struct fake_file_handle *handle) +{ + if (handle->type == FAKE_FILE_TYPE_NAMED_PIPE) { + return false; + } + + if (handle->type == FAKE_FILE_TYPE_NAMED_PIPE_PROXY) { + struct np_proxy_state *p = talloc_get_type_abort( + handle->private_data, struct np_proxy_state); + size_t read_count; + + read_count = tevent_queue_length(p->read_queue); + if (read_count > 0) { + return true; + } + + return false; + } + + return false; +} + struct np_write_state { struct event_context *ev; struct np_proxy_state *p; |