<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    On 05/03/2012 01:29 PM, Daniel-Constantin Mierla wrote:
    <blockquote cite="mid:4FA26C1E.5080606@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <pre wrap="">Hello,

thanks for the patch -- when the module is destroyed, practically is the shut down of kamailio, when the entire memory used is freed (pkg and shm) as well as the one from the system by the system manager. Anyhow, for a clean shut down, is good to have it.

One thing is not clear, where the function redisc_free_reply(str *name) is used? The patch seems just to define it.</pre>
    </blockquote>
    The patch is not finished, only to show a possible solution idea.<br>
    <br>
    Right now, if a user performs:<br>
    <br>
    redis_cmd("srvN", "GET foo", "r");<br>
    <br>
    a redisc_reply_t structure is created and assigned to name "r".&nbsp; If
    user performs again:<br>
    redis_cmd("srvN", "GET bar", "r");<br>
    <br>
    then old redisk_reply_t.rplRedis is freed with freeReplyObject and
    hiredis creates a new redisReply for rplRedis field.<br>
    No problem here, then when kamailio closes that last structure would
    be freed.<br>
    <br>
    However, if user would perform:<br>
    redis_cmd("srvN", "GET foo", "r1");<br>
    redis_cmd("srvN", "GET foo", "r2");<br>
    redis_cmd("srvN", "GET foo", "r3");<br>
    ...<br>
    <br>
    those structures would not be freed from memory.<br>
    <br>
    In my opinion if a user creates a lot of different replies, it
    should be his responsibility to free them using e.g:<br>
    redis_free("r1")<br>
    redis_free("r2")<br>
    <br>
    Most users will not need this. I am planning exporting ndb_redis
    functions in an API, and use them heavily in another new module. <br>
    <br>
    Regards,<br>
    Vicente.<br>
    <blockquote cite="mid:4FA26C1E.5080606@gmail.com" type="cite">
      <pre wrap="">

Cheers,
Daniel
</pre>
      <br>
      <br>
      On 5/2/12 9:38 PM, Vicente Hernando wrote:
      <blockquote cite="mid:4FA18D27.2020903@systemonenoc.com"
        type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        Ops, sorry, I send a wrong patch, that one creates an API for
        ndb_redis module.<br>
        <br>
        The patch attached now is the correct one.<br>
        <br>
        Regards,<br>
        Vicente.<br>
        <br>
        <br>
        <br>
        On 05/02/2012 09:33 PM, Vicente Hernando wrote:
        <blockquote cite="mid:4FA18C10.5000206@systemonenoc.com"
          type="cite">Hello, <br>
          <br>
          looking at ndb_redis module source code I see replies are not
          freed when module is destroyed. <br>
          <br>
          Also a reply is only freed when another one with same name is
          performed. This could cause problems if an user would ask for
          <br>
          a lot of different named replies. <br>
          <br>
          IMHO freeing reply list when module is destroyed and creating
          a new redisc_free_reply function would solve this. <br>
          <br>
          <br>
          I attach a patch that compiles but not tested to show the
          idea. <br>
          <br>
          If you agree I can perform the task, I suppose
          redisc_free_reply function should also be exported in
          cmd_export_t module structure. <br>
          <br>
          <br>
          This solution would be compatible with old ndb redis module
          configuration. <br>
          <br>
          <br>
          <br>
          Regards, <br>
          Vicente. <br>
          <br>
          <br>
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <br>
          <pre wrap="">_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
        </blockquote>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
    </blockquote>
    <br>
  </body>
</html>