web_modules/forge.bundle.js
function(c) {
    var rval = 0;

    // ensure there is enough input data to get the entire record
    var b = c.input;
    var len = b.length();
    if(len < c.record.length) {
      // not enough data yet, return how much is required
      rval = c.record.length - len;
    } else {
      // there is enough data to parse the pending record
      // fill record fragment and compact input buffer
      c.record.fragment.putBytes(b.getBytes(c.record.length));
      b.compact();

      // update record using current read state
      var s = c.state.current.read;
      if(s.update(c, c.record)) {
        // see if there is a previously fragmented message that the
        // new record's message fragment should be appended to
        if(c.fragmented !== null) {
          // if the record type matches a previously fragmented
          // record, append the record fragment to it
          if(c.fragmented.type === c.record.type) {
            // concatenate record fragments
            c.fragmented.fragment.putBuffer(c.record.fragment);
            c.record = c.fragmented;
          } else {
            // error, invalid fragmented record
            c.error(c, {
              message: 'Invalid fragmented record.',
              send: true,
              alert: {
                level: tls.Alert.Level.fatal,
                description:
                  tls.Alert.Description.unexpected_message
              }
            });
          }
        }

        // record is now ready
        c.record.ready = true;
      }
    }

    return rval;
  }
function(c) {
    var rval = 0;

    // ensure there is enough input data to get the entire record
    var b = c.input;
    var len = b.length();
    if(len < c.record.length) {
      // not enough data yet, return how much is required
      rval = c.record.length - len;
    } else {
      // there is enough data to parse the pending record
      // fill record fragment and compact input buffer
      c.record.fragment.putBytes(b.getBytes(c.record.length));
      b.compact();

      // update record using current read state
      var s = c.state.current.read;
      if(s.update(c, c.record)) {
        // see if there is a previously fragmented message that the
        // new record's message fragment should be appended to
        if(c.fragmented !== null) {
          // if the record type matches a previously fragmented
          // record, append the record fragment to it
          if(c.fragmented.type === c.record.type) {
            // concatenate record fragments
            c.fragmented.fragment.putBuffer(c.record.fragment);
            c.record = c.fragmented;
          } else {
            // error, invalid fragmented record
            c.error(c, {
              message: 'Invalid fragmented record.',
              send: true,
              alert: {
                level: tls.Alert.Level.fatal,
                description:
                  tls.Alert.Description.unexpected_message
              }
            });
          }
        }

        // record is now ready
        c.record.ready = true;
      }
    }

    return rval;
  }
function ( c ) { var rval = 0 ; // ensure there is enough input data to get the entire record
 var b = c . input ; var len = b . length ( ) ; if ( len < c . record . length ) { // not enough data yet, return how much is required
 rval = c . record . length - len ; } else { // there is enough data to parse the pending record
 // fill record fragment and compact input buffer
 c . record . fragment . putBytes ( b . getBytes ( c . record . length ) ) ; b . compact ( ) ; // update record using current read state
 var s = c . state . current . read ; if ( s . update ( c , c . record ) ) { // see if there is a previously fragmented message that the
 // new record's message fragment should be appended to
 if ( c . fragmented !== null ) { // if the record type matches a previously fragmented
 // record, append the record fragment to it
 if ( c . fragmented . type === c . record . type ) { // concatenate record fragments
 c . fragmented . fragment . putBuffer ( c . record . fragment ) ; c . record = c . fragmented ; } else { // error, invalid fragmented record
 c . error ( c , { message : 'Invalid fragmented record.' , send : true , alert : { level : tls . Alert . Level . fatal , description : tls . Alert . Description . unexpected_message } } ) ; } } // record is now ready
 c . record . ready = true ; } } return rval ; }
Reads the next record's contents and appends its message to any
previously fragmented message.

@param c the TLS connection with the next record.

@return 0 if the input data could be processed, otherwise the
number of bytes required for data to be processed.
Reads the next record s contents and appends its message to any previously fragmented message .