aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-05-17 17:43:23 +0000
committerChristian Grothoff <christian@grothoff.org>2013-05-17 17:43:23 +0000
commit96bc116383012b44aaba5ead97e1234b27e80a88 (patch)
tree30f29ac8ca082f4fec10bf119b5b8b4a7053cd96 /src
parentbb63c3f4a8db3ab978b93cb23d721f0a8dbef44c (diff)
downloadgnunet-96bc116383012b44aaba5ead97e1234b27e80a88.tar.gz
gnunet-96bc116383012b44aaba5ead97e1234b27e80a88.zip
-indent
Diffstat (limited to 'src')
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index d586eb2b5..73be06809 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -77,15 +77,15 @@ struct HostEntry
77 */ 77 */
78struct TransmitContext 78struct TransmitContext
79{ 79{
80 /** 80 /**
81 * Server transmit context 81 * Server transmit context
82 */ 82 */
83 struct GNUNET_SERVER_TransmitContext *tc; 83 struct GNUNET_SERVER_TransmitContext *tc;
84 84
85 /** 85 /**
86 * Include friend only HELLOs GNUNET_YES or _NO 86 * Include friend only HELLOs GNUNET_YES or _NO
87 */ 87 */
88 int friend_only; 88 int friend_only;
89}; 89};
90 90
91/** 91/**
@@ -275,25 +275,26 @@ notify_all (struct HostEntry *entry)
275 275
276 msg_pub = make_info_message (entry, GNUNET_NO); 276 msg_pub = make_info_message (entry, GNUNET_NO);
277 msg_friend = make_info_message (entry, GNUNET_YES); 277 msg_friend = make_info_message (entry, GNUNET_YES);
278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Notifying all clients about peer `%s'\n", 278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
279 GNUNET_i2s(&entry->identity)); 279 "Notifying all clients about peer `%s'\n",
280 for (cur = nc_head; NULL != cur; cur = cur->next) 280 GNUNET_i2s(&entry->identity));
281 { 281 for (cur = nc_head; NULL != cur; cur = cur->next)
282 if (GNUNET_NO == cur->include_friend_only) 282 {
283 { 283 if (GNUNET_NO == cur->include_friend_only)
284 GNUNET_SERVER_notification_context_unicast (notify_list, 284 {
285 cur->client, 285 GNUNET_SERVER_notification_context_unicast (notify_list,
286 &msg_pub->header, 286 cur->client,
287 GNUNET_NO); 287 &msg_pub->header,
288 } 288 GNUNET_NO);
289 if (GNUNET_YES == cur->include_friend_only) 289 }
290 { 290 if (GNUNET_YES == cur->include_friend_only)
291 GNUNET_SERVER_notification_context_unicast (notify_list, 291 {
292 cur->client, 292 GNUNET_SERVER_notification_context_unicast (notify_list,
293 &msg_friend->header, 293 cur->client,
294 GNUNET_NO); 294 &msg_friend->header,
295 } 295 GNUNET_NO);
296 } 296 }
297 }
297 GNUNET_free (msg_pub); 298 GNUNET_free (msg_pub);
298 GNUNET_free (msg_friend); 299 GNUNET_free (msg_friend);
299} 300}
@@ -350,9 +351,9 @@ read_host_file (const char *fn, int unlink_garbage, struct ReadHostFileContext *
350 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %u bytes from `%s'\n", size_total, fn); 351 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %u bytes from `%s'\n", size_total, fn);
351 if (size_total < sizeof (struct GNUNET_MessageHeader)) 352 if (size_total < sizeof (struct GNUNET_MessageHeader))
352 { 353 {
353 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 354 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
354 _("Failed to parse HELLO in file `%s': %s\n"), 355 _("Failed to parse HELLO in file `%s': %s\n"),
355 fn, "Fail has invalid size"); 356 fn, "Fail has invalid size");
356 if ( (GNUNET_YES == unlink_garbage) && (0 != UNLINK (fn)) ) 357 if ( (GNUNET_YES == unlink_garbage) && (0 != UNLINK (fn)) )
357 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn); 358 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn);
358 return; 359 return;
@@ -366,8 +367,8 @@ read_host_file (const char *fn, int unlink_garbage, struct ReadHostFileContext *
366 if (0 == size_hello) 367 if (0 == size_hello)
367 { 368 {
368 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 369 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
369 _("Failed to parse HELLO in file `%s': %s %u \n"), 370 _("Failed to parse HELLO in file `%s': %s %u \n"),
370 fn, "HELLO is invalid and has size of ", size_hello); 371 fn, "HELLO is invalid and has size of ", size_hello);
371 if ((GNUNET_YES == unlink_garbage) && (0 != UNLINK (fn))) 372 if ((GNUNET_YES == unlink_garbage) && (0 != UNLINK (fn)))
372 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn); 373 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn);
373 return; 374 return;
@@ -644,7 +645,7 @@ cron_scan_directory_data_hosts (void *cls,
644 645
645static struct GNUNET_HELLO_Message * 646static struct GNUNET_HELLO_Message *
646update_friend_hello (const struct GNUNET_HELLO_Message *hello, 647update_friend_hello (const struct GNUNET_HELLO_Message *hello,
647 const struct GNUNET_HELLO_Message *friend_hello) 648 const struct GNUNET_HELLO_Message *friend_hello)
648{ 649{
649 struct GNUNET_HELLO_Message * res; 650 struct GNUNET_HELLO_Message * res;
650 struct GNUNET_HELLO_Message * tmp; 651 struct GNUNET_HELLO_Message * tmp;