Skip to content

Commit

Permalink
Log protocol upgrade requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmzeeman committed Oct 10, 2013
1 parent 7b77347 commit 8eccbab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/webmachine_mochiweb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ loop(MochiReq, LoopOpts) ->
{upgrade, UpgradeFun, RsFin, RdFin} ->
%%TODO: wmtracing 4xx result codes should ignore protocol upgrades? (because the code is 404 by default...)
webmachine_controller:stop(RsFin, RdFin),
%% Assumes the upgrade fun returns 101.
LogData0 = webmachine_request:log_data(RdFin),
LogData1 = LogData0#wm_log_data{response_code=101, controller_module=Mod},
webmachine_decision_core:do_log(LogData1),
Mod:UpgradeFun(RdFin, webmachine_controller:modstate(RsFin)),
erlang:put(mochiweb_request_force_close, true)
end
Expand Down

0 comments on commit 8eccbab

Please sign in to comment.