Skip to content
Snippets Groups Projects
Commit 9fbf0b15 authored by rswindell's avatar rswindell
Browse files

SENDERPROTOCOL and SENDERPORT hfields are now properly converted to the

from_protocol and from_port JS msg header properties (and documented).
parent 373c6b8b
No related branches found
No related tags found
No related merge requests found
......@@ -534,6 +534,7 @@ js_get_msg_header(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
char msg_id[256];
char reply_id[256];
char* val;
ushort* port;
int i;
uintN n;
smbmsg_t msg;
......@@ -697,6 +698,17 @@ js_get_msg_header(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
JS_DefineProperty(cx, hdrobj, "from_host_name"
,STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE);
if((val=smb_get_hfield(&msg,SENDERPROTOCOL,NULL))!=NULL
&& (js_str=JS_NewStringCopyZ(cx,val))!=NULL)
JS_DefineProperty(cx, hdrobj, "from_protocol"
,STRING_TO_JSVAL(js_str)
,NULL,NULL,JSPROP_ENUMERATE);
if((port=smb_get_hfield(&msg,SENDERPORT,NULL))!=NULL)
JS_DefineProperty(cx, hdrobj, "from_port"
,INT_TO_JSVAL(*port)
,NULL,NULL,JSPROP_ENUMERATE);
JS_DefineProperty(cx, hdrobj, "forwarded",INT_TO_JSVAL(msg.forwarded)
,NULL,NULL,JSPROP_ENUMERATE);
......@@ -1519,6 +1531,8 @@ static jsSyncMethodSpec js_msgbase_functions[] = {
"<tr><td><tt>from_net_addr</tt><td>Sender's network address"
"<tr><td><tt>from_ip_addr</tt><td>Sender's IP address (if available, for security tracking)"
"<tr><td><tt>from_host_name</tt><td>Sender's host name (if available, for security tracking)"
"<tr><td><tt>from_protocol</tt><td>TCP/IP protocol used by sender (if available, for security tracking)"
"<tr><td><tt>from_port</tt><td>TCP/UDP port number used by sender (if available, for security tracking)"
"<tr><td><tt>replyto</tt><td>Replies should be sent to this name"
"<tr><td><tt>replyto_ext</tt><td>Replies should be sent to this user number"
"<tr><td><tt>replyto_org</tt><td>Replies should be sent to organization"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment