summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c17
-rw-r--r--libcli/smb/smbXcli_base.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 2562442f28..9e8725c43a 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -595,6 +595,23 @@ uint32_t smb1cli_conn_max_xmit(struct smbXcli_conn *conn)
return conn->smb1.max_xmit;
}
+bool smb1cli_conn_req_possible(struct smbXcli_conn *conn)
+{
+ size_t pending;
+ uint16_t possible = conn->smb1.server.max_mux;
+
+ pending = tevent_queue_length(conn->outgoing);
+ if (pending >= possible) {
+ return false;
+ }
+ pending += talloc_array_length(conn->pending);
+ if (pending >= possible) {
+ return false;
+ }
+
+ return true;
+}
+
uint32_t smb1cli_conn_server_session_key(struct smbXcli_conn *conn)
{
return conn->smb1.server.session_key;
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 4ce39c0db1..6b3156f42a 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -69,6 +69,7 @@ bool smbXcli_req_set_pending(struct tevent_req *req);
uint32_t smb1cli_conn_capabilities(struct smbXcli_conn *conn);
uint32_t smb1cli_conn_max_xmit(struct smbXcli_conn *conn);
+bool smb1cli_conn_req_possible(struct smbXcli_conn *conn);
uint32_t smb1cli_conn_server_session_key(struct smbXcli_conn *conn);
const uint8_t *smb1cli_conn_server_challenge(struct smbXcli_conn *conn);
uint16_t smb1cli_conn_server_security_mode(struct smbXcli_conn *conn);