Hi
When encoding a bit string, that has a size constraint that is a
range, and the value to encode
is given using 'named bits', the encoded value always contains the
maximum number of bits.
This is a little inefficient since it forces the transmission of more
bits that necessary.
This is not a real problem, except that we have to communicate with a
node that rejects the
message if the encoded bit string contains more than the minimum number of bits.
Also it might be a good idea to change lists:sort to lists:usort in
asn1rt_ber_bin:get_all_bitposes/3 in order to not getting an error if
the same named bit
is specified more than once/
/Anders
[asn1rt_berbin.patch]
diff otp_src_R13B02-1/lib/asn1/src//asn1rt_ber_bin.erl otp_src_R13B02-1_my/lib/asn1/src//asn1rt_ber_bin.erl
1268c1268,1269
< BitList = make_and_set_list(Max, ToSetPos, 0),
---
> BitsToEnc=lists:min([Max,lists:max([_Min,lists:last(ToSetPos)+1])]),
> BitList = make_and_set_list(BitsToEnc, ToSetPos, 0),
Only in otp_src_R13B02-1_my/lib/asn1/src/: asn1rt_ber_bin.erl~
________________________________________________________________
erlang-patches mailing list. See
http://www.erlang.org/faq.htmlerlang-patches (at) erlang.org