jer         14/08/20 08:02:09

  Added:                pktstat-1.8.5-smtp_line.patch
  Log:
  Remove debug function (bug #458898).
  
  (Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key 
A792A613)

Revision  Changes    Path
1.1                  net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pktstat/files/pktstat-1.8.5-smtp_line.patch?rev=1.1&content-type=text/plain

Index: pktstat-1.8.5-smtp_line.patch
===================================================================
--- a/tcp_smtp.c
+++ b/tcp_smtp.c
@@ -141,84 +141,6 @@
        *t = 0;
 }
 
-static void
-smtp_line(f, line)
-       struct flow *f;
-       const char *line;
-{
-       struct smtp_state *state;
-       const char *s;
-       int addr_changed = 0;
-FILE*log;
-
-       state = (struct smtp_state *)f->udata;
-
-if ((log = fopen("/tmp/smtp.log", "a")))
-   fprintf(log, "smpt_line [%s]\n", line);
-
-       if (state->in_data) {
-           if (strcmp(line, ".") == 0) {
-               state->in_data = 0;
-               state->from_addr[0] = 0;
-               state->to_addr[0] = 0;
-           } else if (state->in_header) {
-               if (!*line)
-                   state->in_header = 0;
-#if 0
-               /* Tag the Subject: line inside DATA */
-               else if ((line[0] == 'S' || line[0] == 's') &&
-                        (line[1] == 'U' || line[1] == 'u') &&
-                        (line[2] == 'B' || line[2] == 'b') &&
-                        (line[3] == 'J' || line[3] == 'j') &&
-                        (line[4] == 'E' || line[4] == 'e') &&
-                        (line[5] == 'C' || line[5] == 'c') &&
-                        (line[6] == 'T' || line[6] == 't') &&
-                        line[7] == ':')
-                   snprintf(f->desc, sizeof f->desc, "%s", line);
-#endif
-           }
-       } else {
-           /* Normalize the command line */
-           normalize_line(line);
-if (log)fprintf(log, "normalized to [%s]\n", line);
-           if ((s = strip_prefix(line, "MAIL FROM:"))) {
-               snprintf(state->from_addr, sizeof state->from_addr, "%s", s);
-               normalize_addr(state->from_addr);
-               addr_changed = 1;
-if (log)fprintf(log, "from_addr = [%s]\n", state->from_addr);
-           }
-           else if ((s = strip_prefix(line, "RCPT TO:"))) {
-               snprintf(state->to_addr, sizeof state->to_addr, "%s", s);
-               normalize_addr(state->to_addr);
-               addr_changed = 1;
-if (log)fprintf(log, "to_addr = [%s]\n", state->to_addr);
-           }
-           else if (strcmp(line, "DATA") == 0) {
-               state->in_data = 1;
-               state->in_header = 1;
-           }
-           else if (strcmp(line, "STARTTLS") == 0) {
-               state->state = sENCRYPTED;
-               snprintf(f->desc, sizeof f->desc, "STARTTLS");
-           }
-
-           if ((addr_changed || 
-                strcmp(line, "QUIT") == 0 ||
-                strcmp(line, "DATA") == 0) && 
-               (*state->from_addr && *state->to_addr)) 
-           {
-               snprintf(f->desc, sizeof f->desc, "%s -> %s", 
-                   state->from_addr, state->to_addr);
-           } else {
-               if (strcmp(line, "QUIT") != 0)
-                   snprintf(f->desc, sizeof f->desc, "%s", line);
-           }
-if (log)fprintf(log, "set desc to: [%s]\n", f->desc);
-       }
-
-if (log)fclose(log);
-}
-
 /*
  * Look for simple SMTP (RFC 2822) commands.
  */
@@ -270,7 +192,6 @@
            case sEXPECT_LF:
                if (*d == LF) {
                    state->line[state->line_len] = 0;
-                   smtp_line(f, state->line);
                    state->line_len = 0;
                    state->state = sLINE;
                } else if (*d == CR) {




Reply via email to