aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r--src/cadet/cadet_api.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index e141787a0..b16520429 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -134,11 +134,6 @@ struct GNUNET_CADET_Channel
134 struct GNUNET_CADET_ClientChannelNumber ccn; 134 struct GNUNET_CADET_ClientChannelNumber ccn;
135 135
136 /** 136 /**
137 * Channel options: reliability, etc.
138 */
139 enum GNUNET_CADET_ChannelOption options;
140
141 /**
142 * How many messages are we allowed to send to the service right now? 137 * How many messages are we allowed to send to the service right now?
143 */ 138 */
144 unsigned int allow_send; 139 unsigned int allow_send;
@@ -578,7 +573,6 @@ handle_channel_created (
578 ch = create_channel (h, &ccn); 573 ch = create_channel (h, &ccn);
579 ch->peer = msg->peer; 574 ch->peer = msg->peer;
580 ch->incoming_port = port; 575 ch->incoming_port = port;
581 ch->options = ntohl (msg->opt);
582 LOG (GNUNET_ERROR_TYPE_DEBUG, 576 LOG (GNUNET_ERROR_TYPE_DEBUG,
583 "Creating incoming channel %X [%s] %p\n", 577 "Creating incoming channel %X [%s] %p\n",
584 ntohl (ccn.channel_of_client), 578 ntohl (ccn.channel_of_client),
@@ -938,29 +932,9 @@ GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel)
938 */ 932 */
939const union GNUNET_CADET_ChannelInfo * 933const union GNUNET_CADET_ChannelInfo *
940GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, 934GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel,
941 enum GNUNET_CADET_ChannelOption option,
942 ...) 935 ...)
943{ 936{
944 static int bool_flag; 937 return (const union GNUNET_CADET_ChannelInfo *) &channel->peer;
945
946 switch (option)
947 {
948 case GNUNET_CADET_OPTION_NOBUFFER:
949 case GNUNET_CADET_OPTION_RELIABLE:
950 case GNUNET_CADET_OPTION_OUT_OF_ORDER:
951 if (0 != (option & channel->options))
952 bool_flag = GNUNET_YES;
953 else
954 bool_flag = GNUNET_NO;
955 return (const union GNUNET_CADET_ChannelInfo *) &bool_flag;
956 break;
957 case GNUNET_CADET_OPTION_PEER:
958 return (const union GNUNET_CADET_ChannelInfo *) &channel->peer;
959 break;
960 default:
961 GNUNET_break (0);
962 return NULL;
963 }
964} 938}
965 939
966 940
@@ -1089,7 +1063,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h,
1089 void *channel_cls, 1063 void *channel_cls,
1090 const struct GNUNET_PeerIdentity *destination, 1064 const struct GNUNET_PeerIdentity *destination,
1091 const struct GNUNET_HashCode *port, 1065 const struct GNUNET_HashCode *port,
1092 enum GNUNET_CADET_ChannelOption options,
1093 GNUNET_CADET_WindowSizeEventHandler window_changes, 1066 GNUNET_CADET_WindowSizeEventHandler window_changes,
1094 GNUNET_CADET_DisconnectEventHandler disconnects, 1067 GNUNET_CADET_DisconnectEventHandler disconnects,
1095 const struct GNUNET_MQ_MessageHandler *handlers) 1068 const struct GNUNET_MQ_MessageHandler *handlers)
@@ -1106,7 +1079,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h,
1106 ch = create_channel (h, NULL); 1079 ch = create_channel (h, NULL);
1107 ch->ctx = channel_cls; 1080 ch->ctx = channel_cls;
1108 ch->peer = *destination; 1081 ch->peer = *destination;
1109 ch->options = options;
1110 ch->window_changes = window_changes; 1082 ch->window_changes = window_changes;
1111 ch->disconnects = disconnects; 1083 ch->disconnects = disconnects;
1112 1084
@@ -1125,7 +1097,6 @@ GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h,
1125 msg->ccn = ch->ccn; 1097 msg->ccn = ch->ccn;
1126 msg->port = *port; 1098 msg->port = *port;
1127 msg->peer = *destination; 1099 msg->peer = *destination;
1128 msg->opt = htonl (options);
1129 GNUNET_MQ_send (h->mq, env); 1100 GNUNET_MQ_send (h->mq, env);
1130 return ch; 1101 return ch;
1131} 1102}