anchor.diff:  %%--------------------------------------------------------------------------
   %% File renaming
   handle_ctrl_result({pos_interm, _}, #state{caller = {rename, NewFile}} 
  -		   = State) ->
  -    _ = send_ctrl_message(State, mk_cmd("RNTO ~s", [NewFile])),
  -    activate_ctrl_connection(State),
  +		   = State0) ->
  +    _ = send_ctrl_message(State0, mk_cmd("RNTO ~s", [NewFile])),
  +    State = activate_ctrl_connection(State0),
       {noreply, State#state{caller = rename_second_phase}}; 
   
   handle_ctrl_result({Status, _}, 
  
positive.code:                     false ->
                          {IP1, IP2, IP3, IP4} = IP,
                          {Port1, Port2} = {Port div 256, Port rem 256},
                          send_ctrl_message(State,
                                            mk_cmd("PORT ~w,~w,~w,~w,~w,~w",
                                                   [IP1, IP2, IP3, IP4, Port1, Port2]));
                      true ->
                          IpAddress = inet_parse:ntoa(IP),
                          Cmd = mk_cmd("EPRT |1|~s|~p|", [IpAddress, Port]),
                          send_ctrl_message(State, Cmd)
                  end,
  	    activate_ctrl_connection(State),
  	    {noreply, State#state{caller = {setup_data_connection, 
  					    {LSock, Caller}}}}
      end;
  
  setup_data_connection(#state{mode = passive, ipfamily = inet6,
  			     caller = Caller} = State) ->
      _ = send_ctrl_message(State, mk_cmd("EPSV", [])),
      activate_ctrl_connection(State),
      {noreply, State#state{caller = {setup_data_connection, Caller}}};
  
  setup_data_connection(#state{mode = passive, ipfamily = inet,
  			     caller = Caller,
  			     ftp_extension = false} = State) ->
      _ = send_ctrl_message(State, mk_cmd("PASV", [])),
      activate_ctrl_connection(State),
      {noreply, State#state{caller = {setup_data_connection, Caller}}};    
  
  setup_data_connection(#state{mode = passive, ipfamily = inet,
  			     caller = Caller,
  			     ftp_extension = true} = State) ->
      _ = send_ctrl_message(State, mk_cmd("EPSV", [])),
      activate_ctrl_connection(State),
      {noreply, State#state{caller = {setup_data_connection, Caller}}}.
  
  connect(Host, Port, SockOpts, Timeout, #state{ipfamily = inet = IpFam}) ->
  
negative.code:     ?DBG('<--ctrl ssl:connect(~p, ~p)~n~p~n',[Socket,TLSOptions,State0]),
      case ssl:connect(Socket, TLSOptions, Timeout) of
  	{ok, TLSSocket} ->
  	    State1 = State0#state{csock = {ssl,TLSSocket}},
  	    _ = send_ctrl_message(State1, mk_cmd("PBSZ 0", [])),
  	    State = activate_ctrl_connection(State1),
  	    {noreply, State#state{tls_upgrading_data_connection = {true, pbsz}} };
  	{error, _} = Error ->
  	    gen_server:reply(From,  {Error, self()}),
  