Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change 'domain' attribute on the res object to 'hostname'. Because of…

… domains

introduces in 0.8, 'domain' attribute on EventEmitter objects is now special.
  • Loading branch information...
commit b7a132bdf47c727159b8cd6dd9ff18df3a05e475 1 parent b04b81a
@Kami Kami authored
View
10 README.markdown
@@ -156,7 +156,7 @@ MUST call either `ack.accept()` or `ack.reject()`.
Emitted when `HELO`, `EHLO`, or `LHLO` commands are received.
Read the name of the command with `cmd.greeting`.
-Read the optional domain parameter with `cmd.domain`.
+Read the optional hostname parameter with `cmd.hostname`.
### 'from', from, ack
@@ -214,9 +214,9 @@ Extended recipient data if sent as a string.
The greeting command. One of `'helo'`, `'ehlo'`, or `'lhlo'`.
-### req.domain
+### req.hostname
-The domain specified in the greeting.
+The hostname specified in the greeting.
server acknowledgements
=======================
@@ -269,10 +269,10 @@ stream.on('secure', function (ack) {
})
```
-client.helo(domain, cb)
+client.helo(hostname, cb)
-----------------------
-Greet the server with the `domain` string.
+Greet the server with the `hostname` string.
`cb(err, code, lines)` fires with the server response.
View
2  lib/client/parser.js
@@ -56,7 +56,7 @@ function parse (cmd, data) {
case 'lhlo' :
res.name = 'greeting';
res.greeting = cmd;
- res.domain = data;
+ res.hostname = data;
break;
case 'mail' :
View
10 lib/client/proto.js
@@ -5,15 +5,15 @@ var os = require('os');
var EventEmitter = require('events').EventEmitter;
var undot = require('../dot').undot;
-module.exports = function (domain, stream) {
+module.exports = function (hostname, stream) {
if (stream === undefined) {
- stream = domain;
- domain = undefined;
+ stream = hostname;
+ hostname = undefined;
}
var p = parser(stream);
var write = writer(stream);
- write(220, domain || os.hostname());
+ write(220, hostname || os.hostname());
function createAck (cb, okCode, raw) {
return {
@@ -61,7 +61,7 @@ module.exports = function (domain, stream) {
if (cmd.name === 'greeting') {
emit('greeting', cmd, function () {
req.greeting = cmd.greeting;
- req.domain = cmd.domain;
+ req.hostname = cmd.hostname;
});
}
else {
View
10 lib/server/proto.js
@@ -28,14 +28,14 @@ function Client (stream) {
Client.prototype = new EventEmitter;
-Client.prototype.helo = function (domain, cb) {
- if (typeof domain === 'function') {
- cb = domain;
- domain = undefined;
+Client.prototype.helo = function (hostname, cb) {
+ if (typeof hostname === 'function') {
+ cb = hostname;
+ hostname = undefined;
}
this.stream.write(
'HELO'
- + (domain !== undefined ? ' ' + domain : '')
+ + (hostname !== undefined ? ' ' + hostname : '')
+ '\r\n'
);
this.queue.push(cb);
View
2  test/client_parse.js
@@ -25,7 +25,7 @@ test('multi-line code parsing', function (t) {
else if (cmd.name === 'quit') {
t.equal(output[0].name, 'greeting');
t.equal(output[0].greeting, 'ehlo');
- t.equal(output[0].domain, 'localhost');
+ t.equal(output[0].hostname , 'localhost');
t.equal(output[1].name, 'mail');
t.equal(output[1].from, 'beep@example.com');

0 comments on commit b7a132b

Please sign in to comment.
Something went wrong with that request. Please try again.