anchor.diff:  		       [length(L), length(DataIn)]),
   	    %% remove_separator() removes any leading CR or LF
   	    SoFar = remove_separator(lists:append(DataIn, L)),
  -	    %% Look for header-body separator
  -	    case string:str(SoFar, "\r\n\r\n") of
  -		0 ->
  +	    case has_header_body_separator(SoFar) of
  +		false ->
   		    %% No Header Body separator yet, read more data
   		    do_recv(SoFar, State);
  -		_ ->
  +		true ->
   		    Rest = header_received(SoFar, State),
  +		    logger:log(debug, "TCP receiver: My buffer now contains ~p bytes of data", [length(Rest)]),
   		    Rest
   	    end;
   	{error, closed} ->
  
positive.code: 
  	       {ssl, Socket, B} ->
  		   L = binary_to_list(B),
  		   logger:log(debug, "TCP receiver: Received ~p bytes of data, adding it to my buffer which contained ~p bytes of data X",
  			      [length(L), length(DataIn)]),
  		   %% remove_separator() removes any leading CR or LF
  		   NewDataIn = lists:append(DataIn, L),
  		   SoFar = remove_separator(NewDataIn),
  		   ssl:setopts(Socket, [{active, once}]),
  		   %% Look for header-body separator
  		   case string:str(SoFar, "\r\n\r\n") of
  		       0 ->
  			   %% No Header Body separator yet, read more data
  			   SoFar;
  		       _ ->
  			   AdditionalData = header_received(SoFar, State),
  			   AdditionalData
  		   end;
  
  
  	       {ssl_closed, Socket} ->
  		   logger:log(debug, "TCP receiver: Extra debug: Socket closed (Socket: ~p, local ~p, remote ~p)",
  
negative.code: 	    %% We received more data than the Content-Length indicated, might be pipelined requests?
  	    %% Remove any CRLF sequences before (or between) requests, RFC3261 #7.5
  	    NewData = remove_separator(lists:flatten(Rest)),
  	    %% Check if there is already a complete request/response in NewData -
  	    %% recurse on ourselves until that is not the case
  	    case has_header_body_separator(NewData) of
  		true  -> header_received(NewData, State);
  		false -> NewData
  	    end;
  	_ ->
  	    logger:log(error, "TCP receiver: Unknown result from sippacket:parse() or tcp_read_sip_message() :~n~p~n" ++
  		       "Closing socket.", [Rest]),
  