From: Andrei N. B. <and...@ra...> - 2006-08-03 10:10:46
|
Hello. You wrote: > Here the part of the patch that looks strange to me : > << > diff -rwB ./libetpan/src/low-level/pop3/mailpop3.c ./libetpan-0.46/src/ > low-level > /pop3/mailpop3.c > 1046,1047c1046 > < if ((strncmp(response, RESP_OK_STR, strlen(RESP_OK_STR)) != 0) && > < (strncmp(response, RESP_AUTH_CONT_STR, strlen( > RESP_AUTH_CONT_STR)) == > 0)) { > --- >> if (strncmp(response, RESP_AUTH_CONT_STR, >> strlen(RESP_AUTH_CONT_STR)) == 0) >>> > Here the code where it applies : > << > if (strncmp(response, RESP_AUTH_CONT_STR, strlen(RESP_AUTH_CONT_STR)) > == 0) { > if (response[strlen(RESP_AUTH_CONT_STR)] == ' ') > msg = response + strlen(RESP_AUTH_CONT_STR) + 1; > else > msg = response + strlen(RESP_AUTH_CONT_STR); > if (mmap_string_assign(f->pop3_response_buffer, msg)) > f->pop3_response = f->pop3_response_buffer->str; > else > f->pop3_response = NULL; > return RESPONSE_AUTH_CONT; > } > else { > return parse_response(f, response); > } >>> > call to parse_response() will handle the OK response. > and (strncmp(response, RESP_OK_STR, strlen(RESP_OK_STR)) != 0) will be > false in the > case (strncmp(response, RESP_AUTH_CONT_STR, strlen(RESP_AUTH_CONT_STR)) > == 0) is true. > I don't see the need of adding a second condition. If response string looks like "+OK asdf..." condition (strncmp(response, RESP_AUTH_CONT_STR, strlen(RESP_AUTH_CONT_STR)) == 0) is true but this response is RESPONSE_OK not is RESPONSE_AUTH_CONT. Addition condition is needed to control this case. If response string looks like "+ asdf..." both conditions ((strncmp(response, RESP_OK_STR, strlen(RESP_OK_STR)) != 0) and (strncmp(response, RESP_AUTH_CONT_STR, strlen(RESP_AUTH_CONT_STR)) == 0)) are true. And only in this case response should be RESPONSE_AUTH_CONT. Without addition condition parse_auth function return RESPONSE_AUTH_CONT (if response looks like "+OK ...") and next authentication doesn't finish correctly. Regarding SSL Certificates support I will report to you later. -- Best regards, Andrei Balabohin mailto:aba...@od... |