diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/transport/plugin_transport_http.h | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/transport/plugin_transport_http.h')
-rw-r--r-- | src/transport/plugin_transport_http.h | 96 |
1 files changed, 52 insertions, 44 deletions
diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h index 4ad8f6e58..a3b59513e 100644 --- a/src/transport/plugin_transport_http.h +++ b/src/transport/plugin_transport_http.h | |||
@@ -62,12 +62,14 @@ | |||
62 | #define OUTBOUND GNUNET_NO | 62 | #define OUTBOUND GNUNET_NO |
63 | 63 | ||
64 | 64 | ||
65 | #define HTTP_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 15) | 65 | #define HTTP_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply ( \ |
66 | GNUNET_TIME_UNIT_SECONDS, 15) | ||
66 | 67 | ||
67 | /** | 68 | /** |
68 | * Encapsulation of all of the state of the plugin. | 69 | * Encapsulation of all of the state of the plugin. |
69 | */ | 70 | */ |
70 | struct Plugin { | 71 | struct Plugin |
72 | { | ||
71 | /** | 73 | /** |
72 | * Our environment. | 74 | * Our environment. |
73 | */ | 75 | */ |
@@ -118,7 +120,7 @@ struct Plugin { | |||
118 | /** | 120 | /** |
119 | * Task calling transport service about external address | 121 | * Task calling transport service about external address |
120 | */ | 122 | */ |
121 | struct GNUNET_SCHEDULER_Task * notify_ext_task; | 123 | struct GNUNET_SCHEDULER_Task *notify_ext_task; |
122 | 124 | ||
123 | /** | 125 | /** |
124 | * Plugin name. | 126 | * Plugin name. |
@@ -206,7 +208,7 @@ struct Plugin { | |||
206 | /** | 208 | /** |
207 | * MHD IPv4 task | 209 | * MHD IPv4 task |
208 | */ | 210 | */ |
209 | struct GNUNET_SCHEDULER_Task * server_v4_task; | 211 | struct GNUNET_SCHEDULER_Task *server_v4_task; |
210 | 212 | ||
211 | /** | 213 | /** |
212 | * The IPv4 server is scheduled to run asap | 214 | * The IPv4 server is scheduled to run asap |
@@ -221,7 +223,7 @@ struct Plugin { | |||
221 | /** | 223 | /** |
222 | * MHD IPv4 task | 224 | * MHD IPv4 task |
223 | */ | 225 | */ |
224 | struct GNUNET_SCHEDULER_Task * server_v6_task; | 226 | struct GNUNET_SCHEDULER_Task *server_v6_task; |
225 | 227 | ||
226 | /** | 228 | /** |
227 | * The IPv6 server is scheduled to run asap | 229 | * The IPv6 server is scheduled to run asap |
@@ -260,7 +262,7 @@ struct Plugin { | |||
260 | /** | 262 | /** |
261 | * curl perform task | 263 | * curl perform task |
262 | */ | 264 | */ |
263 | struct GNUNET_SCHEDULER_Task * client_perform_task; | 265 | struct GNUNET_SCHEDULER_Task *client_perform_task; |
264 | }; | 266 | }; |
265 | 267 | ||
266 | GNUNET_NETWORK_STRUCT_BEGIN | 268 | GNUNET_NETWORK_STRUCT_BEGIN |
@@ -268,7 +270,8 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
268 | /** | 270 | /** |
269 | * HTTP addresses including a full URI | 271 | * HTTP addresses including a full URI |
270 | */ | 272 | */ |
271 | struct HttpAddress { | 273 | struct HttpAddress |
274 | { | ||
272 | /** | 275 | /** |
273 | * Length of the address following in NBO | 276 | * Length of the address following in NBO |
274 | */ | 277 | */ |
@@ -283,7 +286,8 @@ struct HttpAddress { | |||
283 | /** | 286 | /** |
284 | * IPv4 addresses | 287 | * IPv4 addresses |
285 | */ | 288 | */ |
286 | struct IPv4HttpAddress { | 289 | struct IPv4HttpAddress |
290 | { | ||
287 | /** | 291 | /** |
288 | * IPv4 address, in network byte order. | 292 | * IPv4 address, in network byte order. |
289 | */ | 293 | */ |
@@ -298,7 +302,8 @@ struct IPv4HttpAddress { | |||
298 | /** | 302 | /** |
299 | * IPv4 addresses | 303 | * IPv4 addresses |
300 | */ | 304 | */ |
301 | struct IPv6HttpAddress { | 305 | struct IPv6HttpAddress |
306 | { | ||
302 | /** | 307 | /** |
303 | * IPv6 address. | 308 | * IPv6 address. |
304 | */ | 309 | */ |
@@ -312,7 +317,8 @@ struct IPv6HttpAddress { | |||
312 | GNUNET_NETWORK_STRUCT_END | 317 | GNUNET_NETWORK_STRUCT_END |
313 | 318 | ||
314 | 319 | ||
315 | struct ServerRequest { | 320 | struct ServerRequest |
321 | { | ||
316 | /** | 322 | /** |
317 | * _RECV or _SEND | 323 | * _RECV or _SEND |
318 | */ | 324 | */ |
@@ -338,7 +344,8 @@ struct ServerRequest { | |||
338 | /** | 344 | /** |
339 | * Session handle for connections. | 345 | * Session handle for connections. |
340 | */ | 346 | */ |
341 | struct GNUNET_ATS_Session { | 347 | struct GNUNET_ATS_Session |
348 | { | ||
342 | /** | 349 | /** |
343 | * To whom are we talking to | 350 | * To whom are we talking to |
344 | */ | 351 | */ |
@@ -420,12 +427,12 @@ struct GNUNET_ATS_Session { | |||
420 | /** | 427 | /** |
421 | * Task to wake up client receive handle when receiving is allowed again | 428 | * Task to wake up client receive handle when receiving is allowed again |
422 | */ | 429 | */ |
423 | struct GNUNET_SCHEDULER_Task * recv_wakeup_task; | 430 | struct GNUNET_SCHEDULER_Task *recv_wakeup_task; |
424 | 431 | ||
425 | /** | 432 | /** |
426 | * Session timeout task | 433 | * Session timeout task |
427 | */ | 434 | */ |
428 | struct GNUNET_SCHEDULER_Task * timeout_task; | 435 | struct GNUNET_SCHEDULER_Task *timeout_task; |
429 | 436 | ||
430 | /** | 437 | /** |
431 | * Is client send handle paused since there are no data to send? | 438 | * Is client send handle paused since there are no data to send? |
@@ -448,7 +455,8 @@ struct GNUNET_ATS_Session { | |||
448 | /** | 455 | /** |
449 | * Message to send using http | 456 | * Message to send using http |
450 | */ | 457 | */ |
451 | struct HTTP_Message { | 458 | struct HTTP_Message |
459 | { | ||
452 | /** | 460 | /** |
453 | * next pointer for double linked list | 461 | * next pointer for double linked list |
454 | */ | 462 | */ |
@@ -489,81 +497,81 @@ struct HTTP_Message { | |||
489 | 497 | ||
490 | 498 | ||
491 | struct GNUNET_ATS_Session * | 499 | struct GNUNET_ATS_Session * |
492 | create_session(struct Plugin *plugin, | 500 | create_session (struct Plugin *plugin, |
493 | const struct GNUNET_PeerIdentity *target, | 501 | const struct GNUNET_PeerIdentity *target, |
494 | const void *addr, | 502 | const void *addr, |
495 | size_t addrlen); | 503 | size_t addrlen); |
496 | 504 | ||
497 | 505 | ||
498 | int | 506 | int |
499 | exist_session(struct Plugin *plugin, | 507 | exist_session (struct Plugin *plugin, |
500 | struct GNUNET_ATS_Session *s); | 508 | struct GNUNET_ATS_Session *s); |
501 | 509 | ||
502 | 510 | ||
503 | void | 511 | void |
504 | delete_session(struct GNUNET_ATS_Session *s); | 512 | delete_session (struct GNUNET_ATS_Session *s); |
505 | 513 | ||
506 | 514 | ||
507 | int | 515 | int |
508 | exist_session(struct Plugin *plugin, | 516 | exist_session (struct Plugin *plugin, |
509 | struct GNUNET_ATS_Session *s); | 517 | struct GNUNET_ATS_Session *s); |
510 | 518 | ||
511 | 519 | ||
512 | struct GNUNET_TIME_Relative | 520 | struct GNUNET_TIME_Relative |
513 | http_plugin_receive(void *cls, | 521 | http_plugin_receive (void *cls, |
514 | const struct GNUNET_PeerIdentity *peer, | 522 | const struct GNUNET_PeerIdentity *peer, |
515 | const struct GNUNET_MessageHeader *message, | 523 | const struct GNUNET_MessageHeader *message, |
516 | struct GNUNET_ATS_Session *session, | 524 | struct GNUNET_ATS_Session *session, |
517 | const char *sender_address, | 525 | const char *sender_address, |
518 | uint16_t sender_address_len); | 526 | uint16_t sender_address_len); |
519 | 527 | ||
520 | 528 | ||
521 | const char * | 529 | const char * |
522 | http_plugin_address_to_string(void *cls, | 530 | http_plugin_address_to_string (void *cls, |
523 | const void *addr, | 531 | const void *addr, |
524 | size_t addrlen); | 532 | size_t addrlen); |
525 | 533 | ||
526 | 534 | ||
527 | int | 535 | int |
528 | client_disconnect(struct GNUNET_ATS_Session *s); | 536 | client_disconnect (struct GNUNET_ATS_Session *s); |
529 | 537 | ||
530 | 538 | ||
531 | int | 539 | int |
532 | client_connect(struct GNUNET_ATS_Session *s); | 540 | client_connect (struct GNUNET_ATS_Session *s); |
533 | 541 | ||
534 | 542 | ||
535 | int | 543 | int |
536 | client_send(struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); | 544 | client_send (struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); |
537 | 545 | ||
538 | 546 | ||
539 | int | 547 | int |
540 | client_start(struct Plugin *plugin); | 548 | client_start (struct Plugin *plugin); |
541 | 549 | ||
542 | 550 | ||
543 | void | 551 | void |
544 | client_stop(struct Plugin *plugin); | 552 | client_stop (struct Plugin *plugin); |
545 | 553 | ||
546 | 554 | ||
547 | int | 555 | int |
548 | server_disconnect(struct GNUNET_ATS_Session *s); | 556 | server_disconnect (struct GNUNET_ATS_Session *s); |
549 | 557 | ||
550 | 558 | ||
551 | int | 559 | int |
552 | server_send(struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); | 560 | server_send (struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); |
553 | 561 | ||
554 | 562 | ||
555 | int | 563 | int |
556 | server_start(struct Plugin *plugin); | 564 | server_start (struct Plugin *plugin); |
557 | 565 | ||
558 | 566 | ||
559 | void | 567 | void |
560 | server_stop(struct Plugin *plugin); | 568 | server_stop (struct Plugin *plugin); |
561 | 569 | ||
562 | 570 | ||
563 | void | 571 | void |
564 | notify_session_end(void *cls, | 572 | notify_session_end (void *cls, |
565 | const struct GNUNET_PeerIdentity *peer, | 573 | const struct GNUNET_PeerIdentity *peer, |
566 | struct GNUNET_ATS_Session *s); | 574 | struct GNUNET_ATS_Session *s); |
567 | 575 | ||
568 | 576 | ||
569 | /*#ifndef PLUGIN_TRANSPORT_HTTP_H*/ | 577 | /*#ifndef PLUGIN_TRANSPORT_HTTP_H*/ |