Mercurial > hg > nnchat
comparison main.c @ 437:8e9690a3f973
Fix parsing of LOGIN_{SUCCESS,FAILURE} packets.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 25 May 2012 20:49:09 +0300 |
parents | f8d6a720388a |
children | 70ea06294f3f |
comparison
equal
deleted
inserted
replaced
436:f8d6a720388a | 437:8e9690a3f973 |
---|---|
758 str_get_timestamp(tmpStr, sizeof(tmpStr), "%c"); | 758 str_get_timestamp(tmpStr, sizeof(tmpStr), "%c"); |
759 | 759 |
760 if (!nn_conn_buf_strcmp(conn, "FAILURE>")) | 760 if (!nn_conn_buf_strcmp(conn, "FAILURE>")) |
761 { | 761 { |
762 nn_conn_buf_strstr(conn, "</LOGIN_FAILURE>"); | 762 nn_conn_buf_strstr(conn, "</LOGIN_FAILURE>"); |
763 nn_conn_buf_strstr(conn, "</USER>"); | |
763 printMsg(NULL, "½1½Login failure½0½ - ½3½%s½0½\n", tmpStr); | 764 printMsg(NULL, "½1½Login failure½0½ - ½3½%s½0½\n", tmpStr); |
764 return -2; | 765 return -2; |
765 } | 766 } |
766 else if (!nn_conn_buf_strcmp(conn, "SUCCESS>")) | 767 else if (!nn_conn_buf_strcmp(conn, "SUCCESS>")) |
767 { | 768 { |
768 nn_conn_buf_strstr(conn, "</LOGIN_SUCCESS>"); | 769 nn_conn_buf_strstr(conn, "</LOGIN_SUCCESS>"); |
770 nn_conn_buf_strstr(conn, "</USER>"); | |
769 printMsg(NULL, "½2½Login success½0½ - ½3½%s½0½\n", tmpStr); | 771 printMsg(NULL, "½2½Login success½0½ - ½3½%s½0½\n", tmpStr); |
770 nn_conn_send_msg(conn, optUserNameEnc, "%2FRequestUserList"); | 772 nn_conn_send_msg(conn, optUserNameEnc, "%2FRequestUserList"); |
771 return 0; | 773 return 0; |
772 } | 774 } |
773 else | 775 else |