partial logs suggested fix

eneam
2005-11-16
2013-03-12
  • eneam

    eneam - 2005-11-16

    After some time i started suspecting that some parts of chats were not logged.
    I investigated a bit and saw the following in the log:
    Unable to parse IRO
    Unable to parse JOI
    and some
    No known partipants in SB
    So I edited msn_handlers.cpp
    and put
    if (nt >= 3)
    instead of
    if (nt == 3)
    in handler_msn_joi
    and
    if (nt >= 6)
    instead of
    if (nt == 6)
    in handler_msn_iro
    in this way you get participants to correctly join SB and are correctly logged.

     
    • Carlos Fernandez

      I'm being a bit conservative for the time being accepting those unexpected parameters to commands because I don't know what they are.

      Anyway next version will just ignore them in all commands, and see how it turns out.

      Thanks :-)

       
    • eneam

      eneam - 2005-11-18

      Strangely I still get few
      No known partipants in SB owned

      I get a full correct log on 1 side and first msg of other side gets eaten up...

       
    • Segalla

      Segalla - 2005-11-29

      I made the changes you suggested and I say it is logging 99% of all chats now.

      But the daemon dies after some time or I get a kernel panic. If i turn off the imsniff my server just keep working for more than a week (or longer, i didn't have time to test) but if I turn on imsniff i get a daily kernel panic.

      Segalla

       
    • eneam

      eneam - 2005-11-29

      I also get some core dumps on the daemon.
      But the program has nothing to do with your kernel panics.
      It just probably stimulates something that's wrong with your server.
      Did you check your memory? (just guessing)

       
      • Segalla

        Segalla - 2005-11-29

        I'm pretty sure it´s a memory problem but I didn't have the time to look deeper at it, I hope I find a solution till next week.

         
    • Carlos Fernandez

      Crashes are what I'm more interested in. If they are still happening, PLEASE try to run the program under valgrind with a decent trace level. Most of the times the output will be enough to quickly find out what the problem is.

      Also, try to keep the pcap library updated. It is also a possible cause of crashes (although unlikely, since it's widely used).

       
    • eneam

      eneam - 2005-12-05

      havent had anymore core dumps. here are the diffs i applied:
      util.diff
      62,82d61
      <     if (conn == NULL || conn->owner == NULL)
      <     {
      <         log_debug (0, "No switchboard or unknown owner, can't log");
      <         return -1;
      <     }
      <     if (conn->log_full_path==NULL && chatlogdir[0]!=0)
      <     {
      <         if (conn->users==NULL || conn->users[0]==NULL)
      <         {
      <             log_debug (0, "No known partipants in SB owned by %s, can't log", conn->owner);
      <             return -1;
      <         }
      <         size_t l=strlen (chatlogdir)+1+strlen ((char *) conn->owner)+1+
      <             strlen ((char *) conn->users[0])+5;
      <         conn->log_full_path=(char *) malloc (l);
      <         if (conn->log_full_path==NULL)
      <             return -1;
      <         sprintf (conn->log_full_path,"%s/%s/%s.log",chatlogdir,conn->owner,conn->users[0]);
      <         log_debug (0, "Set SB log name to: %s",conn->log_full_path);
      <         firsttime = 1;
      <     }
      99c78,101
      <     if (conn->log_full_path!=NULL)
      ---
      >     if (conn == NULL || conn->owner == NULL)
      >     {
      >         log_debug (0, "No switchboard or unknown owner, can't log");
      >         log_debug (0, "SB event: %s", result);
      >         free(result);
      >         return -1;
      >     }
      >     if (conn->log_full_path==NULL && chatlogdir[0]!=0)
      >     {
      >         if (conn->users==NULL || conn->users[0]==NULL)
      >         {
      >             log_debug (0, "No known partipants in SB owned by %s, can't log", conn->owner);
      >         } else {
      >             size_t l=strlen (chatlogdir)+1+strlen ((char *) conn->owner)+1+
      >                 strlen ((char *) conn->users[0])+5;
      >             conn->log_full_path=(char *) malloc (l);
      >             if (conn->log_full_path!=NULL) {
      >                 sprintf (conn->log_full_path,"%s/%s/%s.log",chatlogdir,conn->owner,conn->users[0]);
      >                 log_debug (0, "Set SB log name to: %s",conn->log_full_path);
      >             }
      >             firsttime = 1;
      >         }
      >     }
      >     if (conn->log_full_path!=NULL && conn->log_full_path[0] != 0)
      250c252
      <         else
      ---
      >         else if( *result )
      325d326
      <         int must_free=0;       
      356a358,359
      >             char *buff = (char*)calloc(length+1, 1);
      >             memcpy(buff, source, length);
      358c361,362
      <             log_debug (5, "get_new_line_malloc: Source was: %s\n",source); // TODO: Fix not null-terminated!
      ---
      >             log_debug (5, "get_new_line_malloc: Source was (length %d)= %s\n",length, buff); // TODO: Fix not null-terminated!
      >             free(buff);

      msn_handlers.diff
      135c135
      <                 }
      ---
      >                 } else
      162c162,165
      <                 }       
      ---
      >                 }
      >                 else {
      >                     log_debug (1, "Unknown Word: %s | %s", header_tk[0], header_tk[1]);
      >                 }
      205c208
      <                     log_debug (5, "%d - %s:%s", block_type, line_tokens[1], line_tokens[2]);
      ---
      >                     log_debug (1, "Unknown block type: %d - %s:%s", block_type, line_tokens[1], line_tokens[2]);
      402c405
      <     if (nt == 6)
      ---
      >     if (nt >= 6)
      441c444
      <     if (nt == 3)
      ---
      >     if (nt >= 3)
      772c775
      <         log_contact(nick,line_tokens[1]+2);
      ---
      >         log_contact(nick,line_tokens[1]);

       
    • Carlos Fernandez

      I'm gonna spend part of tomorrow's looking into your diff and getting up to date, so 0.05 will be ready by this weekend (hopefully).

      If you have found the reason for the random and hard to track crash I've been after for some time, I'll definitely buy you a beer if you ever come to Spain :-)

       
    • Segalla

      Segalla - 2006-01-18

      Hi,

      I have the following situation now:

      1 - On 4 networks it works fine
      2 - On 2 networks it doesn't log anything
      3 - On 1 network it logs twice the messages sent from someone inside the network and 3 times the messages sent from the internet.

      Carlos, do you have any ideia when version 0.05 will be released?

      Has anybody seen some like that?

      Segalla

       
    • Carlos Fernandez

      I'll release 0.05 this weekend, it's been on my HD for a few weeks now...I've been lazy, that's all.

      Segalla, about your things...

      2 - Is people on that network using the native MSN protocol? If they are using HTTP connections, it's normal that they aren't logged.
      3 - This can happen if packets travel through several interfaces, for example. I can't think of any other reason.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks