diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-06-25 23:38:32 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-06-29 00:14:52 +0200 |
commit | d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49 (patch) | |
tree | 1fda853ab85d8cc99cedcb4cac82630cc97b18af | |
parent | 925994e42eba5b72ce605b68e8980adc1b5ecd83 (diff) | |
download | samba-d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49.tar.gz samba-d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49.tar.bz2 samba-d1ee774ed0b4b3882b4b85da16d9bb9c082a0c49.zip |
s3:smb2_server: remove unused and confusing DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR
metze
-rw-r--r-- | source3/include/local.h | 1 | ||||
-rw-r--r-- | source3/smbd/smb2_server.c | 11 |
2 files changed, 4 insertions, 8 deletions
diff --git a/source3/include/local.h b/source3/include/local.h index 653c6714c2..02e6b43673 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -236,6 +236,5 @@ #define DEFAULT_SMB2_MAX_WRITE (1024*1024) #define DEFAULT_SMB2_MAX_TRANSACT (1024*1024) #define DEFAULT_SMB2_MAX_CREDITS 8192 -#define DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR 2 #endif diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index e2db9b0f07..0af1303f0f 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -112,7 +112,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *sconn) sconn->smb2.credits_granted = 1; sconn->smb2.max_credits = lp_smb2_max_credits(); sconn->smb2.credits_bitmap = bitmap_talloc(sconn, - DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR*sconn->smb2.max_credits); + sconn->smb2.max_credits); if (sconn->smb2.credits_bitmap == NULL) { return NT_STATUS_NO_MEMORY; } @@ -310,7 +310,7 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn, if (message_id < sconn->smb2.seqnum_low || message_id > (sconn->smb2.seqnum_low + - (sconn->smb2.max_credits * DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR))) { + (sconn->smb2.max_credits))) { DEBUG(0,("smb2_validate_message_id: bad message_id " "%llu (low = %llu, max = %lu)\n", (unsigned long long)message_id, @@ -355,9 +355,7 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn, DEBUG(11, ("Iterating mid %llu\n", (unsigned long long) i)); /* Mark the message_ids as seen in the bitmap. */ - bitmap_offset = (unsigned int)(i % - (uint64_t)(sconn->smb2.max_credits * - DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR)); + bitmap_offset = i % sconn->smb2.max_credits; if (bitmap_query(credits_bm, bitmap_offset)) { DEBUG(0,("smb2_validate_message_id: duplicate " "message_id %llu (bm offset %u)\n", @@ -377,8 +375,7 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn, bitmap_clear(credits_bm, bitmap_offset); sconn->smb2.seqnum_low += 1; bitmap_offset = (bitmap_offset + 1) % - (sconn->smb2.max_credits * - DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR); + sconn->smb2.max_credits; } } } |