/[meteor]/googlecode.com/svn/trunk/public_html/poll.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /googlecode.com/svn/trunk/public_html/poll.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 61 by andrew.betts, Wed Feb 27 21:58:56 2008 UTC revision 62 by andrew.betts, Thu Nov 27 00:33:21 2008 UTC
# Line 14  var isaborted = 0; Line 14  var isaborted = 0;
14  parent.Meteor.register(this);  parent.Meteor.register(this);
15    
16  function newXmlHttp() {  function newXmlHttp() {
17          try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}          var xhr = null;
18          try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}      try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
19          try { return new XMLHttpRequest(); } catch(e) {}                  try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
20          return null;                          try { xhr = new XMLHttpRequest(); } catch(e) { return false }
21                    }
22            }
23            return xhr;
24    }
25    
26    function setHeaders(xhr) {
27    
28            function safeSet(k, v) {
29                    try {
30                            xhr.setRequestHeader(k, v);
31                    } catch(e) {}
32            }
33    
34            safeSet("User-Agent", null);
35            safeSet("Accept", null);
36            safeSet("Accept-Language", null);
37            safeSet("Content-Type", "M");
38            safeSet("Connection", "keep-alive");
39            safeSet("Keep-Alive", null);
40  }  }
41    
42  function poll() {  function poll() {
# Line 41  function poll() { Line 60  function poll() {
60                  var t = now.getTime();                  var t = now.getTime();
61                  lastrequesttime = t;                  lastrequesttime = t;
62                  if (parent.Meteor.polltimeout) polltimer = setTimeout(ptimeout, parent.Meteor.polltimeout);                  if (parent.Meteor.polltimeout) polltimer = setTimeout(ptimeout, parent.Meteor.polltimeout);
63                    setHeaders(pollreq);
64                  pollreq.send(null);                  pollreq.send(null);
65          }          }
66  }  }

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.26