Index: libfdcore/cnxctx.c
===================================================================
--- libfdcore/cnxctx.c	(revision 709)
+++ libfdcore/cnxctx.c	(revision 710)
@@ -622,6 +622,7 @@
 again:
 	ret = recv(conn->cc_socket, buffer, length, 0);
-	/* Handle special case of timeout */
-	if ((ret < 0) && (errno == EAGAIN)) {
+	/* Handle special case of timeout / interrupts */
+	if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) {
+		pthread_testcancel();
 		if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING ))
 			goto again; /* don't care, just ignore */
@@ -649,5 +650,6 @@
 	ret = send(conn->cc_socket, buffer, length, 0);
 	/* Handle special case of timeout */
-	if ((ret < 0) && (errno == EAGAIN)) {
+	if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) {
+		pthread_testcancel();
 		if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING ))
 			goto again; /* don't care, just ignore */
Index: libfdcore/sctp.c
===================================================================
--- libfdcore/sctp.c	(revision 706)
+++ libfdcore/sctp.c	(revision 710)
@@ -1041,5 +1041,6 @@
 	ret = sendmsg(conn->cc_socket, &mhdr, 0);
 	/* Handle special case of timeout */
-	if ((ret < 0) && (errno == EAGAIN)) {
+	if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) {
+		pthread_testcancel();
 		if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING ))
 			goto again; /* don't care, just ignore */
@@ -1099,8 +1100,9 @@
 	pthread_cleanup_push(free, data);
 	ret = recvmsg(conn->cc_socket, &mhdr, 0);
+	pthread_testcancel();
 	pthread_cleanup_pop(0);
 	
 	/* First, handle timeouts (same as fd_cnx_s_recv) */
-	if ((ret < 0) && (errno == EAGAIN)) {
+	if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) {
 		if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING ))
 			goto again; /* don't care, just ignore */
Index: libfdproto/fdproto-internal.h
===================================================================
--- libfdproto/fdproto-internal.h	(revision 706)
+++ libfdproto/fdproto-internal.h	(revision 710)
@@ -52,4 +52,5 @@
 
 /* Special message dump function */
+void fd_msg_dump_fstr_one ( struct msg * msg, FILE * fstr );
 void fd_msg_dump_fstr ( struct msg * msg, FILE * fstr );
 
Index: libfdproto/messages.c
===================================================================
--- libfdproto/messages.c	(revision 706)
+++ libfdproto/messages.c	(revision 710)
@@ -808,4 +808,8 @@
 	} while (ref);
 }
+void fd_msg_dump_fstr_one ( struct msg * msg, FILE * fstr ) /* just the header */
+{
+	msg_dump_intern ( NONE, msg, 2, fstr );
+}
 
 /* Dump a message content -- for debug mostly */
Index: libfdproto/msg_log.c
===================================================================
--- libfdproto/msg_log.c	(revision 689)
+++ libfdproto/msg_log.c	(revision 710)
@@ -109,4 +109,9 @@
 	FILE * fstr;
 	
+	char buftime[256];
+	size_t offset = 0;
+	struct timespec ts;
+	struct tm tm;
+	
 	TRACE_ENTRY("%d %p %p", cause, msg, prefix_format);
 	CHECK_PARAMS_DO( (cause >= 0) && (cause <= FD_MSG_LOG_MAX),
@@ -125,4 +130,10 @@
 	CHECK_POSIX_DO( pthread_mutex_unlock(&ml_conf.lock), );
 	
+	/* Get current time */
+	CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &ts), /* continue */);
+	offset += strftime(buftime + offset, sizeof(buftime) - offset, "%D,%T", localtime_r( &ts.tv_sec , &tm ));
+	offset += snprintf(buftime + offset, sizeof(buftime) - offset, ".%6.6ld", ts.tv_nsec / 1000);
+	
+
 	/* Okay, now we will create the file descriptor */
 	switch (meth) {
@@ -142,5 +153,5 @@
 	
 	/* For file methods, let's parse the message so it looks better */
-	if ((meth != FD_MSG_LOGTO_DEBUGONLY) && ml_conf.dict) {
+	if (((meth != FD_MSG_LOGTO_DEBUGONLY) || (fd_g_debug_lvl > FULL)) && ml_conf.dict) {
 		CHECK_FCT_DO( fd_msg_parse_dict( msg, ml_conf.dict, NULL ), );
 	}
@@ -155,11 +166,28 @@
 	pthread_cleanup_pop(0);
 	(void)pthread_mutex_unlock(&fd_log_lock);
-	fd_log_debug_fstr(fstr, "\n\n");
+	
+	fd_log_debug_fstr(fstr, "\nLogged: %s\n\n", buftime);
 	
 	/* And now the message itself */
-	fd_msg_dump_fstr(msg, fstr);
+	if ((meth == FD_MSG_LOGTO_DEBUGONLY) && (fd_g_debug_lvl <= INFO)) {
+		/* dump only the header */
+		fd_msg_dump_fstr_one(msg, fstr);
+	} else {
+		/* dump the full content */
+		fd_msg_dump_fstr(msg, fstr);
+	}
 	
 	/* And finally close the stream if needed */
-	TODO("close?");
+	switch (meth) {
+		case FD_MSG_LOGTO_DEBUGONLY:
+			break;
+			
+		case FD_MSG_LOGTO_FILE:
+			TODO("close?");
+			break;
+		case FD_MSG_LOGTO_DIR:
+			TODO("close?");
+			break;
+	}
 }
 
