aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core_api.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index a123a3a26..ccd159d15 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -354,7 +354,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
354 * @param cls the 'struct GNUNET_CORE_Handle*' 354 * @param cls the 'struct GNUNET_CORE_Handle*'
355 * @param key the peer identity (not used) 355 * @param key the peer identity (not used)
356 * @param value the 'struct PeerRecord' to free. 356 * @param value the 'struct PeerRecord' to free.
357 * @return GNUNET_YES (continue) 357 * @return #GNUNET_YES (continue)
358 */ 358 */
359static int 359static int
360disconnect_and_free_peer_entry (void *cls, const struct GNUNET_HashCode * key, 360disconnect_and_free_peer_entry (void *cls, const struct GNUNET_HashCode * key,
@@ -569,7 +569,7 @@ transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
569 * Transmit the next message to the core service. 569 * Transmit the next message to the core service.
570 * 570 *
571 * @param cls closure with the 'struct GNUNET_CORE_Handle' 571 * @param cls closure with the 'struct GNUNET_CORE_Handle'
572 * @param size number of bytes available in buf 572 * @param size number of bytes available in @a buf
573 * @param buf where the callee should write the message 573 * @param buf where the callee should write the message
574 * @return number of bytes written to buf 574 * @return number of bytes written to buf
575 */ 575 */
@@ -792,7 +792,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
792 /* fake 'connect to self' */ 792 /* fake 'connect to self' */
793 pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &h->me.hashPubKey); 793 pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &h->me.hashPubKey);
794 GNUNET_assert (NULL == pr); 794 GNUNET_assert (NULL == pr);
795 pr = GNUNET_malloc (sizeof (struct PeerRecord)); 795 pr = GNUNET_new (struct PeerRecord);
796 pr->peer = h->me; 796 pr->peer = h->me;
797 pr->ch = h; 797 pr->ch = h;
798 GNUNET_assert (GNUNET_YES == 798 GNUNET_assert (GNUNET_YES ==
@@ -833,7 +833,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
833 reconnect_later (h); 833 reconnect_later (h);
834 return; 834 return;
835 } 835 }
836 pr = GNUNET_malloc (sizeof (struct PeerRecord)); 836 pr = GNUNET_new (struct PeerRecord);
837 pr->peer = cnm->peer; 837 pr->peer = cnm->peer;
838 pr->ch = h; 838 pr->ch = h;
839 GNUNET_assert (GNUNET_YES == 839 GNUNET_assert (GNUNET_YES ==
@@ -1118,13 +1118,13 @@ reconnect (struct GNUNET_CORE_Handle *h)
1118 * @param connects function to call on peer connect, can be NULL 1118 * @param connects function to call on peer connect, can be NULL
1119 * @param disconnects function to call on peer disconnect / timeout, can be NULL 1119 * @param disconnects function to call on peer disconnect / timeout, can be NULL
1120 * @param inbound_notify function to call for all inbound messages, can be NULL 1120 * @param inbound_notify function to call for all inbound messages, can be NULL
1121 * @param inbound_hdr_only set to GNUNET_YES if inbound_notify will only read the 1121 * @param inbound_hdr_only set to #GNUNET_YES if inbound_notify will only read the
1122 * GNUNET_MessageHeader and hence we do not need to give it the full message; 1122 * GNUNET_MessageHeader and hence we do not need to give it the full message;
1123 * can be used to improve efficiency, ignored if inbound_notify is NULLL 1123 * can be used to improve efficiency, ignored if @a inbound_notify is NULLL
1124 * @param outbound_notify function to call for all outbound messages, can be NULL 1124 * @param outbound_notify function to call for all outbound messages, can be NULL
1125 * @param outbound_hdr_only set to GNUNET_YES if outbound_notify will only read the 1125 * @param outbound_hdr_only set to #GNUNET_YES if outbound_notify will only read the
1126 * GNUNET_MessageHeader and hence we do not need to give it the full message 1126 * GNUNET_MessageHeader and hence we do not need to give it the full message
1127 * can be used to improve efficiency, ignored if outbound_notify is NULLL 1127 * can be used to improve efficiency, ignored if @a outbound_notify is NULLL
1128 * @param handlers callbacks for messages we care about, NULL-terminated 1128 * @param handlers callbacks for messages we care about, NULL-terminated
1129 * @return handle to the core service (only useful for disconnect until 'init' is called); 1129 * @return handle to the core service (only useful for disconnect until 'init' is called);
1130 * NULL on error (in this case, init is never called) 1130 * NULL on error (in this case, init is never called)
@@ -1143,7 +1143,7 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
1143{ 1143{
1144 struct GNUNET_CORE_Handle *h; 1144 struct GNUNET_CORE_Handle *h;
1145 1145
1146 h = GNUNET_malloc (sizeof (struct GNUNET_CORE_Handle)); 1146 h = GNUNET_new (struct GNUNET_CORE_Handle);
1147 h->cfg = cfg; 1147 h->cfg = cfg;
1148 h->cls = cls; 1148 h->cls = cls;
1149 h->init = init; 1149 h->init = init;
@@ -1220,7 +1220,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
1220/** 1220/**
1221 * Task that calls 'request_next_transmission'. 1221 * Task that calls 'request_next_transmission'.
1222 * 1222 *
1223 * @param cls the 'struct PeerRecord*' 1223 * @param cls the 'struct PeerRecord *'
1224 * @param tc scheduler context 1224 * @param tc scheduler context
1225 */ 1225 */
1226static void 1226static void
@@ -1235,13 +1235,13 @@ run_request_next_transmission (void *cls,
1235 1235
1236 1236
1237/** 1237/**
1238 * Ask the core to call "notify" once it is ready to transmit the 1238 * Ask the core to call @a notify once it is ready to transmit the
1239 * given number of bytes to the specified "target". Must only be 1239 * given number of bytes to the specified @a target. Must only be
1240 * called after a connection to the respective peer has been 1240 * called after a connection to the respective peer has been
1241 * established (and the client has been informed about this). You may 1241 * established (and the client has been informed about this). You may
1242 * have one request of this type pending for each connected peer at 1242 * have one request of this type pending for each connected peer at
1243 * any time. If a peer disconnects, the application MUST call 1243 * any time. If a peer disconnects, the application MUST call
1244 * "GNUNET_CORE_notify_transmit_ready_cancel" on the respective 1244 * #GNUNET_CORE_notify_transmit_ready_cancel on the respective
1245 * transmission request, if one such request is pending. 1245 * transmission request, if one such request is pending.
1246 * 1246 *
1247 * @param handle connection to core service 1247 * @param handle connection to core service
@@ -1249,7 +1249,7 @@ run_request_next_transmission (void *cls,
1249 * @param priority how important is the message? 1249 * @param priority how important is the message?
1250 * @param maxdelay how long can the message wait? 1250 * @param maxdelay how long can the message wait?
1251 * @param target who should receive the message, never NULL (can be this peer's identity for loopback) 1251 * @param target who should receive the message, never NULL (can be this peer's identity for loopback)
1252 * @param notify_size how many bytes of buffer space does notify want? 1252 * @param notify_size how many bytes of buffer space does @a notify want?
1253 * @param notify function to call when buffer space is available; 1253 * @param notify function to call when buffer space is available;
1254 * will be called with NULL on timeout; clients MUST cancel 1254 * will be called with NULL on timeout; clients MUST cancel
1255 * all pending transmission requests DURING the disconnect 1255 * all pending transmission requests DURING the disconnect
@@ -1257,7 +1257,7 @@ run_request_next_transmission (void *cls,
1257 * @param notify_cls closure for notify 1257 * @param notify_cls closure for notify
1258 * @return non-NULL if the notify callback was queued, 1258 * @return non-NULL if the notify callback was queued,
1259 * NULL if we can not even queue the request (request already pending); 1259 * NULL if we can not even queue the request (request already pending);
1260 * if NULL is returned, "notify" will NOT be called. 1260 * if NULL is returned, @a notify will NOT be called.
1261 */ 1261 */
1262struct GNUNET_CORE_TransmitHandle * 1262struct GNUNET_CORE_TransmitHandle *
1263GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, 1263GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,