anchor.diff:  init_socket(Sock) ->
       ok = inet:setopts(Sock, [{nodelay, true}]).
   
  +%%%===================================================================
  +%%% Process messages / HTTP request state handling
  +%%%===================================================================
  +
   handle_msg({http, _, {http_request, Method, Path, Ver}}, _From, State) ->
       set_socket_active_once(State),
       {noreply, set_request(Method, Path, Ver, State)};
  
positive.code: set_socket_active_once(#state{sock=S}) ->
      ok = inet:setopts(S, [{active, once}]).
  
  set_request(Method, Path, Ver, State) ->
      State#state{
        env=init_env(Method, Path, Ver),
  
negative.code: handle_recv({error, Error}, _App, _State) ->
      {stop, {recv_error, Error}}.
  
  %%%===================================================================
  %%% recv_form_data support
  %%%===================================================================
  
  handle_app_recv_form_data(App, Env, Options, State) ->
      ContentType = psycho:env_val(content_type, Env),
      handle_app_recv_form_data_type(
        ContentType, App, setenv(Env, State), Options).
  
  handle_app_recv_form_data_type(
    "application/x-www-form-urlencoded", App, State, Options) ->
      handle_app_recv_urlencoded_data(App, State, Options);
  handle_app_recv_form_data_type(
    "multipart/form-data;"++_, App, State, Options) ->
      handle_app_recv_multipart(App, State, Options);
  handle_app_recv_form_data_type(ContentType, _App, State, _Options) ->
      respond(internal_error("Unsupported content type"), State),
      error({form_data_content_type, ContentType}).
  
  %%%===================================================================
  %%% urlencoded form data
  %%%===================================================================
  
  handle_app_recv_urlencoded_data(App, State, Options) ->
      Timeout = proplists:get_value(recv_timeout, Options, ?IDLE_TIMEOUT),
      RecvResult = recv_remaining(Timeout, State),
      handle_recv_urlencoded_form_data(RecvResult, App, State).
  
  handle_recv_urlencoded_form_data({ok, Data}, App, #state{env=Env}=State) ->
      DecodedData = decode_urlencoded_form_data(Data),
  