pike.git / lib / modules / Protocols.pmod / EngineIO.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/EngineIO.pmod:705:    request = req;    _options = .EngineIO.options;    if (options && sizeof(options))    _options += options;    switch (curtransport = req.variables->transport) {    default:    req.response_and_finish((["data":"Unsupported transport",    "error":Protocols.HTTP.HTTP_UNSUPP_MEDIA]));    return;    case "websocket": -  conn = WebSocket(req, req.websocket_accept(0, UNDEFINED, _options)); +  conn = WebSocket(req, +  req.websocket_accept(0, ({ Protocols.WebSocket.permessagedeflate(_options) })));    break;    case "polling":    conn = req.variables.j ? JSONP(req) : XHR(req);    break;    }    conn.read_cb = recv;    ci->add(Crypto.Random.random_string(SIDBYTES-TIMEBYTES));    ci->add_hint(gethrtime(), TIMEBYTES);    sid = MIME.encode_base64(ci->read());    clients[sid] = this;
pike.git/lib/modules/Protocols.pmod/EngineIO.pmod:741:    if ((s = req.variables->transport) == curtransport)    conn.onrequest(req);    else    switch (s) {    default:    req.response_and_finish((["data":"Invalid transport",    "error":Protocols.HTTP.HTTP_UNSUPP_MEDIA]));    return 0;    case "websocket":    upgtransport = -  WebSocket(req, req.websocket_accept(0, UNDEFINED, _options)); +  WebSocket(req, +  req.websocket_accept(0, ({ Protocols.WebSocket.permessagedeflate(_options) })));    upgtransport.read_cb = upgrecv;    }    }       private string _sprintf(int type, void|mapping flags) {    string res=UNDEFINED;    switch (type) {    case 'O':    res = sprintf(DRIVERNAME"(%s.%d,%s,%d,%d,%d,%d)",    sid, protocol, curtransport, state, sendq.size(),    recvq.is_empty(),sizeof(clients));    break;    }    return res;    }   }