gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6598 - in GNUnet/src: applications/bootstrap_http applicat


From: gnunet
Subject: [GNUnet-SVN] r6598 - in GNUnet/src: applications/bootstrap_http applications/fs/ecrs applications/fs/fsui applications/fs/tools include util/network
Date: Sat, 22 Mar 2008 01:01:19 -0600 (MDT)

Author: grothoff
Date: 2008-03-22 01:01:18 -0600 (Sat, 22 Mar 2008)
New Revision: 6598

Modified:
   GNUnet/src/applications/bootstrap_http/http.c
   GNUnet/src/applications/fs/ecrs/download.c
   GNUnet/src/applications/fs/ecrs/ecrstest.c
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/tools/gnunet-download.c
   GNUnet/src/include/gnunet_chat_lib.h
   GNUnet/src/util/network/dns.c
Log:
format

Modified: GNUnet/src/applications/bootstrap_http/http.c
===================================================================
--- GNUnet/src/applications/bootstrap_http/http.c       2008-03-22 07:00:39 UTC 
(rev 6597)
+++ GNUnet/src/applications/bootstrap_http/http.c       2008-03-22 07:01:18 UTC 
(rev 6598)
@@ -303,13 +303,12 @@
       tv.tv_usec = 1000;
       sret = SELECT (max + 1, &rs, &ws, &es, &tv);
       if (sret == -1)
-       {
+        {
           GNUNET_GE_LOG_STRERROR (ectx,
-                                 GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER |
-                                 GNUNET_GE_BULK,
-                                 "select");
-         goto cleanup;
-       }
+                                  GNUNET_GE_ERROR | GNUNET_GE_ADMIN |
+                                  GNUNET_GE_USER | GNUNET_GE_BULK, "select");
+          goto cleanup;
+        }
       if (GNUNET_YES != termTest (targ))
         break;
       do

Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c  2008-03-22 07:00:39 UTC (rev 
6597)
+++ GNUnet/src/applications/fs/ecrs/download.c  2008-03-22 07:01:18 UTC (rev 
6598)
@@ -250,8 +250,7 @@
                  unsigned int level,
                  unsigned long long pos, void *buf, unsigned int len)
 {
-  if ( (level > 0) ||
-       (self->handle == -1) )
+  if ((level > 0) || (self->handle == -1))
     return GNUNET_SYSERR;
   LSEEK (self->handle, pos, SEEK_SET);
   return READ (self->handle, buf, len);
@@ -282,9 +281,8 @@
   ret = WRITE (self->handle, buf, len);
   if (ret != len)
     GNUNET_GE_LOG_STRERROR_FILE (self->ectx,
-                                GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_USER,
-                                "write",
-                                self->filename);
+                                 GNUNET_GE_ERROR | GNUNET_GE_BULK |
+                                 GNUNET_GE_USER, "write", self->filename);
   return ret;
 }
 
@@ -348,7 +346,7 @@
   else
     node->next->prev = node->prev;
   GNUNET_free (node);
-  if (rm->head == NULL) 
+  if (rm->head == NULL)
     GNUNET_thread_stop_sleep (rm->main);
 }
 
@@ -402,9 +400,8 @@
  * Notify client about progress.
  */
 static void
-notify_client_about_progress (const struct Node *node, 
-                             const char *data,
-                              unsigned int size)
+notify_client_about_progress (const struct Node *node,
+                              const char *data, unsigned int size)
 {
   struct GNUNET_ECRS_DownloadContext *rm = node->ctx;
   GNUNET_CronTime eta;
@@ -432,8 +429,7 @@
  * @param size size of data
  */
 static void iblock_download_children (const struct Node *node,
-                                      const char *data,
-                                     unsigned int size);
+                                      const char *data, unsigned int size);
 
 /**
  * Check if self block is already present on the drive.  If the block
@@ -490,9 +486,8 @@
  * @param node the node that should be downloaded
  */
 static void
-iblock_download_children (const struct Node *node, 
-                         const char *data, 
-                         unsigned int size)
+iblock_download_children (const struct Node *node,
+                          const char *data, unsigned int size)
 {
   struct GNUNET_GE_Context *ectx = node->ctx->ectx;
   int i;
@@ -604,8 +599,9 @@
     }
   size -= sizeof (DBlock);
   data = GNUNET_malloc (size);
-  if (GNUNET_SYSERR == decrypt_content ((const char *) &((const DBlock *) & 
reply[1])[1],
-                                        size, &node->chk.key, data))
+  if (GNUNET_SYSERR ==
+      decrypt_content ((const char *) &((const DBlock *) &reply[1])[1], size,
+                       &node->chk.key, data))
     GNUNET_GE_ASSERT (ectx, 0);
   GNUNET_hash (data, size, &hc);
   if (0 != memcmp (&hc, &node->chk.key, sizeof (GNUNET_HashCode)))
@@ -750,11 +746,12 @@
   rm->dpcbClosure = dpcbClosure;
   rm->main = GNUNET_thread_get_self ();
   rm->total = GNUNET_ntohll (uri->data.fi.file_length);
-  rm->filename = filename != NULL ? get_real_download_filename (ectx, 
filename) : NULL;
+  rm->filename =
+    filename != NULL ? get_real_download_filename (ectx, filename) : NULL;
 
-  if ( (rm->filename != NULL) &&
-       (GNUNET_SYSERR ==
-       GNUNET_disk_directory_create_for_file (ectx, rm->filename)) )
+  if ((rm->filename != NULL) &&
+      (GNUNET_SYSERR ==
+       GNUNET_disk_directory_create_for_file (ectx, rm->filename)))
     {
       free_request_manager (rm);
       return NULL;
@@ -762,25 +759,26 @@
   if (0 == rm->total)
     {
       if (rm->filename != NULL)
-       {
-         ret = GNUNET_disk_file_open (ectx,
-                                      rm->filename,
-                                      O_CREAT | O_WRONLY | O_TRUNC,
-                                      S_IRUSR | S_IWUSR);
-         if (ret == -1)
-           {
-             free_request_manager (rm);
-             return NULL;
-           }
-         CLOSE (ret);
-       }
+        {
+          ret = GNUNET_disk_file_open (ectx,
+                                       rm->filename,
+                                       O_CREAT | O_WRONLY | O_TRUNC,
+                                       S_IRUSR | S_IWUSR);
+          if (ret == -1)
+            {
+              free_request_manager (rm);
+              return NULL;
+            }
+          CLOSE (ret);
+        }
       dpcb (0, 0, rm->startTime, 0, NULL, 0, dpcbClosure);
       free_request_manager (rm);
       return NULL;
     }
   rm->treedepth = GNUNET_ECRS_compute_depth (rm->total);
-  if ( (NULL != rm->filename) &&
-       ((0 == STAT (rm->filename, &buf)) && ((size_t) buf.st_size > 
rm->total)) )
+  if ((NULL != rm->filename) &&
+      ((0 == STAT (rm->filename, &buf))
+       && ((size_t) buf.st_size > rm->total)))
     {
       /* if exists and oversized, truncate */
       if (truncate (rm->filename, rm->total) != 0)
@@ -802,14 +800,14 @@
   if (rm->filename != NULL)
     {
       rm->handle = GNUNET_disk_file_open (ectx,
-                                         rm->filename,
-                                         O_CREAT | O_RDWR,
-                                         S_IRUSR | S_IWUSR);
-      if (rm->handle < 0) 
-       {
-         free_request_manager (rm);
-         return NULL;
-       }
+                                          rm->filename,
+                                          O_CREAT | O_RDWR,
+                                          S_IRUSR | S_IWUSR);
+      if (rm->handle < 0)
+        {
+          free_request_manager (rm);
+          return NULL;
+        }
     }
   else
     rm->handle = -1;
@@ -841,12 +839,12 @@
 {
   int ret;
 
-  GNUNET_mutex_lock(rm->lock);
+  GNUNET_mutex_lock (rm->lock);
   ret = rm->abortFlag;
-  GNUNET_mutex_unlock(rm->lock);
+  GNUNET_mutex_unlock (rm->lock);
   free_request_manager (rm);
   if (ret == GNUNET_NO)
-    ret = GNUNET_OK; /* normal termination */
+    ret = GNUNET_OK;            /* normal termination */
   return ret;
 }
 
@@ -900,8 +898,7 @@
     return GNUNET_SYSERR;
   while ((GNUNET_OK == tt (ttClosure)) &&
          (GNUNET_YES != GNUNET_shutdown_test ()) &&
-         (rm->abortFlag == GNUNET_NO) && 
-         (rm->head != NULL))
+         (rm->abortFlag == GNUNET_NO) && (rm->head != NULL))
     GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);
   return GNUNET_ECRS_file_download_partial_stop (rm);
 }

Modified: GNUnet/src/applications/fs/ecrs/ecrstest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrstest.c  2008-03-22 07:00:39 UTC (rev 
6597)
+++ GNUnet/src/applications/fs/ecrs/ecrstest.c  2008-03-22 07:01:18 UTC (rev 
6598)
@@ -201,12 +201,12 @@
         GNUNET_hash (&buf[i], 42,
                      (GNUNET_HashCode *) & buf[i + sizeof (GNUNET_HashCode)]);
       if (size != READ (fd, in, size))
-       {
-         GNUNET_GE_BREAK(NULL, 0);
-         ret = GNUNET_SYSERR;
-       }
+        {
+          GNUNET_GE_BREAK (NULL, 0);
+          ret = GNUNET_SYSERR;
+        }
       else if (0 == memcmp (buf, in, size))
-       ret = GNUNET_OK;
+        ret = GNUNET_OK;
       GNUNET_free (buf);
       GNUNET_free (in);
       CLOSE (fd);

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2008-03-22 07:00:39 UTC (rev 
6597)
+++ GNUnet/src/applications/fs/fsui/download.c  2008-03-22 07:01:18 UTC (rev 
6598)
@@ -591,11 +591,10 @@
     {
       dl->state = GNUNET_FSUI_ABORTED_JOINED;
     }
-  if (0 != UNLINK(dl->filename))
-    GNUNET_GE_LOG_STRERROR_FILE(dl->ctx->ectx,
-                               GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_BULK,
-                               "unlink",
-                               dl->filename);
+  if (0 != UNLINK (dl->filename))
+    GNUNET_GE_LOG_STRERROR_FILE (dl->ctx->ectx,
+                                 GNUNET_GE_WARNING | GNUNET_GE_USER |
+                                 GNUNET_GE_BULK, "unlink", dl->filename);
   return GNUNET_OK;
 }
 

Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c  2008-03-22 07:00:39 UTC 
(rev 6597)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c  2008-03-22 07:01:18 UTC 
(rev 6598)
@@ -392,9 +392,8 @@
   GNUNET_FSUI_stop (ctx);
   GNUNET_mutex_destroy (lock);
 
-  if ( (errorCode == EC_COMPLETED) && 
-       (dl != NULL) && 
-       (try_rename == GNUNET_YES) )
+  if ((errorCode == EC_COMPLETED) &&
+      (dl != NULL) && (try_rename == GNUNET_YES))
     {
       char *newname = GNUNET_ECRS_suggest_better_filename (ectx,
                                                            filename);

Modified: GNUnet/src/include/gnunet_chat_lib.h
===================================================================
--- GNUnet/src/include/gnunet_chat_lib.h        2008-03-22 07:00:39 UTC (rev 
6597)
+++ GNUnet/src/include/gnunet_chat_lib.h        2008-03-22 07:01:18 UTC (rev 
6598)
@@ -129,12 +129,12 @@
                                             GNUNET_CHAT_MSG_OPTIONS options);
 
 typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls,
-                                              const char *nick,
-                                              GNUNET_CronTime timestamp);
+                                               const char *nick,
+                                               GNUNET_CronTime timestamp);
 
 typedef int (*GNUNET_CHAT_MemberRemoveCallback) (void *cls,
-                                              const char *nick,
-                                              GNUNET_CronTime timestamp);
+                                                 const char *nick,
+                                                 GNUNET_CronTime timestamp);
 /**
  * Join a chat room.
  *
@@ -157,10 +157,12 @@
                                                 const char *memberInfo,
                                                 GNUNET_CHAT_MessageCallback
                                                 callback, void *cls,
-                                                GNUNET_CHAT_MemberListCallback 
memberCallback,
+                                                GNUNET_CHAT_MemberListCallback
+                                                memberCallback,
                                                 void *membercls,
-                                                                               
                                                
GNUNET_CHAT_MemberRemoveCallback removeCallback,
-                                                                               
                                                void *removecls);
+                                                
GNUNET_CHAT_MemberRemoveCallback
+                                                removeCallback,
+                                                void *removecls);
 
 /**
  * Leave a chat room.

Modified: GNUnet/src/util/network/dns.c
===================================================================
--- GNUnet/src/util/network/dns.c       2008-03-22 07:00:39 UTC (rev 6597)
+++ GNUnet/src/util/network/dns.c       2008-03-22 07:01:18 UTC (rev 6598)
@@ -505,7 +505,7 @@
     ret = gethostbyname_resolve (ectx, hostname, sa, socklen);
 #endif
 #if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME2) && 
!defined(HAVE_GETHOSTBYNAME)
-  #error No resolver function available
+#error No resolver function available
 #endif
   GNUNET_mutex_unlock (lock);
   if (ret == GNUNET_NO)





reply via email to

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