gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r341 - in branches/GNUnet06: . src/applications/afs/esed2 s


From: grothoff
Subject: [GNUnet-SVN] r341 - in branches/GNUnet06: . src/applications/afs/esed2 src/applications/afs/gtkui
Date: Sun, 27 Feb 2005 16:24:11 -0800 (PST)

Author: grothoff
Date: 2005-02-27 16:24:10 -0800 (Sun, 27 Feb 2005)
New Revision: 341

Modified:
   branches/GNUnet06/ChangeLog
   branches/GNUnet06/src/applications/afs/esed2/block.c
   branches/GNUnet06/src/applications/afs/esed2/insertutil.c
   branches/GNUnet06/src/applications/afs/gtkui/insertprogress.c
Log:
fixing mantis 839

Modified: branches/GNUnet06/ChangeLog
===================================================================
--- branches/GNUnet06/ChangeLog 2005-02-27 23:42:08 UTC (rev 340)
+++ branches/GNUnet06/ChangeLog 2005-02-28 00:24:10 UTC (rev 341)
@@ -1,3 +1,6 @@
+Sun Feb 27 18:44:11 EST 2005
+       Fixing mantis 833.
+
 Sun Feb 27 18:15:02 EST 2005
        Fixing serious problem with LE in gnunet-insert.
 

Modified: branches/GNUnet06/src/applications/afs/esed2/block.c
===================================================================
--- branches/GNUnet06/src/applications/afs/esed2/block.c        2005-02-27 
23:42:08 UTC (rev 340)
+++ branches/GNUnet06/src/applications/afs/esed2/block.c        2005-02-28 
00:24:10 UTC (rev 341)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     (C) 2001, 2002, 2003, 2004 Christian Grothoff (and other contributing 
authors)
+     (C) 2001, 2002, 2003, 2004, 2005 Christian Grothoff (and other 
contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -25,7 +25,7 @@
  *
  * Note that the current implementation no longer uses the exact
  * scheme from the ESED paper. Extensive documentation is forthcoming,
- * for now see http://www.ovmj.org/GNUnet/encoding.php3
+ * for now see http://gnunet.org/encoding.php3
  */
 
 #include "gnunet_afs_esed2.h"
@@ -40,9 +40,8 @@
 
 #define BBBSWAP(x,y) { unsigned char ttt; ttt = (y); (y) = (x); (x) = ttt;}
 static void swap_bytes(unsigned char *ptr, int len) {
-
-  int i;
 #if __BYTE_ORDER == __BIG_ENDIAN
+  int i;
   for (i = 0; i < len; i++) {
     BBBSWAP(ptr[4*i], ptr[4*i+3]);
     BBBSWAP(ptr[4*i+2], ptr[4*i+1]);

Modified: branches/GNUnet06/src/applications/afs/esed2/insertutil.c
===================================================================
--- branches/GNUnet06/src/applications/afs/esed2/insertutil.c   2005-02-27 
23:42:08 UTC (rev 340)
+++ branches/GNUnet06/src/applications/afs/esed2/insertutil.c   2005-02-28 
00:24:10 UTC (rev 341)
@@ -358,6 +358,12 @@
     = htons(ROOT_MINOR_VERSION);
   rn->header.fileIdentifier
     = *fid;
+  if (description == NULL)
+    description = "No description supplied.";
+  if (shortFN == NULL)
+    shortFN = "No filename supplied.";
+  if (mimetype == NULL)
+    mimetype = "unknown.";
   memcpy(&rn->header.description[0],
         description,
         MIN(strlen(description)+1, MAX_DESC_LEN-1));

Modified: branches/GNUnet06/src/applications/afs/gtkui/insertprogress.c
===================================================================
--- branches/GNUnet06/src/applications/afs/gtkui/insertprogress.c       
2005-02-27 23:42:08 UTC (rev 340)
+++ branches/GNUnet06/src/applications/afs/gtkui/insertprogress.c       
2005-02-28 00:24:10 UTC (rev 341)
@@ -347,9 +347,8 @@
   gtk_widget_show(window);
 }
 
+#define MYMIN(x,y) (x < y ? x : y)
 
-
-
 /**
  * Insert a single file.
  *
@@ -374,7 +373,8 @@
   ifm.num_keywords = 0;
   memcpy(ifm.opDescription,
         ilm->opDescription,
-        sizeof(ilm->opDescription));
+        MYMIN(sizeof(ifm.opDescription),
+              strlen(ilm->opDescription)));
   ifm.indexContent = ilm->indexContent;
   ifm.progressBar = ilm->progressBar;
   ifm.progressBarWindow = ilm->progressBarWindow;
@@ -490,17 +490,31 @@
 #endif
   if (top != NULL) {
     unsigned int priority;
+    RootNode * r;
 
+    r = createRootNode(&top->header.fileIdentifier,
+                      ilm->description,
+                      ilm->fileName,
+                      GNUNET_DIRECTORY_MIME);
     priority = getConfigurationInt("GNUNET-INSERT",
                                   "CONTENT-PRIORITY");
     res = OK;
     for (i=0;i<ilm->num_keywords;i++) {
       if (SYSERR == insertRootWithKeyword(sock,
+                                         r,
+                                         ilm->keywords[i],
+                                         priority))
+       res = SYSERR;
+    }
+#if 0
+    for (i=0;i<ilm->num_keywords;i++) {
+      if (SYSERR == insertRootWithKeyword(sock,
                                          top, 
                                          ilm->keywords[i], 
                                          priority))
        res = SYSERR;
     }
+#endif
     makeRootNodeAvailable(top, DIR_CONTEXT_INSERT);
     publishToCollection(top);
   } else {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]