~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/kernel/src/prim_inet.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (1.1.13 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20090215164252-dxpjjuq108nz4noa
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1089
1089
           {line, ?TCP_PB_LINE_LF},
1090
1090
           {tpkt, ?TCP_PB_TPKT},
1091
1091
           {http, ?TCP_PB_HTTP},
1092
 
           {httph,?TCP_PB_HTTPH}]};
 
1092
           {httph,?TCP_PB_HTTPH},
 
1093
           {ssl, ?TCP_PB_SSL_TLS}, % obsolete
 
1094
           {ssl_tls, ?TCP_PB_SSL_TLS}]};
1093
1095
type_opt_1(mode) ->
1094
1096
    {enum,[{list, ?INET_MODE_LIST},
1095
1097
           {binary, ?INET_MODE_BINARY}]};
1514
1516
%% encode opt/val REVERSED since options are stored in reverse order
1515
1517
%% i.e. the recent options first (we must process old -> new)
1516
1518
encode_opt_val(Opts) -> 
1517
 
    try enc_opt_val(Opts, [])
 
1519
    try 
 
1520
        enc_opt_val(Opts, [])
1518
1521
    catch
1519
1522
        Reason -> {error,Reason}
1520
1523
    end.
1521
1524
 
 
1525
enc_opt_val([{active,once}|Opts], Acc) ->
 
1526
    %% Specially optimized because {active,once} will be used for
 
1527
    %% every packet, not only once when initializing the socket.
 
1528
    %% Measurements show that this optimization is worthwhile.
 
1529
    enc_opt_val(Opts, [<<?INET_LOPT_ACTIVE:8,?INET_ONCE:32>>|Acc]);
1522
1530
enc_opt_val([{raw,P,O,B}|Opts], Acc) ->
1523
1531
    enc_opt_val(Opts, Acc, raw, {P,O,B});
1524
1532
enc_opt_val([{Opt,Val}|Opts], Acc) ->