svn commit: samba r4951 - in branches/SAMBA_4_0/source: libcli libcli/composite libcli/raw libcli/util torture/basic torture/raw torture/rpc

tridge at samba.org tridge at samba.org
Mon Jan 24 00:57:14 GMT 2005


Author: tridge
Date: 2005-01-24 00:57:14 +0000 (Mon, 24 Jan 2005)
New Revision: 4951

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4951

Log:
some of the code dealing with libcli was getting too complex trying to
handle the inverted memory hierarchy that a normal session
establishment gave. The inverted hierarchy came from that fact that
you first establish a socket, then a transport, then a session and
finally a tree. That leads to the socket being at the top of the
memory hierarchy and the tree at the bottom, which makes no sense from
the users point of view, as they want to be able to free the tree and
have everything disappear.

The core problem was that the libcli interface didn't distinguish
between establishing a primary context and a secondary context. If you
establish a 2nd session on a transport then you want the transport to
be referenced by the session, whereas if you establish a primary
session then you want the transport to be a child of the session.

To fix this I have added "parent_ctx" and "primary" arguments to the
libcli intialisation functions. This makes using the library much
easier, and gives us a memory hierarchy that makes much more sense.

I was prompted to do this by a bug in the cifs backend, which was
caused by the socket not being properly torn down on a disconnect due
to the inverted memory hierarchy.

Modified:
   branches/SAMBA_4_0/source/libcli/cliconnect.c
   branches/SAMBA_4_0/source/libcli/composite/connect.c
   branches/SAMBA_4_0/source/libcli/raw/clisession.c
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c
   branches/SAMBA_4_0/source/libcli/raw/clitree.c
   branches/SAMBA_4_0/source/libcli/util/clilsa.c
   branches/SAMBA_4_0/source/torture/basic/secleak.c
   branches/SAMBA_4_0/source/torture/raw/context.c
   branches/SAMBA_4_0/source/torture/rpc/xplogin.c


Changeset:
Sorry, the patch is too large (297 lines) to include; please use WebSVN to see it!
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4951


More information about the samba-cvs mailing list