[ejabberd] More virt host woes.

Badlop badlop at gmail.com
Thu Feb 7 03:45:45 MSK 2008

2008/2/4, Brian Cully <bcully at gmail.com>:
>         1) No documentation. No comments. No nothing about how stuff works on
> the inside. To work with this software you must read the code, and the
> code has no comments! None!

Well, to administer the server you read the ejabberd administration
guide. And to modify the source code, you read the source code.

It would be nice to improve the documentation for developers. Existing material:

 * The ejabberd Developers Guide documents the core

 * ejabberd module development

 * And a mixed bag:

Regarding the comments in source code: I agree, sometimes a comment is
really required to understand the code.

In other cases [1] it's preferable to not comment. Do you agree? :)

> %% Given an element and a new subelement,
> %% replace the instance of the subelement
> %% in element with the new subelement.
> replace_subelement({xmlelement, Name, Attrs, SubEls}, NewSubEl) ->
>     {_, NameNewSubEl, _, _} = NewSubEl,
>     SubEls2 = lists:keyreplace(NameNewSubEl, 2, SubEls, NewSubEl),
>     {xmlelement, Name, Attrs, SubEls2}.

If you finally can modify ejabberd for your requirements and use it,
do you plan to contribute to it somehow, for example documenting the
functions that you had to investigate during your development stage?

>         I'm trying to hack ejabberd into something suitable for xmpp hosting
> of virtual domains. There are a number of problems with it so far:
>         2) The code itself absolutely does not want to do this. To some
>         3) And this is a really really big deal: ejabberd starts 10 sql
> connections per vhost!
> Any explanation as to why ejabberd
> absolutely does not want to do this as it stands today?

After trying Magnus' patch, and digging in the code to check what was
going on, I concluded that the feature would require many invasive
changes in the ejabberd core.

So I redirected my interest into learning to use cron to restart
ejabberd at midnight. That solved my particular problem.

Any explanation as to why you need this feature so much?

[1] https://forge.process-one.net/browse/ejabberd/trunk/src/mod_muc/mod_muc_room.erl?r1=1171&r2=1175

More information about the ejabberd mailing list