From: Andy Spencer Date: Fri, 29 May 2009 06:02:49 +0000 (+0000) Subject: debugging X-Git-Tag: v0.1~4 X-Git-Url: http://pileus.org/git/?p=grits;a=commitdiff_plain;h=dc6bbd8a388179d64fdc20bdf18056b0bd9267c4 debugging --- diff --git a/TODO b/TODO index bad23e9..98e571d 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,6 @@ Road plan * Pre-load textures and polys in OpenGL 0.x - Misc - * Resume downloads (back to CURL/Soup) * Configuration file * Default site * Keybindings? diff --git a/configure.ac b/configure.ac index d894664..bd6a539 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ PKG_PROG_PKG_CONFIG GTK_DOC_CHECK(1.9) # Check for required packages -PKG_CHECK_MODULES(SOUP, libsoup-2.4) +PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.26) PKG_CHECK_MODULES(GLIB, gio-2.0 gmodule-export-2.0 gobject-2.0 gthread-2.0) PKG_CHECK_MODULES(GTK, gtk+-2.0 gtkglext-1.0) diff --git a/src/data.c b/src/data.c index 9878bdc..4b97516 100644 --- a/src/data.c +++ b/src/data.c @@ -36,7 +36,7 @@ static FILE *fopen_p(const gchar *path, const gchar *mode) { gchar *parent = g_path_get_dirname(path); if (!g_file_test(parent, G_FILE_TEST_EXISTS)) - g_mkdir_with_parents(path, 0755); + g_mkdir_with_parents(parent, 0755); g_free(parent); return fopen(path, mode); } @@ -45,10 +45,13 @@ static void cache_file_cb(SoupSession *session, SoupMessage *message, gpointer _ { cache_file_end_t *info = _info; gchar *uri = soup_uri_to_string(soup_message_get_uri(message), FALSE); - g_debug("data: cache_file_cb ([%s]->[%s])", uri, info->local); + g_debug("data: cache_file_cb"); if (!SOUP_STATUS_IS_SUCCESSFUL(message->status_code)) { - g_warning("data: error copying file ([%s]->[%s])", uri, info->local); + g_warning("data: cache_file_cb - error copying file, status=%d\n" + "\tsrc=%s\n" + "\tdst=%s", + message->status_code, uri, info->local); } else { gint wrote = fwrite(message->response_body->data, 1, message->response_body->length, info->fp); diff --git a/src/wsr88ddec.c b/src/wsr88ddec.c index 107f279..12adaa1 100644 --- a/src/wsr88ddec.c +++ b/src/wsr88ddec.c @@ -89,13 +89,14 @@ int main(int argc, char **argv) //debug("reading body\n"); while ((st = fread(&size, 1, 4, input))) { + //debug("size=%08x\n", size); //debug("read %u bytes\n", st); //fwrite(&size, 1, 4, output); // DEBUG size = abs(ntohl(size)); if (size < 0) return 0; //debug("size = %x\n", size); - if (size > 10*1024*1024) + if (size > 20*1024*1024) err(1, "sanity check failed, buf is to big: %d", size); buf = realloc(buf, size); fread (buf, 1, size, input);