diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-09-26 11:47:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:57 -0500 |
commit | ab4d635b92b116b02b88843b4ec4f5b7517bab1a (patch) | |
tree | 63c3ee12153b629071d2ba0209a0a31b134c449e /source4/libcli/raw | |
parent | 0d46be147a1e755bdd6f21a5ddc83b5c39585529 (diff) | |
download | samba-ab4d635b92b116b02b88843b4ec4f5b7517bab1a.tar.gz samba-ab4d635b92b116b02b88843b4ec4f5b7517bab1a.tar.bz2 samba-ab4d635b92b116b02b88843b4ec4f5b7517bab1a.zip |
r10504: - seperate implementation specific stuff, from the generic composite
stuff.
- don't use SMBCLI_REQUEST_* state's in the genreic composite stuff
- move monitor_fn to libnet.
NOTE: I have maybe found some bugs, in code that is dirrectly in DONE or ERROR
state in the _send() function. I haven't fixed this bugs in this
commit! We may need some composite_trigger_*() functions or so.
And maybe some other generic helper functions...
metze
(This used to be commit 4527815a0a9b96e460f301cb1f0c0b3964c166fc)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/clisocket.c | 16 | ||||
-rw-r--r-- | source4/libcli/raw/clitree.c | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index 90fb98603e..688ee8a78b 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -78,17 +78,17 @@ static NTSTATUS smbcli_sock_connect_one(struct smbcli_socket *sock, has either completed the connect() or has returned an error */ static void smbcli_sock_connect_handler(struct event_context *ev, struct fd_event *fde, - uint16_t flags, void *private) + uint16_t flags, void *private_data) { - struct composite_context *c = talloc_get_type(private, struct composite_context); - struct clisocket_connect *conn = talloc_get_type(c->private, struct clisocket_connect); + struct composite_context *c = talloc_get_type(private_data, struct composite_context); + struct clisocket_connect *conn = talloc_get_type(c->private_data, struct clisocket_connect); int i; c->status = socket_connect_complete(conn->sock->sock, 0); if (NT_STATUS_IS_OK(c->status)) { socket_set_option(conn->sock->sock, lp_socket_options(), NULL); conn->sock->hostname = talloc_strdup(conn->sock, conn->dest_hostname); - c->state = SMBCLI_REQUEST_DONE; + c->state = COMPOSITE_STATE_DONE; if (c->async.fn) { c->async.fn(c); } @@ -107,7 +107,7 @@ static void smbcli_sock_connect_handler(struct event_context *ev, struct fd_even } } - c->state = SMBCLI_REQUEST_ERROR; + c->state = COMPOSITE_STATE_ERROR; if (c->async.fn) { c->async.fn(c); } @@ -195,8 +195,8 @@ struct composite_context *smbcli_sock_connect_send(struct smbcli_socket *sock, conn->dest_hostname = talloc_strdup(c, host_name); if (conn->dest_hostname == NULL) goto failed; - c->private = conn; - c->state = SMBCLI_REQUEST_SEND; + c->private_data = conn; + c->state = COMPOSITE_STATE_IN_PROGRESS; /* startup the connect process for each port in turn until one succeeds or tells us that it is pending */ @@ -212,7 +212,7 @@ struct composite_context *smbcli_sock_connect_send(struct smbcli_socket *sock, } } - c->state = SMBCLI_REQUEST_ERROR; + c->state = COMPOSITE_STATE_ERROR; return c; failed: diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index 74e14db591..cae93bdbe2 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -24,6 +24,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" +#include "libcli/smb_composite/smb_composite.h" #define SETUP_REQUEST_TREE(cmd, wct, buflen) do { \ req = smbcli_request_setup(tree, cmd, wct, buflen); \ |