What is Megaphone?

What is Megaphone?
The Megaphone project is about enhancing open source chat software. Specifically, the goal is to allow ejabberd to support 1,000,000 simultaneous users. See The Plan page for more details on how I plan to solve this problem. See the About this Blog page for more details on why I created this blog.

Wednesday, March 7, 2012

Wrong Again

Previously...
  • I determined that megaphone needed to listen for new connections.
  • I came to a conclusion regarding how to watch for new connections.
  • I researched how to call ejabberd_http_bind

The good news is that, because very few people read this blog, I don't feel so bad about admitting it when I mess up.  The bad news is that I was wrong again.  

At this point, it looks like the bit of code that invokes ejabberd_http_bind, or more specifically mod_http_bind:process, is some code in ejabberd_http:

process([], _) ->
    ejabberd_web:error(not_found);
process(Handlers, Request) ->
    [{HandlerPathPrefix, HandlerModule} | HandlersLeft] = Handlers,
     
    case (lists:prefix(HandlerPathPrefix, Request#request.path) or
         (HandlerPathPrefix==Request#request.path)) of
    true ->
<removed some comments and debug statements>
            LocalPath = lists:nthtail(length(HandlerPathPrefix), Request#request.path),
            R = HandlerModule:process(LocalPath, Request),
            ejabberd_hooks:run(http_request_debug, [{LocalPath, Request}]),
            R;
    false ->
        process(HandlersLeft, Request)
    end.
 
To be more specific, I now think that this bit of code:

            R = HandlerModule:process(LocalPath, Request),
Is the one that invokes the BOSH stuff.  In the case where BOSH is being dealt with, the HandlerModule is "mod_http_bind" so hopefully that is what I need to invoke.

Next time: the code to invoke this stuff, hopefully.

No comments:

Post a Comment