IBM Support

IT12929: ADD THREE BUFFER COMPARE FUNCTIONS TO GATEWAYSCRIPT

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • DataPower GatewayScript Buffer module did not provide buffer
    compare functions. They are quite useful performance wise. Now
    buf1.compare(buf2), buf1.equals(buf2) and Buffer.compare(buf1,
    buf2) are available.
    
    Workaround:
    Write your own compare function in GatewayScript, which is less
    performant, eg:
    
    function compareBuffer(a, b) {
      if (!(a instanceof Buffer) ||
          !(b instanceof Buffer))
        throw new TypeError('Arguments must be Buffers');
    
      var i=Math.min(a.length, b.length), val=0;
    
      for(--i; i>=0 && a[i] === b[i]; --i) {
      }
    
      if (i < 0) {
        if (a.length > b.length)
          val = 1;
        else if (a.length < b.length)
          val = -1;
      } else {
        if (a[i] > b[i])
          val = 1;
        else
          val = -1;
      }
    
      return val;
    }
    

Local fix

Problem summary

  • Affected is the use of Datapower GatewayScript Buffer module.
    
    The module did not provide buffer compare functions. They are
    quite useful performance wise.
    

Problem conclusion

  • Now buf1.compare(buf2), buf1.equals(buf2) and
    Buffer.compare(buf1, buf2) are available in 7.0.0.13, 7.1.0.10,
    7.2.0.6 and 7.5.0.0
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT12929

  • Reported component name

    DATAPOWER

  • Reported component ID

    DP1234567

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-01-11

  • Closed date

    2016-05-13

  • Last modified date

    2016-05-21

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DATAPOWER

  • Fixed component ID

    DP1234567

Applicable component levels

  • R700 PSY

       UP

  • R710 PSY

       UP

  • R720 PSY

       UP

  • R750 PSY

       UP



Document information

More support for: IBM DataPower Gateways
General

Software version: 7.0.0

Reference #: IT12929

Modified date: 21 May 2016