Connection caching in Samba

Nitin musingmario at
Fri Oct 4 17:47:27 MDT 2013

I'm using pysmbc, a python library that utilizes libsmbclient to connect to
Windows shares.

Looking through the samba code (version 3.2.15), I understand that there is
source/libsmb/libsmb_cache.c that has functions like
SMBC_add_cached_server() and SMBC_get_cached_server() that manage the server
connections cache, which is saved in context->internal->server_cache.

However, there is another place in the code which is caching connections.
The client_connection struct in source/libsmb/clidfs.c also stores
connections to the server, which can then be reused by the cli_cm_find()
function in the same file.

I wanted to understand what's the difference between these two places for
storing connections.

More information about the samba-technical mailing list