reset_stream (struct StreamHandle *sh)
{
struct GSF_StreamRequest *sr;
-
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Resetting stream to %s\n",
+ GNUNET_i2s (&sh->target));
if (NULL != sh->rh)
GNUNET_STREAM_io_read_cancel (sh->rh);
GNUNET_STREAM_close (sh->stream);
{
struct StreamHandle *sh = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Timeout on stream to %s\n",
+ GNUNET_i2s (&sh->target));
sh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
destroy_stream_handle (sh);
}
struct StreamHandle *sh = cls;
sh->rh = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received %u bytes from stream to %s\n",
+ (unsigned int) size,
+ GNUNET_i2s (&sh->target));
if (GNUNET_SYSERR ==
GNUNET_SERVER_mst_receive (sh->mst,
NULL,
reset_stream (sh);
return;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Successfully transmitted %u bytes via stream to %s\n",
+ (unsigned int) size,
+ GNUNET_i2s (&sh->target));
if (NULL == sh->rh)
sh->rh = GNUNET_STREAM_read (sh->stream,
GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_CONTAINER_DLL_insert_tail (sh->waiting_head,
sh->waiting_tail,
sr);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Sending query via stream to %s\n",
+ GNUNET_i2s (&sh->target));
sr->was_transmitted = GNUNET_YES;
sqm.header.size = htons (sizeof (sqm));
sqm.header.type = htons (GNUNET_MESSAGE_TYPE_FS_STREAM_QUERY);
}
return sh;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Creating stream to %s\n",
+ GNUNET_i2s (target));
sh = GNUNET_malloc (sizeof (struct StreamHandle));
sh->mst = GNUNET_SERVER_mst_create (&reply_cb,
sh);
struct StreamHandle *sh;
struct GSF_StreamRequest *sr;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Preparing to send query for %s via stream to %s\n",
+ GNUNET_h2s (query),
+ GNUNET_i2s (target));
sh = get_stream (target);
sr = GNUNET_malloc (sizeof (struct GSF_StreamRequest));
sr->sh = sh;
int ret;
sc->rh = NULL;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received %u byte query via stream\n",
+ (unsigned int) size);
switch (status)
{
case GNUNET_STREAM_OK:
if ( (GNUNET_STREAM_OK == status) &&
(size == sc->reply_size) )
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmitted %u byte reply via stream\n",
+ (unsigned int) size);
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop ("# Blocks transferred via stream"), 1,
GNUNET_NO);
continue_reading (sc);
}
else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmission of reply failed, terminating stream\n");
terminate_stream (sc);
+ }
}
continue_reading (sc);
return;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Starting transmission of %u byte reply via stream\n",
+ (unsigned int) size);
srm->header.size = htons ((uint16_t) msize);
srm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_STREAM_REPLY);
srm->type = htonl (type);
if (NULL == socket)
return GNUNET_SYSERR;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Accepting inbound stream connection from `%s'\n",
+ GNUNET_i2s (initiator));
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop ("# stream connections active"), 1,
GNUNET_NO);