Skip to content

Commit

Permalink
Fix undefined variable platformDOT in hmail.js (haraka#1943)
Browse files Browse the repository at this point in the history
* Update qfile.js

* Update hmail.js

* Update index.js
  • Loading branch information
superman20 authored and baudehlo committed May 24, 2017
1 parent 00f1b7a commit 496a6e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion outbound/hmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ function split_to_new_recipients (hmail, recipients, response, cb) {
return cb(hmail);
}
var fname = _qfile.name();
var tmp_path = path.join(queue_dir, platformDOT + fname);
var tmp_path = path.join(queue_dir, _qfile.platformDOT + fname);
var ws = new FsyncWriteStream(tmp_path, { flags: WRITE_EXCL });
var err_handler = function (err, location) {
logger.logerror("[outbound] Error while splitting to new recipients (" + location + "): " + err);
Expand Down
5 changes: 2 additions & 3 deletions outbound/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var queuelib = require('./queue');
var HMailItem = require('./hmail');
var TODOItem = require('./todo');
var pools = require('./client_pool');
var _qfile = require('./qfile');

var queue_dir = queuelib.queue_dir;
var temp_fail_queue = queuelib.temp_fail_queue;
Expand All @@ -31,8 +32,6 @@ var delivery_queue = queuelib.delivery_queue;
var core_consts = require('constants');
var WRITE_EXCL = core_consts.O_CREAT | core_consts.O_TRUNC | core_consts.O_WRONLY | core_consts.O_EXCL;

var platformDOT = ((['win32','win64'].indexOf( process.platform ) !== -1) ? '' : '__tmp__') + '.';

exports.net_utils = net_utils;
exports.config = config;

Expand Down Expand Up @@ -279,7 +278,7 @@ exports.process_delivery = function (ok_paths, todo, hmails, cb) {
var self = this;
logger.loginfo("[outbound] Processing domain: " + todo.domain);
var fname = _qfile.name();
var tmp_path = path.join(queue_dir, platformDOT + fname);
var tmp_path = path.join(queue_dir, _qfile.platformDOT + fname);
var ws = new FsyncWriteStream(tmp_path, { flags: WRITE_EXCL });
ws.on('close', function () {
var dest_path = path.join(queue_dir, fname);
Expand Down
5 changes: 4 additions & 1 deletion outbound/qfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";

var my_hostname = require('os').hostname().replace(/\\/, '\\057').replace(/:/, '\\072');
var platform_dot = ((['win32','win64'].indexOf( process.platform ) !== -1) ? '' : '__tmp__') + '.';

var QFILECOUNTER = 0;

Expand Down Expand Up @@ -84,5 +85,7 @@ var _qfile = module.exports = {
host : p[6],
age : time - parseInt(p[0])
};
}
},

platformDOT : platform_dot
};

0 comments on commit 496a6e1

Please sign in to comment.