diff options
author | Sverker Eriksson <[email protected]> | 2013-02-18 15:09:00 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-02-18 15:20:47 +0100 |
commit | 9a35c01873fb56316136e1314ad6adffe97b9fa5 (patch) | |
tree | a67f86b77f1e08049b51e766468fb63a139d666e /lib/erl_interface/src/misc | |
parent | 499eef0cd693b2f96ec19148d2f6666c3df7d834 (diff) | |
download | otp-9a35c01873fb56316136e1314ad6adffe97b9fa5.tar.gz otp-9a35c01873fb56316136e1314ad6adffe97b9fa5.tar.bz2 otp-9a35c01873fb56316136e1314ad6adffe97b9fa5.zip |
erl_interface,ic: Remove node_org_enc from erlang_{pid,port,ref}
in order to be backward compatible with user code that
accesses the members of erlang_pid and friend.
The documentation does not mention the content of these structs,
but we have example code that does. So the safe way it the revert
the node_org_enc field (added in R16A) and instead determine in
runtime which atom encoding to use depending on if the node atom
contains unicode (>255) characters or not.
Diffstat (limited to 'lib/erl_interface/src/misc')
-rw-r--r-- | lib/erl_interface/src/misc/ei_decode_term.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/erl_interface/src/misc/ei_decode_term.c b/lib/erl_interface/src/misc/ei_decode_term.c index 1423ec7ed7..ce5ae5b19d 100644 --- a/lib/erl_interface/src/misc/ei_decode_term.c +++ b/lib/erl_interface/src/misc/ei_decode_term.c @@ -54,7 +54,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) return ei_decode_atom(buf, index, term->value.atom_name); case ERL_REFERENCE_EXT: /* first the nodename */ - if (get_atom(&s, term->value.ref.node, &term->value.ref.node_org_enc) < 0) return -1; + if (get_atom(&s, term->value.ref.node, NULL) < 0) return -1; /* now the numbers: num (4), creation (1) */ term->value.ref.n[0] = get32be(s); term->value.ref.len = 1; @@ -64,7 +64,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) /* first the integer count */ term->value.ref.len = get16be(s); /* then the nodename */ - if (get_atom(&s, term->value.ref.node, &term->value.ref.node_org_enc) < 0) return -1; + if (get_atom(&s, term->value.ref.node, NULL) < 0) return -1; /* creation */ term->value.ref.creation = get8(s) & 0x03; /* finally the id integers */ @@ -76,12 +76,12 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) } break; case ERL_PORT_EXT: - if (get_atom(&s, term->value.port.node, &term->value.port.node_org_enc) < 0) return -1; + if (get_atom(&s, term->value.port.node, NULL) < 0) return -1; term->value.port.id = get32be(s) & 0x0fffffff; /* 28 bits */; term->value.port.creation = get8(s) & 0x03; break; case ERL_PID_EXT: - if (get_atom(&s, term->value.pid.node, &term->value.port.node_org_enc) < 0) return -1; + if (get_atom(&s, term->value.pid.node, NULL) < 0) return -1; /* now the numbers: num (4), serial (4), creation (1) */ term->value.pid.num = get32be(s) & 0x7fff; /* 15 bits */ term->value.pid.serial = get32be(s) & 0x1fff; /* 13 bits */ |