aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/connect/ei_connect.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2009-12-08 10:17:45 +0000
committerErlang/OTP <[email protected]>2009-12-08 10:17:45 +0000
commit75ec723f1dcb6e76b481e64f01d72a43df39b276 (patch)
treee8e504ad3596f2e4b341dfcac9bcd442dc00703b /lib/erl_interface/src/connect/ei_connect.c
parentee51ffa886cdbc7a577d6e068236c107f0137696 (diff)
downloadotp-75ec723f1dcb6e76b481e64f01d72a43df39b276.tar.gz
otp-75ec723f1dcb6e76b481e64f01d72a43df39b276.tar.bz2
otp-75ec723f1dcb6e76b481e64f01d72a43df39b276.zip
OTP-5037 Document debug support.
Debug trace output for connection activity could be enabled setting the trace level as an integer to the EI_TRACELEVEL environment variable. This option could also be read and set from a running program using ei_get_tracelevel(void) and ei_set_tracelevel(int).
Diffstat (limited to 'lib/erl_interface/src/connect/ei_connect.c')
-rw-r--r--lib/erl_interface/src/connect/ei_connect.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index 9ac5a93c5a..265e133158 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -97,7 +97,11 @@
#include "ei_epmd.h"
#include "ei_internal.h"
+#ifdef _REENTRANT
+
+#else
int ei_tracelevel = 0;
+#endif
#define COOKIE_FILE "/.erlang.cookie"
#define EI_MAX_HOME_PATH 1024
@@ -249,8 +253,22 @@ ei_cnode *ei_fd_to_cnode(int fd)
return &sockinfo->cnode;
}
+
+/***************************************************************************
+ * Get/Set tracelevel
+ ***************************************************************************/
+
+void ei_set_tracelevel(int level) {
+ ei_tracelevel = level;
+}
+
+int ei_get_tracelevel(void) {
+ return ei_tracelevel;
+}
+
+
/***************************************************************************
- * XXXX
+ * Distversion
***************************************************************************/
int ei_distversion(int fd)
@@ -1282,8 +1300,6 @@ error:
return -1;
}
-/* FIXME fix the signed/unsigned mess..... */
-
static int send_name_or_challenge(int fd, char *nodename,
int f_chall,
unsigned challenge,