[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 20 Mar 2022 04:55:26 -0400 (EDT) |
branch: master
commit 46a1f889c2858198b0d1db641361787dc65fcbd5
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 22 18:57:38 2019 +0100
finish loading one index before trying to load the next
---
js/infog/extension.c | 5 +++++
js/infog/main.c | 13 +++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/js/infog/extension.c b/js/infog/extension.c
index ff301f6239..50f6b64bbc 100644
--- a/js/infog/extension.c
+++ b/js/infog/extension.c
@@ -287,6 +287,11 @@ send_index (WebKitDOMHTMLCollection *links, gulong
num_links)
g_string_append (s, "\n");
}
}
+
+ /* Mark end of index. */
+ g_string_append (s, "\n");
+ g_string_append (s, "\n");
+
packetize ("index", s);
g_string_free (s, TRUE);
diff --git a/js/infog/main.c b/js/infog/main.c
index e3aa7106f5..3d483babff 100644
--- a/js/infog/main.c
+++ b/js/infog/main.c
@@ -139,7 +139,8 @@ clear_completions (void)
gtk_list_store_clear (index_store);
}
-void
+/* Save index entries. Return 1 if it is the end of this index. */
+int
save_completions (char *p)
{
GtkTreeIter iter;
@@ -164,10 +165,13 @@ save_completions (char *p)
if (!q2)
{
debug (1, "incomplete packet\n");
- return;
+ return 1;
}
*q2++ = 0;
+ if (!*p && !*q)
+ return 1; /* end of index */
+
// debug (2, "add index entry %s\n", p);
gtk_list_store_append (index_store, &iter);
@@ -177,6 +181,7 @@ save_completions (char *p)
p = q2;
}
+ return 0;
}
static char *current_manual;
@@ -463,8 +468,8 @@ socket_cb (GSocket *socket,
{
p++; /* Set p to the first byte after index line. */
- save_completions (p);
- continue_to_load_index_nodes ();
+ if (save_completions (p))
+ continue_to_load_index_nodes ();
}
else if (!strcmp (buffer, "new-manual"))
{
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20