summaryrefslogtreecommitdiffstats
path: root/sesman/libscp
diff options
context:
space:
mode:
authorilsimo <ilsimo>2008-02-21 15:50:31 +0000
committerilsimo <ilsimo>2008-02-21 15:50:31 +0000
commit57484bd7016c6e56854dc4c34ac0dc8077a07014 (patch)
treedc081809815ab499c9b8827fc92e7c2b7b03df09 /sesman/libscp
parent4c9d3862e55ab5d6fa734549478bb0a00be9f7ed (diff)
downloadxrdp-proprietary-57484bd7016c6e56854dc4c34ac0dc8077a07014.tar.gz
xrdp-proprietary-57484bd7016c6e56854dc4c34ac0dc8077a07014.zip
more work on logging
Diffstat (limited to 'sesman/libscp')
-rw-r--r--sesman/libscp/Makefile3
-rw-r--r--sesman/libscp/libscp_init.c31
-rw-r--r--sesman/libscp/libscp_init.h13
-rw-r--r--sesman/libscp/libscp_session.c50
4 files changed, 54 insertions, 43 deletions
diff --git a/sesman/libscp/Makefile b/sesman/libscp/Makefile
index fa2d594d..1e88c82d 100644
--- a/sesman/libscp/Makefile
+++ b/sesman/libscp/Makefile
@@ -21,7 +21,8 @@ DEFINES = -DSESMAN_CFG_FILE=\"$(CFGDIR)/sesman.ini\" \
-DSESMAN_PID_FILE=\"$(PIDDIR)/sesman.pid\" \
-DSESMAN_SESSVC_FILE=\"sessvc\"
-CFLAGS = -Wall -O2 -I../../common -I/usr/include/nptl -fPIC $(DEFINES)
+#CFLAGS = -Wall -O2 -I../../common -I/usr/include/nptl -fPIC $(DEFINES)
+CFLAGS = -Wall -g -I../../common -I/usr/include/nptl -fPIC $(DEFINES)
LDFLAGS = -shared -L/usr/gnu/lib -L/usr/lib/nptl -lpthread
C_OS_FLAGS = $(CFLAGS) -c
CC = gcc
diff --git a/sesman/libscp/libscp_init.c b/sesman/libscp/libscp_init.c
index d35fb8d1..4f54f6cc 100644
--- a/sesman/libscp/libscp_init.c
+++ b/sesman/libscp/libscp_init.c
@@ -27,32 +27,21 @@
#include "libscp_init.h"
+static struct log_config* s_log;
+
/* server API */
int DEFAULT_CC
-scp_init(void)
-{
- scp_lock_init();
-
- return 0;
-}
-
-struct SCP_CONNECTION*
-scp_make_connection(int sck)
+scp_init(struct log_config* log)
{
- struct SCP_CONNECTION* conn;
-
- conn = g_malloc(sizeof(struct SCP_CONNECTION), 0);
-
- if (0 == conn)
+ if (0 == log)
{
- return 0;
+ return 1;
}
- conn->in_sck = sck;
- make_stream(conn->in_s);
- init_stream(conn->in_s, 8196);
- make_stream(conn->out_s);
- init_stream(conn->out_s, 8196);
+ s_log = log;
+
+ scp_lock_init();
- return conn;
+ return 0;
}
+
diff --git a/sesman/libscp/libscp_init.h b/sesman/libscp/libscp_init.h
index efccb30f..5acdbc2c 100644
--- a/sesman/libscp/libscp_init.h
+++ b/sesman/libscp/libscp_init.h
@@ -28,6 +28,8 @@
#ifndef LIBSCP_INIT_H
#define LIBSCP_INIT_H
+#include "log.h"
+
#include "libscp.h"
/**
@@ -40,16 +42,7 @@
*
*/
int DEFAULT_CC
-scp_init(void);
-
-/**
- *
- * @brief mmm
- * @param sck
- *
- */
-struct SCP_CONNECTION*
-scp_make_connection(int sck);
+scp_init(struct log_config* log);
#endif
diff --git a/sesman/libscp/libscp_session.c b/sesman/libscp/libscp_session.c
index dac31877..916424d9 100644
--- a/sesman/libscp/libscp_session.c
+++ b/sesman/libscp/libscp_session.c
@@ -43,7 +43,7 @@ scp_session_create()
s->password=0;
s->hostname=0;
s->errstr=0;
-#warning usare scp_session_set* per inizializzare la sessione!!!!!!
+#warning FIXME use scp_session_set* to init session
return s;
}
@@ -135,7 +135,10 @@ scp_session_set_rsr(struct SCP_SESSION* s, tui8 rsr)
int
scp_session_set_locale(struct SCP_SESSION* s, char* str)
{
- if (0 == str) return 1;
+ if (0 == str)
+ {
+ return 1;
+ }
g_strncpy(s->locale, str, 17);
s->locale[17]='\0';
return 0;
@@ -145,8 +148,14 @@ scp_session_set_locale(struct SCP_SESSION* s, char* str)
int
scp_session_set_username(struct SCP_SESSION* s, char* str)
{
- if (0 == str) return 1;
- if (0 != s->username) g_free(s->username);
+ if (0 == str)
+ {
+ return 1;
+ }
+ if (0 != s->username)
+ {
+ g_free(s->username);
+ }
s->username = g_strdup(str);
return 0;
}
@@ -155,8 +164,14 @@ scp_session_set_username(struct SCP_SESSION* s, char* str)
int
scp_session_set_password(struct SCP_SESSION* s, char* str)
{
- if (0 == str) return 1;
- if (0 != s->password) g_free(s->password);
+ if (0 == str)
+ {
+ return 1;
+ }
+ if (0 != s->password)
+ {
+ g_free(s->password);
+ }
s->password = g_strdup(str);
return 0;
}
@@ -165,8 +180,14 @@ scp_session_set_password(struct SCP_SESSION* s, char* str)
int
scp_session_set_hostname(struct SCP_SESSION* s, char* str)
{
- if (0 == str) return 1;
- if (0 != s->hostname) g_free(s->hostname);
+ if (0 == str)
+ {
+ return 1;
+ }
+ if (0 != s->hostname)
+ {
+ g_free(s->hostname);
+ }
s->hostname = g_strdup(str);
return 0;
}
@@ -175,8 +196,14 @@ scp_session_set_hostname(struct SCP_SESSION* s, char* str)
int
scp_session_set_errstr(struct SCP_SESSION* s, char* str)
{
- if (0 == str) return 1;
- if (0 != s->errstr) g_free(s->errstr);
+ if (0 == str)
+ {
+ return 1;
+ }
+ if (0 != s->errstr)
+ {
+ g_free(s->errstr);
+ }
s->errstr = g_strdup(str);
return 0;
}
@@ -193,7 +220,8 @@ scp_session_set_display(struct SCP_SESSION* s, SCP_DISPLAY display)
int
scp_session_set_addr(struct SCP_SESSION* s, int type, char* addr)
{
-
+#warning FIXME managing addresses
+ return 1;
}
/*******************************************************************/