diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-11-22 18:37:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-11-22 18:37:35 +0100 |
commit | 67935982582a31e4a75dc431feceee9664bca839 (patch) | |
tree | 902431f5318c6a704ff5036b85391dcbb8792054 /src/transport/gnunet-communicator-unix.c | |
parent | ca90313490f4233ce9d209abbdcc2d78d16b8326 (diff) | |
download | gnunet-67935982582a31e4a75dc431feceee9664bca839.tar.gz gnunet-67935982582a31e4a75dc431feceee9664bca839.zip |
more work on TNG
Diffstat (limited to 'src/transport/gnunet-communicator-unix.c')
-rw-r--r-- | src/transport/gnunet-communicator-unix.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c index b2eebbe20..a9a75f779 100644 --- a/src/transport/gnunet-communicator-unix.c +++ b/src/transport/gnunet-communicator-unix.c | |||
@@ -50,6 +50,10 @@ | |||
50 | */ | 50 | */ |
51 | #define COMMUNICATOR_CONFIG_SECTION "communicator-unix" | 51 | #define COMMUNICATOR_CONFIG_SECTION "communicator-unix" |
52 | 52 | ||
53 | /** | ||
54 | * Our MTU. | ||
55 | */ | ||
56 | #define UNIX_MTU UINT16_MAX | ||
53 | 57 | ||
54 | GNUNET_NETWORK_STRUCT_BEGIN | 58 | GNUNET_NETWORK_STRUCT_BEGIN |
55 | 59 | ||
@@ -619,12 +623,14 @@ mq_error (void *cls, | |||
619 | * data to another peer. | 623 | * data to another peer. |
620 | * | 624 | * |
621 | * @param peer the target peer | 625 | * @param peer the target peer |
626 | * @param cs inbound or outbound queue | ||
622 | * @param un the address | 627 | * @param un the address |
623 | * @param un_len number of bytes in @a un | 628 | * @param un_len number of bytes in @a un |
624 | * @return the queue or NULL of max connections exceeded | 629 | * @return the queue or NULL of max connections exceeded |
625 | */ | 630 | */ |
626 | static struct Queue * | 631 | static struct Queue * |
627 | setup_queue (const struct GNUNET_PeerIdentity *target, | 632 | setup_queue (const struct GNUNET_PeerIdentity *target, |
633 | enum GNUNET_TRANSPORT_ConnectionStatus cs, | ||
628 | const struct sockaddr_un *un, | 634 | const struct sockaddr_un *un, |
629 | socklen_t un_len) | 635 | socklen_t un_len) |
630 | { | 636 | { |
@@ -673,7 +679,9 @@ setup_queue (const struct GNUNET_PeerIdentity *target, | |||
673 | = GNUNET_TRANSPORT_communicator_mq_add (ch, | 679 | = GNUNET_TRANSPORT_communicator_mq_add (ch, |
674 | &queue->target, | 680 | &queue->target, |
675 | foreign_addr, | 681 | foreign_addr, |
682 | UNIX_MTU, | ||
676 | GNUNET_ATS_NET_LOOPBACK, | 683 | GNUNET_ATS_NET_LOOPBACK, |
684 | cs, | ||
677 | queue->mq); | 685 | queue->mq); |
678 | GNUNET_free (foreign_addr); | 686 | GNUNET_free (foreign_addr); |
679 | } | 687 | } |
@@ -779,6 +787,7 @@ select_read_cb (void *cls) | |||
779 | addrlen); | 787 | addrlen); |
780 | if (NULL == queue) | 788 | if (NULL == queue) |
781 | queue = setup_queue (&msg->sender, | 789 | queue = setup_queue (&msg->sender, |
790 | GNUNET_TRANSPORT_CS_INBOUND, | ||
782 | &un, | 791 | &un, |
783 | addrlen); | 792 | addrlen); |
784 | else | 793 | else |
@@ -885,6 +894,7 @@ mq_init (void *cls, | |||
885 | return GNUNET_OK; | 894 | return GNUNET_OK; |
886 | } | 895 | } |
887 | queue = setup_queue (peer, | 896 | queue = setup_queue (peer, |
897 | GNUNET_TRANSPORT_CS_OUTBOUND, | ||
888 | un, | 898 | un, |
889 | un_len); | 899 | un_len); |
890 | GNUNET_free (un); | 900 | GNUNET_free (un); |
@@ -1072,7 +1082,6 @@ run (void *cls, | |||
1072 | ch = GNUNET_TRANSPORT_communicator_connect (cfg, | 1082 | ch = GNUNET_TRANSPORT_communicator_connect (cfg, |
1073 | COMMUNICATOR_CONFIG_SECTION, | 1083 | COMMUNICATOR_CONFIG_SECTION, |
1074 | COMMUNICATOR_ADDRESS_PREFIX, | 1084 | COMMUNICATOR_ADDRESS_PREFIX, |
1075 | 65535, | ||
1076 | &mq_init, | 1085 | &mq_init, |
1077 | NULL); | 1086 | NULL); |
1078 | if (NULL == ch) | 1087 | if (NULL == ch) |