diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-07-25 14:22:56 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-07-25 14:22:56 +0000 |
commit | ceb3be6d5ce8ebb9a1ca940b67d3e6a74896db6f (patch) | |
tree | a78c88dacf2dc2fb42f8dcd25ce40563f61a637b /src | |
parent | 225da976a68a9fafe056e15e812fc7e0f8f9e38e (diff) | |
download | gnunet-ceb3be6d5ce8ebb9a1ca940b67d3e6a74896db6f.tar.gz gnunet-ceb3be6d5ce8ebb9a1ca940b67d3e6a74896db6f.zip |
Eliminated mesh API buffering
Diffstat (limited to 'src')
-rw-r--r-- | src/dns/gnunet-service-dns.c | 2 | ||||
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 2 | ||||
-rw-r--r-- | src/include/gnunet_mesh_service.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 15 | ||||
-rw-r--r-- | src/mesh/mesh.h | 75 | ||||
-rw-r--r-- | src/mesh/mesh_api.c | 80 | ||||
-rw-r--r-- | src/pt/gnunet-daemon-pt.c | 2 | ||||
-rw-r--r-- | src/stream/stream_api.c | 12 | ||||
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 2 |
9 files changed, 140 insertions, 56 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index 570f742d8..10fc00282 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -1647,7 +1647,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1647 | GNUNET_APPLICATION_TYPE_END | 1647 | GNUNET_APPLICATION_TYPE_END |
1648 | }; | 1648 | }; |
1649 | mesh = GNUNET_MESH_connect (cfg, | 1649 | mesh = GNUNET_MESH_connect (cfg, |
1650 | 1, NULL, | 1650 | NULL, |
1651 | &accept_dns_tunnel, | 1651 | &accept_dns_tunnel, |
1652 | &destroy_dns_tunnel, | 1652 | &destroy_dns_tunnel, |
1653 | mesh_handlers, | 1653 | mesh_handlers, |
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 2614ba908..337fca481 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -3202,7 +3202,7 @@ run (void *cls, char *const *args GNUNET_UNUSED, | |||
3202 | connections_map = GNUNET_CONTAINER_multihashmap_create (65536); | 3202 | connections_map = GNUNET_CONTAINER_multihashmap_create (65536); |
3203 | connections_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 3203 | connections_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
3204 | mesh_handle | 3204 | mesh_handle |
3205 | = GNUNET_MESH_connect (cfg, 42 /* queue size */, NULL, | 3205 | = GNUNET_MESH_connect (cfg, NULL, |
3206 | &new_tunnel, | 3206 | &new_tunnel, |
3207 | &clean_tunnel, handlers, | 3207 | &clean_tunnel, handlers, |
3208 | apptypes); | 3208 | apptypes); |
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index c235bdd42..044fe1cee 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h | |||
@@ -154,9 +154,6 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
154 | * Connect to the mesh service. | 154 | * Connect to the mesh service. |
155 | * | 155 | * |
156 | * @param cfg configuration to use | 156 | * @param cfg configuration to use |
157 | * @param queue_size size of the data message queue, shared among all tunnels | ||
158 | * (each tunnel is guaranteed to accept at least one message, | ||
159 | * no matter what is the status of other tunnels) | ||
160 | * @param cls closure for the various callbacks that follow | 157 | * @param cls closure for the various callbacks that follow |
161 | * (including handlers in the handlers array) | 158 | * (including handlers in the handlers array) |
162 | * @param new_tunnel function called when an *inbound* tunnel is created | 159 | * @param new_tunnel function called when an *inbound* tunnel is created |
@@ -172,8 +169,7 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
172 | * (in this case, init is never called) | 169 | * (in this case, init is never called) |
173 | */ | 170 | */ |
174 | struct GNUNET_MESH_Handle * | 171 | struct GNUNET_MESH_Handle * |
175 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 172 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
176 | unsigned int queue_size, void *cls, | ||
177 | GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, | 173 | GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, |
178 | GNUNET_MESH_TunnelEndHandler cleaner, | 174 | GNUNET_MESH_TunnelEndHandler cleaner, |
179 | const struct GNUNET_MESH_MessageHandler *handlers, | 175 | const struct GNUNET_MESH_MessageHandler *handlers, |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 6d90f5265..a475ab4cc 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -848,27 +848,32 @@ extern "C" | |||
848 | /** | 848 | /** |
849 | * Set tunnel speed to slowest peer | 849 | * Set tunnel speed to slowest peer |
850 | */ | 850 | */ |
851 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_MIN 282 | 851 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_MIN 282 |
852 | 852 | ||
853 | /** | 853 | /** |
854 | * Set tunnel speed to fastest peer | 854 | * Set tunnel speed to fastest peer |
855 | */ | 855 | */ |
856 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_MAX 283 | 856 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_MAX 283 |
857 | 857 | ||
858 | /** | 858 | /** |
859 | * Set tunnel buffering on. | 859 | * Set tunnel buffering on. |
860 | */ | 860 | */ |
861 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_BUFFER 284 | 861 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_BUFFER 284 |
862 | 862 | ||
863 | /** | 863 | /** |
864 | * Set tunnel buffering off. | 864 | * Set tunnel buffering off. |
865 | */ | 865 | */ |
866 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_NOBUFFER 285 | 866 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_NOBUFFER 285 |
867 | |||
868 | /** | ||
869 | * Local ACK for data. | ||
870 | */ | ||
871 | #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK 286 | ||
867 | 872 | ||
868 | /** | 873 | /** |
869 | * 640kb should be enough for everybody | 874 | * 640kb should be enough for everybody |
870 | */ | 875 | */ |
871 | #define GNUNET_MESSAGE_TYPE_MESH_RESERVE_END 288 | 876 | #define GNUNET_MESSAGE_TYPE_MESH_RESERVE_END 299 |
872 | 877 | ||
873 | 878 | ||
874 | 879 | ||
diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h index f00c5b256..66d6d6cb1 100644 --- a/src/mesh/mesh.h +++ b/src/mesh/mesh.h | |||
@@ -169,24 +169,24 @@ struct GNUNET_MESH_TunnelNotification | |||
169 | struct GNUNET_MESH_PeerControl | 169 | struct GNUNET_MESH_PeerControl |
170 | { | 170 | { |
171 | 171 | ||
172 | /** | 172 | /** |
173 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_[ADD|DEL|[UN]BLACKLIST] | 173 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_[ADD|DEL|[UN]BLACKLIST] |
174 | * (client to service, client created tunnel) | 174 | * (client to service, client created tunnel) |
175 | * GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_[CONNECTED|DISCONNECTED] | 175 | * GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_[CONNECTED|DISCONNECTED] |
176 | * (service to client) | 176 | * (service to client) |
177 | * | 177 | * |
178 | * Size: sizeof(struct GNUNET_MESH_PeerControl) | 178 | * Size: sizeof(struct GNUNET_MESH_PeerControl) |
179 | */ | 179 | */ |
180 | struct GNUNET_MessageHeader header; | 180 | struct GNUNET_MessageHeader header; |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * ID of a tunnel controlled by this client. | 183 | * ID of a tunnel controlled by this client. |
184 | */ | 184 | */ |
185 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; | 185 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; |
186 | 186 | ||
187 | /** | 187 | /** |
188 | * Peer to connect/disconnect. | 188 | * Peer to connect/disconnect. |
189 | */ | 189 | */ |
190 | struct GNUNET_PeerIdentity peer; | 190 | struct GNUNET_PeerIdentity peer; |
191 | }; | 191 | }; |
192 | 192 | ||
@@ -199,17 +199,19 @@ struct GNUNET_MESH_ConnectPeerByType | |||
199 | /** | 199 | /** |
200 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_BY_TYPE | | 200 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_BY_TYPE | |
201 | * GNUNET_MESSAGE_TYPE_MESH_LOCAL_DISCONNECT_PEER_BY_TYPE | 201 | * GNUNET_MESSAGE_TYPE_MESH_LOCAL_DISCONNECT_PEER_BY_TYPE |
202 | * | ||
203 | * Size: sizeof(struct GNUNET_MESH_ConnectPeerByType) | ||
202 | */ | 204 | */ |
203 | struct GNUNET_MessageHeader header; | 205 | struct GNUNET_MessageHeader header; |
204 | 206 | ||
205 | /** | 207 | /** |
206 | * ID of a tunnel controlled by this client. | 208 | * ID of a tunnel controlled by this client. |
207 | */ | 209 | */ |
208 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; | 210 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; |
209 | 211 | ||
210 | /** | 212 | /** |
211 | * Type specification | 213 | * Type specification |
212 | */ | 214 | */ |
213 | GNUNET_MESH_ApplicationType type GNUNET_PACKED; | 215 | GNUNET_MESH_ApplicationType type GNUNET_PACKED; |
214 | }; | 216 | }; |
215 | 217 | ||
@@ -221,16 +223,43 @@ struct GNUNET_MESH_ConnectPeerByString | |||
221 | { | 223 | { |
222 | /** | 224 | /** |
223 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_ADD_BY_STRING | 225 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_ADD_BY_STRING |
226 | * | ||
227 | * Size: sizeof(struct GNUNET_MESH_ConnectPeerByString) + strlen (string) | ||
224 | */ | 228 | */ |
225 | struct GNUNET_MessageHeader header; | 229 | struct GNUNET_MessageHeader header; |
226 | 230 | ||
227 | /** | 231 | /** |
228 | * ID of a tunnel controlled by this client. | 232 | * ID of a tunnel controlled by this client. |
229 | */ | 233 | */ |
230 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; | 234 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; |
231 | 235 | ||
232 | /* String describing the service */ | 236 | /* String describing the service */ |
233 | }; | 237 | }; |
238 | |||
239 | |||
240 | /** | ||
241 | * Message to allow the client send more data to the service | ||
242 | * (always service -> client). | ||
243 | */ | ||
244 | struct GNUNET_MESH_LocalAck | ||
245 | { | ||
246 | /** | ||
247 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK | ||
248 | */ | ||
249 | struct GNUNET_MessageHeader header; | ||
250 | |||
251 | /** | ||
252 | * ID of the tunnel allowed to send more data. | ||
253 | */ | ||
254 | MESH_TunnelNumber tunnel_id GNUNET_PACKED; | ||
255 | |||
256 | /** | ||
257 | * ID of the last packet allowed. | ||
258 | */ | ||
259 | uint32_t max_pid GNUNET_PACKED; | ||
260 | }; | ||
261 | |||
262 | |||
234 | GNUNET_NETWORK_STRUCT_END | 263 | GNUNET_NETWORK_STRUCT_END |
235 | 264 | ||
236 | /******************************************************************************/ | 265 | /******************************************************************************/ |
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 935c99574..f02c17a2a 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c | |||
@@ -43,6 +43,15 @@ | |||
43 | 43 | ||
44 | 44 | ||
45 | /******************************************************************************/ | 45 | /******************************************************************************/ |
46 | /************************ CONSTANTS ****************************/ | ||
47 | /******************************************************************************/ | ||
48 | |||
49 | #define HIGH_PID 0xFFFF0000 | ||
50 | #define LOW_PID 0x0000FFFF | ||
51 | |||
52 | #define PID_OVERFLOW(pid, max) (pid > HIGH_PID && max < LOW_PID) | ||
53 | |||
54 | /******************************************************************************/ | ||
46 | /************************ DATA STRUCTURES ****************************/ | 55 | /************************ DATA STRUCTURES ****************************/ |
47 | /******************************************************************************/ | 56 | /******************************************************************************/ |
48 | 57 | ||
@@ -234,9 +243,13 @@ struct GNUNET_MESH_Tunnel | |||
234 | { | 243 | { |
235 | 244 | ||
236 | /** | 245 | /** |
237 | * DLL | 246 | * DLL next |
238 | */ | 247 | */ |
239 | struct GNUNET_MESH_Tunnel *next; | 248 | struct GNUNET_MESH_Tunnel *next; |
249 | |||
250 | /** | ||
251 | * DLL prev | ||
252 | */ | ||
240 | struct GNUNET_MESH_Tunnel *prev; | 253 | struct GNUNET_MESH_Tunnel *prev; |
241 | 254 | ||
242 | /** | 255 | /** |
@@ -303,12 +316,23 @@ struct GNUNET_MESH_Tunnel | |||
303 | * Is the tunnel throttled to the slowest peer? | 316 | * Is the tunnel throttled to the slowest peer? |
304 | */ | 317 | */ |
305 | int speed_min; | 318 | int speed_min; |
306 | 319 | ||
307 | /** | 320 | /** |
308 | * Is the tunnel allowed to buffer? | 321 | * Is the tunnel allowed to buffer? |
309 | */ | 322 | */ |
310 | int buffering; | 323 | int buffering; |
311 | 324 | ||
325 | /** | ||
326 | * Next packet PID. | ||
327 | */ | ||
328 | uint32_t pid; | ||
329 | |||
330 | /** | ||
331 | * Maximum allowed PID. | ||
332 | */ | ||
333 | uint32_t max_pid; | ||
334 | |||
335 | |||
312 | }; | 336 | }; |
313 | 337 | ||
314 | 338 | ||
@@ -1006,15 +1030,14 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
1006 | if (GNUNET_OK != | 1030 | if (GNUNET_OK != |
1007 | handler->callback (h->cls, t, &t->ctx, peer, payload, &atsi)) | 1031 | handler->callback (h->cls, t, &t->ctx, peer, payload, &atsi)) |
1008 | { | 1032 | { |
1009 | LOG (GNUNET_ERROR_TYPE_DEBUG, "MESH: callback caused disconnection\n"); | 1033 | LOG (GNUNET_ERROR_TYPE_DEBUG, "callback caused disconnection\n"); |
1010 | GNUNET_MESH_disconnect (h); | 1034 | GNUNET_MESH_disconnect (h); |
1011 | return GNUNET_NO; | 1035 | return GNUNET_NO; |
1012 | } | 1036 | } |
1013 | else | 1037 | else |
1014 | { | 1038 | { |
1015 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1039 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1016 | "MESH: callback completed successfully\n"); | 1040 | "callback completed successfully\n"); |
1017 | |||
1018 | } | 1041 | } |
1019 | } | 1042 | } |
1020 | } | 1043 | } |
@@ -1023,6 +1046,39 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
1023 | 1046 | ||
1024 | 1047 | ||
1025 | /** | 1048 | /** |
1049 | * Process a local ACK message, enabling the client to send | ||
1050 | * more data to the service. | ||
1051 | * | ||
1052 | * @param h Mesh handle. | ||
1053 | * @param message Message itself. | ||
1054 | */ | ||
1055 | static void | ||
1056 | process_ack (struct GNUNET_MESH_Handle *h, | ||
1057 | const struct GNUNET_MessageHeader *message) | ||
1058 | { | ||
1059 | struct GNUNET_MESH_LocalAck *msg; | ||
1060 | struct GNUNET_MESH_Tunnel *t; | ||
1061 | uint32_t ack; | ||
1062 | |||
1063 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Got an ACK!\n"); | ||
1064 | msg = (struct GNUNET_MESH_LocalAck *) message; | ||
1065 | |||
1066 | t = retrieve_tunnel (h, ntohl (msg->tunnel_id)); | ||
1067 | |||
1068 | if (NULL == t) | ||
1069 | { | ||
1070 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
1071 | "ACK on unknown tunnel %X\n", | ||
1072 | ntohl (msg->tunnel_id)); | ||
1073 | return; | ||
1074 | } | ||
1075 | ack = ntohl (msg->max_pid); | ||
1076 | if (ack > t->max_pid || PID_OVERFLOW (t->max_pid, ack)) | ||
1077 | t->max_pid = ack; | ||
1078 | } | ||
1079 | |||
1080 | |||
1081 | /** | ||
1026 | * Function to process all messages received from the service | 1082 | * Function to process all messages received from the service |
1027 | * | 1083 | * |
1028 | * @param cls closure | 1084 | * @param cls closure |
@@ -1063,10 +1119,13 @@ msg_received (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1063 | if (GNUNET_NO == process_incoming_data (h, msg)) | 1119 | if (GNUNET_NO == process_incoming_data (h, msg)) |
1064 | return; | 1120 | return; |
1065 | break; | 1121 | break; |
1066 | /* We shouldn't get any other packages, log and ignore */ | 1122 | case GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK: |
1123 | process_ack (h, msg); | ||
1124 | break; | ||
1067 | default: | 1125 | default: |
1126 | /* We shouldn't get any other packages, log and ignore */ | ||
1068 | LOG (GNUNET_ERROR_TYPE_WARNING, | 1127 | LOG (GNUNET_ERROR_TYPE_WARNING, |
1069 | "MESH: unsolicited message form service (type %d)\n", | 1128 | "unsolicited message form service (type %d)\n", |
1070 | ntohs (msg->type)); | 1129 | ntohs (msg->type)); |
1071 | } | 1130 | } |
1072 | LOG (GNUNET_ERROR_TYPE_DEBUG, "message processed\n"); | 1131 | LOG (GNUNET_ERROR_TYPE_DEBUG, "message processed\n"); |
@@ -1266,9 +1325,6 @@ send_packet (struct GNUNET_MESH_Handle *h, | |||
1266 | * Connect to the mesh service. | 1325 | * Connect to the mesh service. |
1267 | * | 1326 | * |
1268 | * @param cfg configuration to use | 1327 | * @param cfg configuration to use |
1269 | * @param queue_size size of the data message queue, shared among all tunnels | ||
1270 | * (each tunnel is guaranteed to accept at least one message, | ||
1271 | * no matter what is the status of other tunnels) | ||
1272 | * @param cls closure for the various callbacks that follow | 1328 | * @param cls closure for the various callbacks that follow |
1273 | * (including handlers in the handlers array) | 1329 | * (including handlers in the handlers array) |
1274 | * @param new_tunnel function called when an *inbound* tunnel is created | 1330 | * @param new_tunnel function called when an *inbound* tunnel is created |
@@ -1284,8 +1340,7 @@ send_packet (struct GNUNET_MESH_Handle *h, | |||
1284 | * (in this case, init is never called) | 1340 | * (in this case, init is never called) |
1285 | */ | 1341 | */ |
1286 | struct GNUNET_MESH_Handle * | 1342 | struct GNUNET_MESH_Handle * |
1287 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 1343 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
1288 | unsigned int queue_size, void *cls, | ||
1289 | GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, | 1344 | GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel, |
1290 | GNUNET_MESH_TunnelEndHandler cleaner, | 1345 | GNUNET_MESH_TunnelEndHandler cleaner, |
1291 | const struct GNUNET_MESH_MessageHandler *handlers, | 1346 | const struct GNUNET_MESH_MessageHandler *handlers, |
@@ -1296,7 +1351,6 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1296 | LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect()\n"); | 1351 | LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect()\n"); |
1297 | h = GNUNET_malloc (sizeof (struct GNUNET_MESH_Handle)); | 1352 | h = GNUNET_malloc (sizeof (struct GNUNET_MESH_Handle)); |
1298 | h->cfg = cfg; | 1353 | h->cfg = cfg; |
1299 | h->max_queue_size = queue_size; | ||
1300 | h->new_tunnel = new_tunnel; | 1354 | h->new_tunnel = new_tunnel; |
1301 | h->cleaner = cleaner; | 1355 | h->cleaner = cleaner; |
1302 | h->client = GNUNET_CLIENT_connect ("mesh", cfg); | 1356 | h->client = GNUNET_CLIENT_connect ("mesh", cfg); |
diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c index 73936a489..702b8a95c 100644 --- a/src/pt/gnunet-daemon-pt.c +++ b/src/pt/gnunet-daemon-pt.c | |||
@@ -932,7 +932,7 @@ run (void *cls, char *const *args GNUNET_UNUSED, | |||
932 | GNUNET_SCHEDULER_shutdown (); | 932 | GNUNET_SCHEDULER_shutdown (); |
933 | return; | 933 | return; |
934 | } | 934 | } |
935 | mesh_handle = GNUNET_MESH_connect (cfg, 1, NULL, NULL, NULL, | 935 | mesh_handle = GNUNET_MESH_connect (cfg, NULL, NULL, NULL, |
936 | mesh_handlers, mesh_types); | 936 | mesh_handlers, mesh_types); |
937 | if (NULL == mesh_handle) | 937 | if (NULL == mesh_handle) |
938 | { | 938 | { |
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c index 595bf7a6c..930bd63e7 100644 --- a/src/stream/stream_api.c +++ b/src/stream/stream_api.c | |||
@@ -2813,10 +2813,12 @@ new_tunnel_notify (void *cls, | |||
2813 | 2813 | ||
2814 | if (GNUNET_NO == lsocket->listening) | 2814 | if (GNUNET_NO == lsocket->listening) |
2815 | { | 2815 | { |
2816 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2816 | // FIXME: socket uninitalized |
2817 | "%s: Destroying tunnel from peer %s as we don't have the lock\n", | 2817 | // FIXME: cannot use GNUNET_i2s twice in same call (static buffer) |
2818 | GNUNET_i2s (&socket->other_peer), | 2818 | // LOG (GNUNET_ERROR_TYPE_DEBUG, |
2819 | GNUNET_i2s (&socket->other_peer)); | 2819 | // "%s: Destroying tunnel from peer %s as we don't have the lock\n", |
2820 | // GNUNET_i2s (&socket->other_peer), | ||
2821 | // GNUNET_i2s (&socket->other_peer)); | ||
2820 | GNUNET_MESH_tunnel_destroy (tunnel); | 2822 | GNUNET_MESH_tunnel_destroy (tunnel); |
2821 | return NULL; | 2823 | return NULL; |
2822 | } | 2824 | } |
@@ -2949,7 +2951,6 @@ lock_status_change_cb (void *cls, const char *domain, uint32_t lock, | |||
2949 | GNUNET_MESH_ApplicationType ports[] = {lsocket->port, 0}; | 2951 | GNUNET_MESH_ApplicationType ports[] = {lsocket->port, 0}; |
2950 | 2952 | ||
2951 | lsocket->mesh = GNUNET_MESH_connect (lsocket->cfg, | 2953 | lsocket->mesh = GNUNET_MESH_connect (lsocket->cfg, |
2952 | RECEIVE_BUFFER_SIZE, /* FIXME: QUEUE size as parameter? */ | ||
2953 | lsocket, /* Closure */ | 2954 | lsocket, /* Closure */ |
2954 | &new_tunnel_notify, | 2955 | &new_tunnel_notify, |
2955 | &tunnel_cleaner, | 2956 | &tunnel_cleaner, |
@@ -3036,7 +3037,6 @@ GNUNET_STREAM_open (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
3036 | } while (GNUNET_STREAM_OPTION_END != option); | 3037 | } while (GNUNET_STREAM_OPTION_END != option); |
3037 | va_end (vargs); /* End of variable args parsing */ | 3038 | va_end (vargs); /* End of variable args parsing */ |
3038 | socket->mesh = GNUNET_MESH_connect (cfg, /* the configuration handle */ | 3039 | socket->mesh = GNUNET_MESH_connect (cfg, /* the configuration handle */ |
3039 | RECEIVE_BUFFER_SIZE, /* QUEUE size as parameter? */ | ||
3040 | socket, /* cls */ | 3040 | socket, /* cls */ |
3041 | NULL, /* No inbound tunnel handler */ | 3041 | NULL, /* No inbound tunnel handler */ |
3042 | NULL, /* No in-tunnel cleaner */ | 3042 | NULL, /* No in-tunnel cleaner */ |
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 0b9a4dcb2..677b272ea 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -3177,7 +3177,7 @@ run (void *cls, | |||
3177 | vpn_argv[6] = NULL; | 3177 | vpn_argv[6] = NULL; |
3178 | 3178 | ||
3179 | mesh_handle = | 3179 | mesh_handle = |
3180 | GNUNET_MESH_connect (cfg_, 42 /* queue length */, NULL, | 3180 | GNUNET_MESH_connect (cfg_, NULL, |
3181 | &inbound_tunnel_cb, | 3181 | &inbound_tunnel_cb, |
3182 | &tunnel_cleaner, | 3182 | &tunnel_cleaner, |
3183 | mesh_handlers, | 3183 | mesh_handlers, |