# HG changeset patch # User Matti Hamalainen # Date 1337857847 -10800 # Node ID aaadf6cea6be431c1c6e570b0628b01e89476677 # Parent 2ac24f1e241bb95e96244e6aeb0f0547cf175169 Better handling of some messages. diff -r 2ac24f1e241b -r aaadf6cea6be main.c --- a/main.c Thu May 24 13:05:31 2012 +0300 +++ b/main.c Thu May 24 14:10:47 2012 +0300 @@ -646,12 +646,15 @@ // Find start of the message name = conn->ptr; - t = nn_conn_buf_strstr(conn, ""); + t = nn_conn_buf_strstr(conn, ""); if (!t) return 1; *t = 0; - msg = conn->ptr; // Find end of the message + t = nn_conn_buf_strstr(conn, ""); + if (!t) return 2; + msg = conn->ptr; + t = nn_conn_buf_strstr(conn, ""); if (!t) return 3; *t = 0; @@ -756,11 +759,13 @@ if (!nn_conn_buf_strcmp(conn, "FAILURE>")) { + nn_conn_buf_strstr(conn, ""); printMsg(NULL, "½1½Login failure½0½ - ½3½%s½0½\n", tmpStr); return -2; } else if (!nn_conn_buf_strcmp(conn, "SUCCESS>")) { + nn_conn_buf_strstr(conn, ""); printMsg(NULL, "½2½Login success½0½ - ½3½%s½0½\n", tmpStr); nn_conn_send_msg(conn, optUserNameEnc, "%2FRequestUserList"); return 0;