Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  child_channel_id.js   Sprache: JAVA

 
/**
 * Send HTTP requests and notify the parent about their channelId
 */

/* global NetUtil, ChannelListener */

let shouldQuit = false;

function run_test() {
  // keep the event loop busy and the test alive until a "finish" command
  // is issued by parent
  do_timeout(100, function keepAlive() {
    if (!shouldQuit) {
      do_timeout(100, keepAlive);
    }
  });
}

function makeRequest(uri) {
  let requestChannel = NetUtil.newChannel({
    uri,
    loadUsingSystemPrincipal: true,
  });
  requestChannel.asyncOpen(new ChannelListener(checkResponse, requestChannel));
  requestChannel.QueryInterface(Ci.nsIHttpChannel);
  dump(`Child opened request: ${uri}, channelId=${requestChannel.channelId}\n`);
}

function checkResponse(request, buffer, requestChannel) {
  // notify the parent process about the original request channel
  requestChannel.QueryInterface(Ci.nsIHttpChannel);
  do_send_remote_message(`request:${requestChannel.channelId}`);

  // the response channel can be different (if it was redirected)
  let responseChannel = request.QueryInterface(Ci.nsIHttpChannel);

  let uri = responseChannel.URI.spec;
  let origUri = responseChannel.originalURI.spec;
  let id = responseChannel.channelId;
  dump(`Child got response to: ${uri} (orig=${origUri}), channelId=${id}\n`);

  // notify the parent process about this channel's ID
  do_send_remote_message(`response:${id}`);
}

function finish() {
  shouldQuit = true;
}

Messung V0.5
C=94 H=90 G=91

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge