From b5cd2f098691935b6bef6ded1b0de7ef37431f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 27 May 2015 09:43:02 +0200 Subject: [PATCH] dgram: partially revert 18d457b Revert "dgram: call send callback asynchronously" partially, since the fix is now done in libuv. Refs: https://github.com/nodejs/io.js/pull/1313 Refs: https://github.com/libuv/libuv/pull/371 PR-URL: https://github.com/nodejs/io.js/pull/1889 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- lib/dgram.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/dgram.js b/lib/dgram.js index f30e562c35f..2b65b94bce5 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -332,10 +332,7 @@ function afterSend(err) { if (err) { err = exceptionWithHostPort(err, 'send', this.address, this.port); } - var self = this; - setImmediate(function() { - self.callback(err, self.length); - }); + this.callback(err, this.length); }