anchor.diff:  
   
   %% header parsing
  -
   parse_qval(S) ->
       parse_qval([], S).
   
  -parse_qval(A, ";q="++Q) ->
  -    {lists:reverse(A), parse_qvalue(Q)};
  -parse_qval(A, "") ->
  -    {lists:reverse(A), 1000};
  -parse_qval(A, [C|T]) ->
  -    parse_qval([C|A], T).
  -
  -
  -parse_qvalue("0") ->
  -    0;
  -parse_qvalue("0.") ->
  -    0;
  -parse_qvalue("1") ->
  -    1000;
  -parse_qvalue("1.") ->
  -    1000;
  -parse_qvalue("1.0") ->
  -    1000;
  -parse_qvalue("1.00") ->
  -    1000;
  -parse_qvalue("1.000") ->
  -    1000;
  -parse_qvalue("0."++[D1]) ->
  -    three_digits_to_integer(D1,$0,$0);
  -parse_qvalue("0."++[D1,D2]) ->
  -    three_digits_to_integer(D1,D2,$0);
  -parse_qvalue("0."++[D1,D2,D3]) ->
  -    three_digits_to_integer(D1,D2,D3);
  -parse_qvalue(_) ->
  -                                                % error
  -    0.
  +parse_qval(A, ";q="++Q) -> {lists:reverse(A), parse_qvalue(Q)};
  +parse_qval(A, "")       -> {lists:reverse(A), 1000};
  +parse_qval(A, [C|T])    -> parse_qval([C|A], T).
  +
  +parse_qvalue("0")              -> 0;
  +parse_qvalue("0.")             -> 0;
  +parse_qvalue("1")              -> 1000;
  +parse_qvalue("1.")             -> 1000;
  +parse_qvalue("1.0")            -> 1000;
  +parse_qvalue("1.00")           -> 1000;
  +parse_qvalue("1.000")          -> 1000;
  +parse_qvalue("0."++[D1])       -> three_digits_to_integer(D1,$0,$0);
  +parse_qvalue("0."++[D1,D2])    -> three_digits_to_integer(D1,D2,$0);
  +parse_qvalue("0."++[D1,D2,D3]) -> three_digits_to_integer(D1,D2,D3);
  +parse_qvalue(_)                -> 0. %% error
   
   three_digits_to_integer(D1, D2, D3) ->
       100*(D1-$0)+10*(D2-$0)+D3-$0.
   
   
   %% Gzip encoding
  -
   accepts_gzip(H, Mime) ->
       case [Val || {_,_,'Accept-Encoding',_,Val}<- H#headers.other] of
           [] ->
               false;
           [AcceptEncoding] ->
  -            EncodingList = [parse_qval(X) ||
  -                               X <- split_sep(AcceptEncoding, $,)],
  -            case [Q || {"gzip", Q} <- EncodingList]
  -                ++ [Q || {"*", Q} <- EncodingList] of
  +            EncList = [parse_qval(X) || X <- split_sep(AcceptEncoding, $,)],
  +            case [Q || {"gzip",Q} <- EncList] ++ [Q || {"*",Q} <- EncList] of
                   [] ->
                       false;
  -                [Q|_] -> (Q > 100)  % just for fun
  -                             and not has_buggy_gzip(
  -                                       H#headers.user_agent, Mime)
  +                [Q|_] ->
  +                    (Q > 100) %% just for fun
  +                        and not has_buggy_gzip(H#headers.user_agent, Mime)
               end;
           _ ->
               false
  
positive.code: outh_set_dcc(Req, Headers) ->
      H = get(outh),
      {DoClose, Chunked} = dcc(Req, Headers),
      H2 = H#outh{connection = make_connection_close_header(DoClose),
                  doclose = DoClose,
                  chunked = Chunked,
                  transfer_encoding =
                  make_transfer_encoding_chunked_header(Chunked)},
      put(outh, H2).
  
  
  %% can only turn if off, not on.
  %% if it allready is off, it's off because the cli headers forced us.
  
  outh_set_transfer_encoding_off() ->
      H = get(outh),
      H2 = H#outh{chunked = false,
                  transfer_encoding =
                  make_transfer_encoding_chunked_header(false)},
      put(outh, H2).
  
  outh_set_auth([]) ->
      ok;
  
  outh_set_auth(Headers) ->
      H = get(outh),
      L = H#outh.www_authenticate,
      H2 = case L of
  	     undefined ->
  		 H#outh{www_authenticate = Headers};
  	     _ ->
  		 H#outh{www_authenticate = H#outh.www_authenticate ++ Headers}
  	 end,
      put(outh, H2).
  
  outh_fix_doclose() ->
      H = get(outh),
      if
          (H#outh.doclose /= true) and (H#outh.contlen==undefined) and
          (H#outh.chunked == false) ->
              put(outh, H#outh{doclose=true,
                               connection=make_connection_close_header(true)});
          true -> ok
      end.
  
  
  
negative.code: %% This is the api function
  %% return {Req, Headers}
  %%     or closed
  http_get_headers(CliSock, SSL) ->
      do_http_get_headers(CliSock, SSL).
  
  
  headers_to_str(Headers) ->
      lists:map(fun(H) -> [H, "\r\n"] end, yaws_api:reformat_header(Headers)).
  
  
  setopts(Sock, Opts, nossl) ->
  