mirror of
https://github.com/danbulant/node-x11
synced 2026-06-14 20:21:40 +00:00
load BigReq extansion by default
This commit is contained in:
parent
0c2cdeb884
commit
93cec8ecc7
1 changed files with 15 additions and 2 deletions
|
|
@ -342,8 +342,11 @@ XClient.prototype.require = function(extName, callback)
|
|||
ext.requireExt(this.display, callback);
|
||||
}
|
||||
|
||||
module.exports.createClient = function(initCb, display)
|
||||
module.exports.createClient = function(initCb, display, options)
|
||||
{
|
||||
if (!options)
|
||||
options = false;
|
||||
|
||||
if (!display)
|
||||
display = process.env.DISPLAY;
|
||||
if (!display)
|
||||
|
|
@ -390,7 +393,17 @@ module.exports.createClient = function(initCb, display)
|
|||
if (initCb)
|
||||
{
|
||||
client.on('connect', function(display) {
|
||||
initCb(display);
|
||||
// opt-in BigReq
|
||||
if (!options.disableBigRequests) {
|
||||
client.require('big-requests', function(BigReq) {
|
||||
BigReq.Enable(function(err, maxLen) {
|
||||
display.max_request_length = maxLen;
|
||||
initCb(display);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
initCb(display);
|
||||
}
|
||||
});
|
||||
}
|
||||
return client;
|
||||
|
|
|
|||
Loading…
Reference in a new issue