return(False);
}
-
/****************************************************************************
-find a conn given a cnum
+ Find a conn given a cnum.
****************************************************************************/
+
connection_struct *conn_find(unsigned cnum)
{
int count=0;
return NULL;
}
-
/****************************************************************************
find first available connection slot, starting from a random position.
The randomisation stops problems with the server dieing and clients
num_open++;
- string_set(&conn->user,"");
string_set(&conn->dirpath,"");
string_set(&conn->connectpath,"");
string_set(&conn->origpath,"");
/****************************************************************************
Close all conn structures.
+return true if any were closed
****************************************************************************/
-
-void conn_close_all(void)
+bool conn_close_all(void)
{
connection_struct *conn, *next;
+ bool ret = false;
for (conn=Connections;conn;conn=next) {
next=conn->next;
set_current_service(conn, 0, True);
close_cnum(conn, conn->vuid);
+ ret = true;
}
+ return ret;
}
/****************************************************************************
Clear a vuid out of the validity cache, and as the 'owner' of a connection.
****************************************************************************/
-void conn_clear_vuid_cache(uint16 vuid)
+void conn_clear_vuid_caches(uint16_t vuid)
{
connection_struct *conn;
- unsigned int i;
for (conn=Connections;conn;conn=conn->next) {
if (conn->vuid == vuid) {
conn->vuid = UID_FIELD_INVALID;
}
-
- for (i=0;i<conn->vuid_cache.entries && i< VUID_CACHE_SIZE;i++) {
- if (conn->vuid_cache.array[i].vuid == vuid) {
- struct vuid_cache_entry *ent = &conn->vuid_cache.array[i];
- ent->vuid = UID_FIELD_INVALID;
- ent->read_only = False;
- ent->admin_user = False;
- }
- }
+ conn_clear_vuid_cache(conn, vuid);
}
}
/* Free vfs_connection_struct */
handle = conn->vfs_handles;
while(handle) {
- DLIST_REMOVE(conn->vfs_handles, handle);
thandle = handle->next;
+ DLIST_REMOVE(conn->vfs_handles, handle);
if (handle->free_data)
handle->free_data(&handle->data);
handle = thandle;
free_namearray(conn->veto_oplock_list);
free_namearray(conn->aio_write_behind_list);
- string_free(&conn->user);
string_free(&conn->dirpath);
string_free(&conn->connectpath);
string_free(&conn->origpath);