老手网

解决ejabberd2.1.11使用Flash的安全沙箱问题

分类:Erlang 作者:oldhand 来源: 发布:2013-05-21 16:59:23
Flash的安全沙箱问题
就是一个crossdomain.xml的问题
但在ejabberd无法加入这个文件上,
其实很简单,只需要加在ejabberd_c2s.erl的wait_for_stream函数上增加一个分支就行了。
位置在278行开始

%%----------------------------------------------------------------------
%% Func: StateName/2
%% Returns: {next_state, NextStateName, NextStateData}          |
%%          {next_state, NextStateName, NextStateData, Timeout} |
%%          {stop, Reason, NewStateData}
%%----------------------------------------------------------------------
wait_for_stream({xmlstreamstart, "policy-file-request", _Attrs}, StateData) ->
       ejabberd_socket:reset_stream(StateData#state.socket),
        send_text(StateData,
            "\n"
            "\n"
            "\n"
            "       \n"
            "       \n" %% in case your ejabberd also configured to answer the legacy jabber port -5269
            "\n\0"),
        {stop, normal, StateData};
	
wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
    DefaultLang = case ?MYLANG of
		      undefined ->
			  "en";
		      DL ->
			  DL
		  end,
    case xml:get_attr_s("xmlns:stream", Attrs) of

-
分享到:

Copyright © 2012 - 2014 oldhand.cn All Rights Reserved. 粤ICP备13025864号