changeset 639:02e1307e2a62

API changes in th_network module.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 04 Jul 2014 02:18:52 +0300
parents bda973fa2b3b
children 51dd01786d25
files main.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Wed Jun 25 09:33:05 2014 +0300
+++ b/main.c	Fri Jul 04 02:18:52 2014 +0300
@@ -636,7 +636,7 @@
     char *name, *msg, *t;
 
     // Find start of the message
-    name = conn->ptr;
+    name = conn->base.ptr;
     t = th_conn_buf_strstr(conn, "</USER>");
     if (!t) return 1;
     *t = 0;
@@ -644,7 +644,7 @@
     // Find end of the message
     t = th_conn_buf_strstr(conn, "<MESSAGE>");
     if (!t) return 2;
-    msg = conn->ptr;
+    msg = conn->base.ptr;
     
     t = th_conn_buf_strstr(conn, "</MESSAGE>");
     if (!t) return 3;
@@ -799,7 +799,7 @@
 
 int nnproto_parse_add_user(th_conn_t *conn)
 {
-    char *p, *s, *str = conn->ptr;
+    char *p, *s, *str = conn->base.ptr;
     nn_window_t *win;
 
     s = th_conn_buf_strstr(conn, "</ADD_USER>");
@@ -827,7 +827,7 @@
 
 int nnproto_parse_delete_user(th_conn_t *conn)
 {
-    char *p, *s, *str = conn->ptr;
+    char *p, *s, *str = conn->base.ptr;
     nn_window_t *win;
 
     s = th_conn_buf_strstr(conn, "</DELETE_USER>");
@@ -910,7 +910,7 @@
 
     if (optDebug)
     {
-        printMsg(NULL, "Unknown protocmd: \"%s\"\n", conn->ptr);
+        printMsg(NULL, "Unknown protocmd: \"%s\"\n", conn->base.ptr);
         return 0;
     }
     else
@@ -2316,8 +2316,8 @@
         cres = th_conn_pull(conn);
         if (cres == TH_CONN_DATA_AVAIL)
         {
-            while (conn->ptr < conn->in_ptr &&
-                   *(conn->in_ptr - 1) == 0 &&
+            while (conn->base.ptr < conn->base.in_ptr &&
+                   *(conn->base.in_ptr - 1) == 0 &&
                    retries > 0 && !editState.isError)
             {
 //                th_conn_dump_buffer(stderr, conn);
@@ -2334,8 +2334,8 @@
                         goto packet_retry;
 
                     // Couldn't handle the message for some reason
-                    printMsg(currWin, "Could not handle: %s\n", conn->ptr);
-                    th_conn_buf_skip(conn, strlen(conn->ptr) + 1);
+                    printMsg(currWin, "Could not handle: %s\n", conn->base.ptr);
+                    th_conn_buf_skip(conn, strlen(conn->base.ptr) + 1);
                 }
                 else
                     editState.isError = TRUE;