/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['socket.io/transports/xhr-multipart.js']) {
  _$jscoverage['socket.io/transports/xhr-multipart.js'] = [];
  _$jscoverage['socket.io/transports/xhr-multipart.js'][1] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][4] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][5] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][8] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][10] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][11] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][13] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][14] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][15] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][17] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][19] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][20] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][21] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][22] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][23] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][25] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][27] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][28] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][29] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][30] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][31] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][32] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][33] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][34] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][35] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][36] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][37] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][40] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][41] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][42] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][44] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][45] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][46] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][47] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][49] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][50] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][51] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][52] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][54] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][58] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][59] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][60] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][61] = 0;
  _$jscoverage['socket.io/transports/xhr-multipart.js'][62] = 0;
}
_$jscoverage['socket.io/transports/xhr-multipart.js'][1]++;
var Client = require("../client"), qs = require("querystring");
_$jscoverage['socket.io/transports/xhr-multipart.js'][4]++;
var Multipart = module.exports = (function () {
  _$jscoverage['socket.io/transports/xhr-multipart.js'][5]++;
  Client.apply(this, arguments);
});
_$jscoverage['socket.io/transports/xhr-multipart.js'][8]++;
require("sys").inherits(Multipart, Client);
_$jscoverage['socket.io/transports/xhr-multipart.js'][10]++;
Multipart.prototype._onConnect = (function (req, res) {
  _$jscoverage['socket.io/transports/xhr-multipart.js'][11]++;
  var self = this, body = "", headers = {};
  _$jscoverage['socket.io/transports/xhr-multipart.js'][13]++;
  if (req.headers.origin && this._verifyOrigin(req.headers.origin)) {
    _$jscoverage['socket.io/transports/xhr-multipart.js'][14]++;
    headers["Access-Control-Allow-Origin"] = "*";
    _$jscoverage['socket.io/transports/xhr-multipart.js'][15]++;
    headers["Access-Control-Allow-Credentials"] = "true";
  }
  _$jscoverage['socket.io/transports/xhr-multipart.js'][17]++;
  if (typeof req.headers["access-control-request-method"] !== "undefined") {
    _$jscoverage['socket.io/transports/xhr-multipart.js'][19]++;
    headers["Access-Control-Allow-Methods"] = req.headers["access-control-request-method"];
    _$jscoverage['socket.io/transports/xhr-multipart.js'][20]++;
    res.writeHead(200, headers);
    _$jscoverage['socket.io/transports/xhr-multipart.js'][21]++;
    res.write("ok");
    _$jscoverage['socket.io/transports/xhr-multipart.js'][22]++;
    res.end();
    _$jscoverage['socket.io/transports/xhr-multipart.js'][23]++;
    return;
  }
  _$jscoverage['socket.io/transports/xhr-multipart.js'][25]++;
  switch (req.method) {
  case "GET":
    _$jscoverage['socket.io/transports/xhr-multipart.js'][27]++;
    Client.prototype._onConnect.apply(this, [req, res]);
    _$jscoverage['socket.io/transports/xhr-multipart.js'][28]++;
    headers["Content-Type"] = "multipart/x-mixed-replace;boundary=\"socketio\"";
    _$jscoverage['socket.io/transports/xhr-multipart.js'][29]++;
    headers.Connection = "keep-alive";
    _$jscoverage['socket.io/transports/xhr-multipart.js'][30]++;
    this.request.connection.addListener("end", (function () {
  _$jscoverage['socket.io/transports/xhr-multipart.js'][30]++;
  self._onClose();
}));
    _$jscoverage['socket.io/transports/xhr-multipart.js'][31]++;
    this.response.useChunkedEncodingByDefault = false;
    _$jscoverage['socket.io/transports/xhr-multipart.js'][32]++;
    this.response.shouldKeepAlive = true;
    _$jscoverage['socket.io/transports/xhr-multipart.js'][33]++;
    this.response.writeHead(200, headers);
    _$jscoverage['socket.io/transports/xhr-multipart.js'][34]++;
    this.response.write("--socketio\n");
    _$jscoverage['socket.io/transports/xhr-multipart.js'][35]++;
    if ("flush" in this.response) {
      _$jscoverage['socket.io/transports/xhr-multipart.js'][35]++;
      this.response.flush();
    }
    _$jscoverage['socket.io/transports/xhr-multipart.js'][36]++;
    this._payload();
    _$jscoverage['socket.io/transports/xhr-multipart.js'][37]++;
    break;
  case "POST":
    _$jscoverage['socket.io/transports/xhr-multipart.js'][40]++;
    headers["Content-Type"] = "text/plain";
    _$jscoverage['socket.io/transports/xhr-multipart.js'][41]++;
    req.addListener("data", (function (message) {
  _$jscoverage['socket.io/transports/xhr-multipart.js'][42]++;
  body += message.toString();
}));
    _$jscoverage['socket.io/transports/xhr-multipart.js'][44]++;
    req.addListener("end", (function () {
  _$jscoverage['socket.io/transports/xhr-multipart.js'][45]++;
  try {
    _$jscoverage['socket.io/transports/xhr-multipart.js'][46]++;
    var msg = qs.parse(body);
    _$jscoverage['socket.io/transports/xhr-multipart.js'][47]++;
    self._onMessage(msg.data);
  }
  catch (e) {
  }
  _$jscoverage['socket.io/transports/xhr-multipart.js'][49]++;
  res.writeHead(200, headers);
  _$jscoverage['socket.io/transports/xhr-multipart.js'][50]++;
  res.write("ok");
  _$jscoverage['socket.io/transports/xhr-multipart.js'][51]++;
  res.end();
  _$jscoverage['socket.io/transports/xhr-multipart.js'][52]++;
  body = "";
}));
    _$jscoverage['socket.io/transports/xhr-multipart.js'][54]++;
    break;
  }
});
_$jscoverage['socket.io/transports/xhr-multipart.js'][58]++;
Multipart.prototype._write = (function (message) {
  _$jscoverage['socket.io/transports/xhr-multipart.js'][59]++;
  if (this._open) {
    _$jscoverage['socket.io/transports/xhr-multipart.js'][60]++;
    this.response.write("Content-Type: text/plain" + (message.length === 1 && message.charCodeAt(0) === 6? "; charset=us-ascii": "") + "\n\n");
    _$jscoverage['socket.io/transports/xhr-multipart.js'][61]++;
    this.response.write(message + "\n");
    _$jscoverage['socket.io/transports/xhr-multipart.js'][62]++;
    this.response.write("--socketio\n");
  }
});
_$jscoverage['socket.io/transports/xhr-multipart.js'].source = ["var Client = require('../client')","  , qs = require('querystring');","","var Multipart = module.exports = function(){","  Client.apply(this, arguments);","};","","require('sys').inherits(Multipart, Client);","","Multipart.prototype._onConnect = function(req, res){","  var self = this, body = '', headers = {};","  // https://developer.mozilla.org/En/HTTP_Access_Control","  if (req.headers.origin &amp;&amp; this._verifyOrigin(req.headers.origin)){","    headers['Access-Control-Allow-Origin'] = '*';","    headers['Access-Control-Allow-Credentials'] = 'true';","  }","  if (typeof req.headers['access-control-request-method'] !== 'undefined'){","    // CORS preflight message","    headers['Access-Control-Allow-Methods'] = req.headers['access-control-request-method'];","    res.writeHead(200, headers);","    res.write('ok');","    res.end();","    return;","  }","  switch (req.method){","    case 'GET':","      Client.prototype._onConnect.apply(this, [req, res]);","      headers['Content-Type'] = 'multipart/x-mixed-replace;boundary=\"socketio\"';","      headers['Connection'] = 'keep-alive';","      this.request.connection.addListener('end', function(){ self._onClose(); });","      this.response.useChunkedEncodingByDefault = false;","      this.response.shouldKeepAlive = true;","      this.response.writeHead(200, headers);","      this.response.write(\"--socketio\\n\");","      if ('flush' in this.response) this.response.flush();","      this._payload();","      break;","      ","    case 'POST':","      headers['Content-Type'] = 'text/plain';","      req.addListener('data', function(message){","        body += message.toString();","      });","      req.addListener('end', function(){","        try {","          var msg = qs.parse(body);","          self._onMessage(msg.data);","        } catch(e){}","        res.writeHead(200, headers);","        res.write('ok');","        res.end();","        body = '';","      });","      break;","  }","};","  ","Multipart.prototype._write = function(message){","  if (this._open){","    this.response.write(\"Content-Type: text/plain\" + (message.length === 1 &amp;&amp; message.charCodeAt(0) === 6 ? \"; charset=us-ascii\" : \"\") + \"\\n\\n\");","    this.response.write(message + \"\\n\");","    this.response.write(\"--socketio\\n\");","  }","};"];
