summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-02-16 20:45:45 -0800
committerTim Prouty <tprouty@samba.org>2009-02-19 00:01:00 -0800
commitfdcd5a3a201489b1408951936e9bfc0871834a29 (patch)
tree36482aea6ef62202e1e2cb37416838fd4f7d5f6f /source3/smbd
parent6bac890533112e6c4f853c0b77a9dd431c471cee (diff)
downloadsamba-fdcd5a3a201489b1408951936e9bfc0871834a29.tar.gz
samba-fdcd5a3a201489b1408951936e9bfc0871834a29.tar.bz2
samba-fdcd5a3a201489b1408951936e9bfc0871834a29.zip
S3: Make changes to perfcount API set for when a single request leads to multiple replies
(e.g. reply_echo). Change test and onefs modules to match new api set (thanks Volker!).
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 1ceda99fa7..457f9412a9 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -4621,11 +4621,15 @@ void reply_tdis(struct smb_request *req)
void reply_echo(struct smb_request *req)
{
connection_struct *conn = req->conn;
+ struct smb_perfcount_data local_pcd;
+ struct smb_perfcount_data *cur_pcd;
int smb_reverb;
int seq_num;
START_PROFILE(SMBecho);
+ smb_init_perfcount_data(&local_pcd);
+
if (req->wct < 1) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
END_PROFILE(SMBecho);
@@ -4646,14 +4650,23 @@ void reply_echo(struct smb_request *req)
smb_reverb = 100;
}
- for (seq_num =1 ; seq_num <= smb_reverb ; seq_num++) {
+ for (seq_num = 1 ; seq_num <= smb_reverb ; seq_num++) {
+
+ /* this makes sure we catch the request pcd */
+ if (seq_num == smb_reverb) {
+ cur_pcd = &req->pcd;
+ } else {
+ SMB_PERFCOUNT_COPY_CONTEXT(&req->pcd, &local_pcd);
+ cur_pcd = &local_pcd;
+ }
+
SSVAL(req->outbuf,smb_vwv0,seq_num);
show_msg((char *)req->outbuf);
if (!srv_send_smb(smbd_server_fd(),
(char *)req->outbuf,
IS_CONN_ENCRYPTED(conn)||req->encrypted,
- &req->pcd))
+ cur_pcd))
exit_server_cleanly("reply_echo: srv_send_smb failed.");
}