anchor.diff:  parse_header(Socket, Timeout) -> parse_header(Socket, Timeout, #header{}).
   
   parse_header(Socket, Timeout, Header) ->
  -	case gen_tcp:recv(Socket, 0, Timeout) of
  +    case recv(Socket, 0, Timeout) of
   	{ok, "\r\n"} when Header#header.content_length == undefined ->
   	    {error, missing_content_length};
   	{ok, "\r\n"} -> {ok, Header};
   	{ok, HeaderField} ->
  -	    case string:tokens(string:to_lower(HeaderField), " \r\n") of
  -		["content-length:", ContentLength] ->
  -			try
  -				Value = list_to_integer(ContentLength),
  +	    case string:tokens(HeaderField, " \r\n") of
  +		["Content-Length:", ContentLength] ->
  +		    case catch list_to_integer(ContentLength) of
  +			Value when is_integer(Value) ->
   			    parse_header(Socket, Timeout,
  -					 Header#header{content_length = Value})
  -		    catch
  -				_ -> {error, {invalid_content_length, ContentLength}}
  +					 Header#header{content_length =
  +						       Value});
  +			_ -> {error, {invalid_content_length, ContentLength}}
   		    end;
  -		["connection:", "close"] ->
  +		["Connection:", "close"] ->
   		    parse_header(Socket, Timeout,
   				 Header#header{connection = close});
   		_ ->
  
positive.code: %% Copyright (C) 2003 Joakim Greben <jocke@gleipnir.com>.
  %% All rights reserved.
  %%
  %% Redistribution and use in source and binary forms, with or without
  %% modification, are permitted provided that the following conditions
  %% are met: 
  %%
  %% 1. Redistributions of source code must retain the above copyright
  %%    notice, this list of conditions and the following disclaimer. 
  %% 2. Redistributions in binary form must reproduce the above
  %%    copyright notice, this list of conditions and the following
  %%    disclaimer in the documentation and/or other materials provided
  
negative.code: 			{ok, Header} ->
  			    handle_payload(Socket, KeepAlive, Timeout, Header);
  			{error, Reason} when KeepAlive == false ->
  			    close(Socket),
  			    {error, Reason};
  			{error, Reason} -> {error, Socket, Reason}
  		    end;
  		{error, Reason} when KeepAlive == false ->
  		    close(Socket),
  		    {error, Reason};
  		{error, Reason} ->
  		    {error, Socket, Reason}
  	    end;
  	{error, Reason} when KeepAlive == false ->
  	    close(Socket),
  	    {error, Reason};
  	{error, Reason} -> {error, Socket, Reason}
      end.
  
  send(Socket, URI, false, Payload) ->
      send(Socket, URI, "Connection: close\r\n", Payload);
  send(Socket, URI, true, Payload) -> send(Socket, URI, "", Payload);
  send(Socket, {Host,URI}, Header, Payload) ->
      Request =
  	["POST ", URI, " HTTP/1.1\r\n",
  	 "Content-Length: ", integer_to_list(lists:flatlength(Payload)),
  	 "\r\n",
  	 "User-Agent: Erlang XML-RPC Client 1.13\r\n",
  	 "Content-Type: text/xml\r\n",
  	 "Host: ", Host, "\r\n",
  	 Header, "\r\n",
  	 Payload],
      send(Socket, Request);
  send(Socket, URI, Header, Payload) ->
      Request =
  	["POST ", URI, " HTTP/1.1\r\n",
  	 "Content-Length: ", integer_to_list(lists:flatlength(Payload)),
  	 "\r\n",
  	 "User-Agent: Erlang XML-RPC Client 1.13\r\n",
  	 "Content-Type: text/XML\r\n",
  	 Header, "\r\n",
  	 Payload],
      send(Socket, Request).
  
  parse_response(Socket, Timeout) ->
      setopts(Socket, [{packet, line}]),
      case recv(Socket, 0, Timeout) of
  	{ok, "HTTP/1.1 200 OK\r\n"} -> parse_header(Socket, Timeout);
  	{ok, StatusLine} -> {error, StatusLine};
  	{error, Reason} -> {error, Reason}
  