/[imapfilter]/imapfilter/response.c
ViewVC logotype

Diff of /imapfilter/response.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by lefcha, Thu Dec 5 07:33:50 2002 UTC revision 1.31 by lefcha, Fri Feb 21 18:43:01 2003 UTC
# Line 15  Line 15 
15    
16  extern int sockpri;  extern int sockpri;
17  extern unsigned int capabilities;  extern unsigned int capabilities;
18    extern char authmech[AUTH_MECH_LEN];
19  extern jmp_buf acctloop;  extern jmp_buf acctloop;
20    
21  static char *vbuf = NULL;       /* Virtual buffer. */  static char *vbuf = NULL;       /* Virtual buffer. */
# Line 29  void receive_response(int *sock, char *b Line 30  void receive_response(int *sock, char *b
30      socket_read(sock, buf);      socket_read(sock, buf);
31    
32  #ifdef DEBUG  #ifdef DEBUG
33      printf("\n%s\n", buf);      fprintf(stderr, "\n%s\n", buf);
34  #endif  #endif
35    
36  }  }
# Line 124  int capability_response(int *sock, unsig Line 125  int capability_response(int *sock, unsig
125      if (strcasestr(vbuf, "NAMESPACE"))      if (strcasestr(vbuf, "NAMESPACE"))
126          capabilities |= CAPABILITY_NAMESPACE;          capabilities |= CAPABILITY_NAMESPACE;
127    
128        auth_mechanisms();
129    
130      return analyze_response(buf);      return analyze_response(buf);
131  }  }
132    
133    
134  /*  /*
135     * Create the list of available authentication mechanisms.
136     */
137    void auth_mechanisms(void)
138    {
139        int len;
140        char *c, *cp, *tok;
141        
142        *authmech = 0;
143        
144        c = cp = xstrdup(vbuf);
145        
146        tok = strtok_r(c, " \r\n", &c);
147        while(tok) {
148            if (strcasestr(tok, "AUTH=")) {
149                strncat(authmech, tok + 5, AUTH_MECH_LEN - strlen(authmech) - 2);
150                len = strlen(authmech);
151                *(authmech + len) = ' ';
152                *(authmech + len + 1) = 0;
153            }
154            tok = strtok_r(NULL, " \r\n", &c);
155        }
156        if ((len = strlen(authmech)))
157            *(authmech + strlen(authmech) - 1) = 0;
158    
159        xfree(cp);
160    
161    #ifdef DEBUG
162        fprintf(stderr, "debug: authentication mechanisms: '%s'\n", authmech);
163    #endif
164        
165    }
166    
167    
168    /*
169   * Process the data that server sent due to IMAP NAMESPACE client request.   * Process the data that server sent due to IMAP NAMESPACE client request.
170   */   */
171  int namespace_response(int *sock, unsigned int tag, namesp_t * nsp)  int namespace_response(int *sock, unsigned int tag, namesp_t * nsp)
# Line 156  int namespace_response(int *sock, unsign Line 193  int namespace_response(int *sock, unsign
193          }          }
194      }      }
195  #ifdef DEBUG  #ifdef DEBUG
196      printf("debug: namespace: '%s' '%c'\n", nsp->prefix, nsp->delim);      fprintf(stderr, "debug: namespace: '%s' '%c'\n", nsp->prefix, nsp->delim);
197  #endif  #endif
198      return analyze_response(buf);      return analyze_response(buf);
199  }  }

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26