summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-08-25 15:59:36 +0200
committerVolker Lendecke <vl@samba.org>2008-08-28 18:15:59 +0200
commitb054f14111337c826548d7728dc2b0a66ab5beae (patch)
treefa2178734674d5ab14fadc80b19f118c9a8b910e /source3/include
parent65dcdf9c32e8ac43344b23db528206c02fcb967c (diff)
downloadsamba-b054f14111337c826548d7728dc2b0a66ab5beae.tar.gz
samba-b054f14111337c826548d7728dc2b0a66ab5beae.tar.bz2
samba-b054f14111337c826548d7728dc2b0a66ab5beae.zip
Activate code to enable chained requests
Add the CHAIN1 torture test (This used to be commit 82992d74a99b056bbfe90e1b79190e0b7c0bf2bd)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/async_smb.h21
-rw-r--r--source3/include/client.h8
2 files changed, 26 insertions, 3 deletions
diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h
index 031ab233dd..1053de2942 100644
--- a/source3/include/async_smb.h
+++ b/source3/include/async_smb.h
@@ -22,6 +22,13 @@
#include "includes.h"
+/**
+ * struct cli_request is the state holder for an async client request we sent
+ * to the server. It can consist of more than one struct async_req that we
+ * have to server if the application did a cli_chain_cork() and
+ * cli_chain_uncork()
+ */
+
struct cli_request {
/**
* "prev" and "next" form the doubly linked list in
@@ -30,9 +37,15 @@ struct cli_request {
struct cli_request *prev, *next;
/**
- * "our" struct async_req;
+ * num_async: How many chained requests do we serve?
+ */
+ int num_async;
+
+ /**
+ * async: This is the list of chained requests that were queued up by
+ * cli_request_chain before we sent out this request
*/
- struct async_req *async;
+ struct async_req **async;
/**
* The client connection for this request
@@ -92,6 +105,10 @@ struct async_req *cli_request_send(TALLOC_CTX *mem_ctx,
uint8_t wct, const uint16_t *vwv,
uint16_t num_bytes, const uint8_t *bytes);
+bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
+ size_t size_hint);
+void cli_chain_uncork(struct cli_state *cli);
+
/*
* Convenience function to get the SMB part out of an async_req
*/
diff --git a/source3/include/client.h b/source3/include/client.h
index 6a6e1a2faa..9b564fc48e 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -208,7 +208,8 @@ struct cli_state {
* fd_event is around while we have async requests outstanding or are
* building a chained request.
*
- * (fd_event!=NULL) && (outstanding_request!=NULL)
+ * (fd_event!=NULL) &&
+ * ((outstanding_request!=NULL)||(chain_accumulator!=NULL))
*
* should always be true, as well as the reverse: If both cli_request
* pointers are NULL, no fd_event is around.
@@ -220,6 +221,11 @@ struct cli_state {
* A linked list of requests that are waiting for a reply
*/
struct cli_request *outstanding_requests;
+
+ /**
+ * The place to build up the list of chained requests.
+ */
+ struct cli_request *chain_accumulator;
};
typedef struct file_info {