function _putStep(callback) {
    this._log.trace("Uploading message " + this._outgoing.type);
    let request = this._newRequest(this._channelURL);
    if (this._their_etag) {
      request.setHeader("If-Match", this._their_etag);
    } else {
      request.setHeader("If-None-Match", "*");
    }
    request.put(this._outgoing, Utils.bind2(this, function (error) {
      if (this._finished) {
        return;
      }

      if (error) {
        this._log.error("Error uploading data. " + error);
        this.abort(JPAKE_ERROR_NETWORK);
        return;
      }
      if (request.response.status != 200) {
        this._log.error("Could not upload data. Server responded with HTTP "
                        + request.response.status);
        this.abort(JPAKE_ERROR_SERVER);
        return;
      }
      // There's no point in returning early here since the next step will
      // always be a GET so let's pause for twice the poll interval.
      this._my_etag = request.response.headers["etag"];
      Utils.namedTimer(function () { callback(); }, this._pollInterval * 2,
                       this, "_pollTimer");
    }));
  }
// Generic handler for uploading data.
Generic handler for uploading data.
Generic handler for uploading data .
function _putStep(callback) {
    this._log.trace("Uploading message " + this._outgoing.type);
    let request = this._newRequest(this._channelURL);
    if (this._their_etag) {
      request.setHeader("If-Match", this._their_etag);
    } else {
      request.setHeader("If-None-Match", "*");
    }
    request.put(this._outgoing, Utils.bind2(this, function (error) {
      if (this._finished) {
        return;
      }
      if (error) {
        this._log.error("Error uploading data. " + error);
        this.abort(JPAKE_ERROR_NETWORK);
        return;
      }
      if (request.response.status != 200) {
        this._log.error("Could not upload data. Server responded with HTTP "
                        + request.response.status);
        this.abort(JPAKE_ERROR_SERVER);
        return;
      }
      this._my_etag = request.response.headers["etag"];
      Utils.namedTimer(function () { callback(); }, this._pollInterval * 2,
                       this, "_pollTimer");
    }));
  }
function _putStep ( callback ) { this . _log . trace ( "Uploading message " + this . _outgoing . type ) ; let request = this . _newRequest ( this . _channelURL ) ; if ( this . _their_etag ) { request . setHeader ( "If-Match" , this . _their_etag ) ; } else { request . setHeader ( "If-None-Match" , "*" ) ; } request . put ( this . _outgoing , Utils . bind2 ( this , function ( error ) { if ( this . _finished ) { return ; } if ( error ) { this . _log . error ( "Error uploading data. " + error ) ; this . abort ( JPAKE_ERROR_NETWORK ) ; return ; } if ( request . response . status != 200 ) { this . _log . error ( "Could not upload data. Server responded with HTTP " + request . response . status ) ; this . abort ( JPAKE_ERROR_SERVER ) ; return ; } this . _my_etag = request . response . headers [ "etag" ] ; Utils . namedTimer ( function ( ) { callback ( ) ; } , this . _pollInterval * 2 , this , "_pollTimer" ) ; } ) ) ; }
Generic handler for uploading data.
Generic handler for uploading data .
// There's no point in returning early here since the next step will // always be a GET so let's pause for twice the poll interval.