Переглянути джерело

feat: Drops external connect optimization.

A bosh only optimization which is no longer used and does not bring any significant value when measured.
dev1
damencho 2 роки тому
джерело
коміт
362d1b2c68
3 змінених файлів з 0 додано та 71 видалено
  1. 0
    3
      .eslintignore
  2. 0
    67
      connection_optimization/external_connect.js
  3. 0
    1
      package.json

+ 0
- 3
.eslintignore Переглянути файл

@@ -11,6 +11,3 @@ doc/example/libs/*
11 11
 # not seem to be a reason why we will want to risk being inconsistent with our
12 12
 # remaining JavaScript source code.
13 13
 !.eslintrc.js
14
-
15
-# Source code written in ES5 which is not processed through Babel.
16
-connection_optimization/external_connect.js

+ 0
- 67
connection_optimization/external_connect.js Переглянути файл

@@ -1,67 +0,0 @@
1
-/**
2
- * Requests the given webservice that will create the connection and will return
3
- * the necessary details(rid, sid and jid) to attach to this connection and
4
- * start using it. This script can be used for optimizing the connection startup
5
- * time. The function will send AJAX request to a webservice that should
6
- * create the bosh session much faster than the client because the webservice
7
- * can be started on the same machine as the XMPP serever.
8
- *
9
- * NOTE: It's vert important to execute this function as early as you can for
10
- * optimal results.
11
- *
12
- * @param webserviceUrl the url for the web service that is going to create the
13
- * connection.
14
- * @param successCallback callback function called with the result of the AJAX
15
- * request if the request was successfull. The callback will receive one
16
- * parameter which will be JS Object with properties - rid, sid and jid. This
17
- * result should be passed to JitsiConnection.attach method in order to use that
18
- * connection.
19
- * @param error_callback callback function called the AJAX request fail. This
20
- * callback is going to receive one parameter which is going to be JS error
21
- * object with a reason for failure in it.
22
- */
23
-function createConnectionExternally( // eslint-disable-line no-unused-vars
24
-        webserviceUrl,
25
-        successCallback,
26
-        error_callback) {
27
-    if (!window.XMLHttpRequest) {
28
-        error_callback(new Error('XMLHttpRequest is not supported!'));
29
-        return;
30
-    }
31
-
32
-    var HTTP_STATUS_OK = 200;
33
-
34
-    var xhttp = new XMLHttpRequest();
35
-
36
-    xhttp.onreadystatechange = function() {
37
-        if (xhttp.readyState == xhttp.DONE) {
38
-            var now = window.connectionTimes['external_connect.done']
39
-                = window.performance.now();
40
-            console.log('(TIME) external connect XHR done:\t', now);
41
-            if (xhttp.status == HTTP_STATUS_OK) {
42
-                try {
43
-                    var data = JSON.parse(xhttp.responseText);
44
-                    successCallback(data);
45
-                } catch (e) {
46
-                    error_callback(e);
47
-                }
48
-            } else {
49
-                error_callback(new Error('XMLHttpRequest error. Status: '
50
-                    + xhttp.status + '. Error message: ' + xhttp.statusText));
51
-            }
52
-        }
53
-    };
54
-
55
-    xhttp.open('GET', webserviceUrl, true);
56
-
57
-    // Fixes external connect for IE
58
-    // The timeout property may be set only after calling the open() method
59
-    // and before calling the send() method.
60
-    xhttp.timeout = 3000;
61
-
62
-    window.connectionTimes = {};
63
-    var now = window.connectionTimes['external_connect.sending']
64
-        = window.performance.now();
65
-    console.log('(TIME) Sending external connect XHR:\t', now);
66
-    xhttp.send();
67
-}

+ 0
- 1
package.json Переглянути файл

@@ -79,7 +79,6 @@
79 79
   "files": [
80 80
     "dist",
81 81
     "types",
82
-    "connection_optimization/external_connect.js",
83 82
     "modules/browser/capabilities.json"
84 83
   ],
85 84
   "license": "Apache-2.0"

Завантаження…
Відмінити
Зберегти