aboutsummaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/conversation.h8
-rw-r--r--src/conversation/conversation_api.c2
-rw-r--r--src/conversation/gnunet-service-conversation.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h
index aaeed1df3..1bd358e78 100644
--- a/src/conversation/conversation.h
+++ b/src/conversation/conversation.h
@@ -40,6 +40,14 @@ extern "C"
40 40
41 41
42/** 42/**
43 * Highest bit in a 32-bit unsigned integer,
44 * bit set if we are making an outgoing call,
45 * bit unset for local lines.
46 */
47#define HIGH_BIT ((uint32_t) (1LL << 31))
48
49
50/**
43 * Message to transmit the audio (between client and helpers). 51 * Message to transmit the audio (between client and helpers).
44 */ 52 */
45struct AudioMessage 53struct AudioMessage
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index 730cf1c70..e3bab295e 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -609,7 +609,7 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
609 "LINE"); 609 "LINE");
610 return NULL; 610 return NULL;
611 } 611 }
612 if (line >= (1 << 31)) 612 if (line >= HIGH_BIT)
613 { 613 {
614 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, 614 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
615 "CONVERSATION", 615 "CONVERSATION",
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 425f0a3c2..3b2237229 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -285,7 +285,7 @@ handle_client_register_message (void *cls,
285 GNUNET_CONTAINER_DLL_insert (lines_head, 285 GNUNET_CONTAINER_DLL_insert (lines_head,
286 lines_tail, 286 lines_tail,
287 line); 287 line);
288 line->local_line = ntohl (msg->line) & (~ (1 << 31)); 288 line->local_line = ntohl (msg->line) & (~ HIGH_BIT);
289 GNUNET_SERVER_receive_done (client, GNUNET_OK); 289 GNUNET_SERVER_receive_done (client, GNUNET_OK);
290} 290}
291 291
@@ -703,7 +703,7 @@ handle_client_call_message (void *cls,
703 } 703 }
704 line = GNUNET_new (struct Line); 704 line = GNUNET_new (struct Line);
705 line->client = client; 705 line->client = client;
706 line->local_line = (local_line_cnt++) | (1 << 31); 706 line->local_line = (local_line_cnt++) | HIGH_BIT;
707 GNUNET_SERVER_client_set_user_context (client, line); 707 GNUNET_SERVER_client_set_user_context (client, line);
708 GNUNET_SERVER_notification_context_add (nc, client); 708 GNUNET_SERVER_notification_context_add (nc, client);
709 GNUNET_CONTAINER_DLL_insert (lines_head, 709 GNUNET_CONTAINER_DLL_insert (lines_head,