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.

Tuesday, March 13, 2012

And It Didn't Work

Previously...
  • I decided on using ejabberd_http_bind:process_request.
  • I came up with a new plan.
  • I wrote some new code to process requests.

I wired it up, flipped the switch and...it didn't work.  Not exactly surprising, especially when you consider that I'm wading through my taxes right now.

The error that I got included the following:


=ERROR REPORT==== 2012-03-13 19:10:37 ===
Error in process <0.378.0> on node 'ejabberd@localhost' with exit value: {badarg,[{erlang,length,[{400,[{"Content-Type","text/xml; charset=utf-8"},{"Access-Control-Allow-Origin","*"},{"Access-Control-Allow-Headers","Content-Type"}],[]}]},{megaphone_sender,send_packet,3},{megaphone_sender,main_loop...

To a lesser mortal this might seem like gibberish.  To me it seems like gibberish.  It is gibberish.  But it also means that the receiver is passing on HTTP headers along with the rest of the packet to megaphone.  

That means that megaphone_receiver needs to discard the headers and pass along just the body of the request.  I find this ironic because I was previously trying to ensure that megaphone was passing the raw HTTP request to ejabberd_http_bind, but I digress.

Next time: removing the headers.

No comments:

Post a Comment