diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index c60f9d95d10..344133c637f 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -27,7 +27,7 @@ SMBPROFILE_STATS_START \ \ SMBPROFILE_STATS_SECTION_START("SMBD loop") \ - SMBPROFILE_STATS_COUNT(smb_count) \ + SMBPROFILE_STATS_COUNT(request) \ SMBPROFILE_STATS_COUNT(uid_changes) \ SMBPROFILE_STATS_BASIC(smbd_idle) \ SMBPROFILE_STATS_SECTION_END \ diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 8370155d777..9d19829f29d 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1871,7 +1871,7 @@ static void process_smb(struct smbXsrv_connection *xconn, struct smbd_server_connection *sconn = xconn->client->sconn; int msg_type = CVAL(inbuf,0); - DO_PROFILE_INC(smb_count); + DO_PROFILE_INC(request); DEBUG( 6, ( "got message type 0x%x of len 0x%x\n", msg_type, smb_len(inbuf) ) ); diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index c801746c5cc..138765e5a85 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1945,6 +1945,8 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req) inhdr = SMBD_SMB2_IN_HDR_PTR(req); + DO_PROFILE_INC(request); + /* TODO: verify more things */ flags = IVAL(inhdr, SMB2_HDR_FLAGS); @@ -3025,6 +3027,15 @@ void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn, return; } +#ifdef WITH_PROFILE + /* + * this was already counted at the SMB1 layer => + * smbd_smb2_request_dispatch() should not count it twice. + */ + if (profile_p->request_stats.count > 0) { + profile_p->request_stats.count--; + } +#endif status = smbd_smb2_request_dispatch(req); if (!NT_STATUS_IS_OK(status)) { smbd_server_connection_terminate(xconn, nt_errstr(status));