@@ -37,7 +37,7 @@ export class Nfsv4CompoundProcCtx {
3737
3838 public async exec ( ) : Promise < msg . Nfsv4CompoundResponse > {
3939 const { req, connection} = this ;
40- const { ops} = connection ;
40+ const { ops, debug , logger } = connection ;
4141 const { argarray, tag} = req ;
4242 const length = argarray . length ;
4343 let status : Nfsv4Stat = Nfsv4Stat . NFS4_OK ;
@@ -95,8 +95,10 @@ export class Nfsv4CompoundProcCtx {
9595 else if ( op instanceof msg . Nfsv4IllegalRequest ) ( fn = ops . ILLEGAL ) , ( Response = msg . Nfsv4IllegalResponse ) ;
9696 if ( ! fn || ! Response ) return new msg . Nfsv4CompoundResponse ( Nfsv4Stat . NFS4ERR_OP_ILLEGAL , tag , resarray ) ;
9797 EXEC_OP: try {
98+ if ( debug ) logger . log ( fn . name , opReq ) ;
9899 const opResponse = await fn . call ( ops , opReq , this ) ;
99100 if ( ! ( opResponse instanceof Response ) ) throw new Error ( 'Unexpected response, fn = ' + fn . name ) ;
101+ if ( debug ) logger . log ( fn . name , opResponse ) ;
100102 status = opResponse . status ;
101103 resarray . push ( opResponse ) ;
102104 } catch ( err ) {
@@ -106,7 +108,7 @@ export class Nfsv4CompoundProcCtx {
106108 resarray . push ( err ) ;
107109 break EXEC_OP;
108110 } else {
109- this . connection . logger . error ( 'Operation [' + fn . name + '] threw response with NFS4_OK' ) ;
111+ logger . error ( 'Operation [' + fn . name + '] threw response with NFS4_OK' ) ;
110112 err = Nfsv4Stat . NFS4ERR_SERVERFAULT ;
111113 }
112114 }
@@ -117,11 +119,11 @@ export class Nfsv4CompoundProcCtx {
117119 break FIND_STATUS_CODE;
118120 }
119121 status = Nfsv4Stat . NFS4ERR_SERVERFAULT ;
120- this . connection . logger . error ( 'Invalid status [code = ' + err + ', fn = ' + fn . name + ']' ) ;
122+ logger . error ( 'Invalid status [code = ' + err + ', fn = ' + fn . name + ']' ) ;
121123 break FIND_STATUS_CODE;
122124 }
123125 status = Nfsv4Stat . NFS4ERR_SERVERFAULT ;
124- this . connection . logger . error ( fn . name , err ) ;
126+ logger . error ( fn . name , err ) ;
125127 }
126128 const opResponse = new Response ( status ) ;
127129 resarray . push ( opResponse ) ;
0 commit comments