aboutsummaryrefslogtreecommitdiff
path: root/src/util/network.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-08-29 18:34:03 +0000
committerChristian Grothoff <christian@grothoff.org>2009-08-29 18:34:03 +0000
commitaca96d397a1c5213236f0183d7b74e2e38906181 (patch)
tree062b827acb08abe050c0ac2f7c7f08a9b9a7d1ea /src/util/network.c
parenteb0874673e122ddd822af3f4a9f9090c6104cd2a (diff)
downloadgnunet-aca96d397a1c5213236f0183d7b74e2e38906181.tar.gz
gnunet-aca96d397a1c5213236f0183d7b74e2e38906181.zip
fixing remaining network-connection naming confusion in API
Diffstat (limited to 'src/util/network.c')
-rw-r--r--src/util/network.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/util/network.c b/src/util/network.c
index fd5fe1217..35dfc69ca 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -49,14 +49,14 @@
49static int address_families[] = 49static int address_families[] =
50 { AF_INET, AF_INET6, AF_UNSPEC }; 50 { AF_INET, AF_INET6, AF_UNSPEC };
51 51
52struct GNUNET_NETWORK_TransmitHandle 52struct GNUNET_CONNECTION_TransmitHandle
53{ 53{
54 54
55 /** 55 /**
56 * Function to call if the send buffer has notify_size 56 * Function to call if the send buffer has notify_size
57 * bytes available. 57 * bytes available.
58 */ 58 */
59 GNUNET_NETWORK_TransmitReadyNotify notify_ready; 59 GNUNET_CONNECTION_TransmitReadyNotify notify_ready;
60 60
61 /** 61 /**
62 * Closure for notify_ready. 62 * Closure for notify_ready.
@@ -169,7 +169,7 @@ struct GNUNET_CONNECTION_Handle
169 /** 169 /**
170 * The handle we return for GNUNET_CONNECTION_notify_transmit_ready. 170 * The handle we return for GNUNET_CONNECTION_notify_transmit_ready.
171 */ 171 */
172 struct GNUNET_NETWORK_TransmitHandle nth; 172 struct GNUNET_CONNECTION_TransmitHandle nth;
173 173
174 /** 174 /**
175 * Underlying OS's socket, set to NULL after fatal errors. 175 * Underlying OS's socket, set to NULL after fatal errors.
@@ -185,7 +185,7 @@ struct GNUNET_CONNECTION_Handle
185 * Function to call on data received, NULL 185 * Function to call on data received, NULL
186 * if no receive is pending. 186 * if no receive is pending.
187 */ 187 */
188 GNUNET_NETWORK_Receiver receiver; 188 GNUNET_CONNECTION_Receiver receiver;
189 189
190 /** 190 /**
191 * Closure for receiver. 191 * Closure for receiver.
@@ -247,7 +247,7 @@ GNUNET_CONNECTION_create_from_existing (struct GNUNET_SCHEDULER_Handle
247struct GNUNET_CONNECTION_Handle * 247struct GNUNET_CONNECTION_Handle *
248GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle 248GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle
249 *sched, 249 *sched,
250 GNUNET_NETWORK_AccessCheck access, 250 GNUNET_CONNECTION_AccessCheck access,
251 void *access_cls, struct GNUNET_NETWORK_Descriptor *lsock, 251 void *access_cls, struct GNUNET_NETWORK_Descriptor *lsock,
252 size_t maxbuf) 252 size_t maxbuf)
253{ 253{
@@ -515,7 +515,7 @@ connect_continuation (void *cls,
515 sock->connect_task = GNUNET_SCHEDULER_add_write_net (tc->sched, GNUNET_NO, /* abort on shutdown */ 515 sock->connect_task = GNUNET_SCHEDULER_add_write_net (tc->sched, GNUNET_NO, /* abort on shutdown */
516 GNUNET_SCHEDULER_PRIORITY_KEEP, 516 GNUNET_SCHEDULER_PRIORITY_KEEP,
517 GNUNET_SCHEDULER_NO_TASK, 517 GNUNET_SCHEDULER_NO_TASK,
518 GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT, 518 GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT,
519 sock->sock, 519 sock->sock,
520 &connect_continuation, 520 &connect_continuation,
521 sock); 521 sock);
@@ -571,7 +571,7 @@ GNUNET_CONNECTION_create_from_connect (struct GNUNET_SCHEDULER_Handle
571 ret->connect_task = GNUNET_SCHEDULER_add_write_net (sched, GNUNET_NO, /* abort on shutdown */ 571 ret->connect_task = GNUNET_SCHEDULER_add_write_net (sched, GNUNET_NO, /* abort on shutdown */
572 GNUNET_SCHEDULER_PRIORITY_KEEP, 572 GNUNET_SCHEDULER_PRIORITY_KEEP,
573 GNUNET_SCHEDULER_NO_TASK, 573 GNUNET_SCHEDULER_NO_TASK,
574 GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT, 574 GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT,
575 ret->sock, 575 ret->sock,
576 &connect_continuation, ret); 576 &connect_continuation, ret);
577 return ret; 577 return ret;
@@ -668,7 +668,7 @@ destroy_continuation (void *cls,
668 const struct GNUNET_SCHEDULER_TaskContext *tc) 668 const struct GNUNET_SCHEDULER_TaskContext *tc)
669{ 669{
670 struct GNUNET_CONNECTION_Handle *sock = cls; 670 struct GNUNET_CONNECTION_Handle *sock = cls;
671 GNUNET_NETWORK_TransmitReadyNotify notify; 671 GNUNET_CONNECTION_TransmitReadyNotify notify;
672 672
673 if (sock->write_task != GNUNET_SCHEDULER_NO_TASK) 673 if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
674 { 674 {
@@ -742,7 +742,7 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock)
742static void 742static void
743signal_timeout (struct GNUNET_CONNECTION_Handle *sh) 743signal_timeout (struct GNUNET_CONNECTION_Handle *sh)
744{ 744{
745 GNUNET_NETWORK_Receiver receiver; 745 GNUNET_CONNECTION_Receiver receiver;
746 746
747#if DEBUG_NETWORK 747#if DEBUG_NETWORK
748 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 748 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -760,7 +760,7 @@ signal_timeout (struct GNUNET_CONNECTION_Handle *sh)
760static void 760static void
761signal_error (struct GNUNET_CONNECTION_Handle *sh, int errcode) 761signal_error (struct GNUNET_CONNECTION_Handle *sh, int errcode)
762{ 762{
763 GNUNET_NETWORK_Receiver receiver; 763 GNUNET_CONNECTION_Receiver receiver;
764 GNUNET_assert (NULL != (receiver = sh->receiver)); 764 GNUNET_assert (NULL != (receiver = sh->receiver));
765 sh->receiver = NULL; 765 sh->receiver = NULL;
766 receiver (sh->receiver_cls, NULL, 0, sh->addr, sh->addrlen, errcode); 766 receiver (sh->receiver_cls, NULL, 0, sh->addr, sh->addrlen, errcode);
@@ -778,7 +778,7 @@ receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
778 struct GNUNET_TIME_Absolute now; 778 struct GNUNET_TIME_Absolute now;
779 char buffer[sh->max]; 779 char buffer[sh->max];
780 ssize_t ret; 780 ssize_t ret;
781 GNUNET_NETWORK_Receiver receiver; 781 GNUNET_CONNECTION_Receiver receiver;
782 782
783 sh->read_task = GNUNET_SCHEDULER_NO_TASK; 783 sh->read_task = GNUNET_SCHEDULER_NO_TASK;
784 now = GNUNET_TIME_absolute_get (); 784 now = GNUNET_TIME_absolute_get ();
@@ -914,7 +914,7 @@ GNUNET_SCHEDULER_TaskIdentifier
914GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, 914GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock,
915 size_t max, 915 size_t max,
916 struct GNUNET_TIME_Relative timeout, 916 struct GNUNET_TIME_Relative timeout,
917 GNUNET_NETWORK_Receiver receiver, void *receiver_cls) 917 GNUNET_CONNECTION_Receiver receiver, void *receiver_cls)
918{ 918{
919 struct GNUNET_SCHEDULER_TaskContext tc; 919 struct GNUNET_SCHEDULER_TaskContext tc;
920 920
@@ -966,7 +966,7 @@ process_notify (struct GNUNET_CONNECTION_Handle *sock)
966 size_t used; 966 size_t used;
967 size_t avail; 967 size_t avail;
968 size_t size; 968 size_t size;
969 GNUNET_NETWORK_TransmitReadyNotify notify; 969 GNUNET_CONNECTION_TransmitReadyNotify notify;
970 970
971 GNUNET_assert (sock->write_task == GNUNET_SCHEDULER_NO_TASK); 971 GNUNET_assert (sock->write_task == GNUNET_SCHEDULER_NO_TASK);
972 if (NULL == (notify = sock->nth.notify_ready)) 972 if (NULL == (notify = sock->nth.notify_ready))
@@ -1011,7 +1011,7 @@ static void
1011transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1011transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1012{ 1012{
1013 struct GNUNET_CONNECTION_Handle *sock = cls; 1013 struct GNUNET_CONNECTION_Handle *sock = cls;
1014 GNUNET_NETWORK_TransmitReadyNotify notify; 1014 GNUNET_CONNECTION_TransmitReadyNotify notify;
1015 1015
1016#if DEBUG_NETWORK 1016#if DEBUG_NETWORK
1017 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmit fails, time out reached.\n"); 1017 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmit fails, time out reached.\n");
@@ -1163,11 +1163,11 @@ SCHEDULE_WRITE:
1163 * @return non-NULL if the notify callback was queued, 1163 * @return non-NULL if the notify callback was queued,
1164 * NULL if we are already going to notify someone else (busy) 1164 * NULL if we are already going to notify someone else (busy)
1165 */ 1165 */
1166struct GNUNET_NETWORK_TransmitHandle * 1166struct GNUNET_CONNECTION_TransmitHandle *
1167GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle 1167GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle
1168 *sock, size_t size, 1168 *sock, size_t size,
1169 struct GNUNET_TIME_Relative timeout, 1169 struct GNUNET_TIME_Relative timeout,
1170 GNUNET_NETWORK_TransmitReadyNotify 1170 GNUNET_CONNECTION_TransmitReadyNotify
1171 notify, void *notify_cls) 1171 notify, void *notify_cls)
1172{ 1172{
1173 if (sock->nth.notify_ready != NULL) 1173 if (sock->nth.notify_ready != NULL)
@@ -1229,7 +1229,7 @@ GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle
1229 */ 1229 */
1230void 1230void
1231GNUNET_CONNECTION_notify_transmit_ready_cancel (struct 1231GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
1232 GNUNET_NETWORK_TransmitHandle *h) 1232 GNUNET_CONNECTION_TransmitHandle *h)
1233{ 1233{
1234 GNUNET_assert (h->notify_ready != NULL); 1234 GNUNET_assert (h->notify_ready != NULL);
1235 GNUNET_SCHEDULER_cancel (h->sh->sched, h->timeout_task); 1235 GNUNET_SCHEDULER_cancel (h->sh->sched, h->timeout_task);