Commit 161b5788 authored by Claes Sjofors's avatar Claes Sjofors

Merge branch 'master' of newton:/data1/x0-0-0/pwr

parents 047b4b16 63824ffe
...@@ -863,14 +863,17 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size, ...@@ -863,14 +863,17 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size,
sev_sHistData *dp; sev_sHistData *dp;
pwr_tTime time; pwr_tTime time;
pwr_tUInt32 server_thread; pwr_tUInt32 server_thread;
int data_size;
if ( msg->Version == 0) { if ( msg->Version == 0) {
// Server thread was added in version 1 // Server thread was added in version 1
dp = (sev_sHistData *) &((sev_sMsgHistDataStoreV0 *)msg)->Data; dp = (sev_sHistData *) &((sev_sMsgHistDataStoreV0 *)msg)->Data;
data_size = size - (sizeof(sev_sMsgHistDataStoreV0) - sizeof(msg->Data));
server_thread = 0; server_thread = 0;
} }
else { else {
dp = (sev_sHistData *) &msg->Data; dp = (sev_sHistData *) &msg->Data;
data_size = size - (sizeof(*msg) - sizeof(msg->Data));
server_thread = msg->ServerThread; server_thread = msg->ServerThread;
} }
...@@ -904,6 +907,7 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size, ...@@ -904,6 +907,7 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size,
else { else {
sev_sThread *th; sev_sThread *th;
sev_sQMsgHistData *qmsg; sev_sQMsgHistData *qmsg;
int qmsg_size;
pwr_tUInt32 key; pwr_tUInt32 key;
if ( m_thread_key_node) if ( m_thread_key_node)
...@@ -918,18 +922,20 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size, ...@@ -918,18 +922,20 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size,
} }
// Create a queue message // Create a queue message
if ( (int)(th->alloc + sizeof(*qmsg) - sizeof(qmsg->data) + size) > (int)m_config->ThreadQueueLimit || qmsg_size = data_size + (sizeof(*qmsg) - sizeof(qmsg->data));
(int)(m_total_queue_cnt + sizeof(*qmsg) - sizeof(qmsg->data) + size) > (int)m_config->TotalQueueLimit) {
if ( (int)(th->alloc + qmsg_size) > (int)m_config->ThreadQueueLimit ||
(int)(m_total_queue_cnt + qmsg_size) > (int)m_config->TotalQueueLimit) {
// Queue maxlimit exceeded, discard message // Queue maxlimit exceeded, discard message
m_config->ServerThreads[th->conf_idx].LostCnt++; m_config->ServerThreads[th->conf_idx].LostCnt++;
return 1; return 1;
} }
qmsg = (sev_sQMsgHistData *)malloc( sizeof(*qmsg) - sizeof(qmsg->data) + size); qmsg = (sev_sQMsgHistData *)malloc( qmsg_size);
memcpy( &qmsg->data, dp, size); memcpy( &qmsg->data, dp, data_size);
qmsg->h.type = sev_eQMsgType_HistData; qmsg->h.type = sev_eQMsgType_HistData;
qmsg->h.version = msg->Version; qmsg->h.version = msg->Version;
qmsg->h.size = size; qmsg->h.size = qmsg_size;
qmsg->time = msg->Time; qmsg->time = msg->Time;
lst_Init( NULL, &qmsg->h.e, qmsg); lst_Init( NULL, &qmsg->h.e, qmsg);
...@@ -1450,12 +1456,13 @@ void *sev_server::receive_histdata_thread( void *arg) ...@@ -1450,12 +1456,13 @@ void *sev_server::receive_histdata_thread( void *arg)
case sev_eQMsgType_HistData: { case sev_eQMsgType_HistData: {
sev_sHistData *dp; sev_sHistData *dp;
sev_sQMsgHistData *msg = (sev_sQMsgHistData *)qmsg; sev_sQMsgHistData *msg = (sev_sQMsgHistData *)qmsg;
int data_size = msg->h.size - (sizeof(*msg) - sizeof(msg->data));
dp = (sev_sHistData *) &msg->data; dp = (sev_sHistData *) &msg->data;
sev->m_db->begin_transaction( th->db_ctx); sev->m_db->begin_transaction( th->db_ctx);
while ( (char *)dp - (char *)msg < (int)msg->h.size) { while ( (char *)dp - (char *)msg->data < data_size) {
sev_sRefid *rp; sev_sRefid *rp;
pwr_tRefId rk = dp->sevid; pwr_tRefId rk = dp->sevid;
......
...@@ -124,10 +124,10 @@ log_done = ...@@ -124,10 +124,10 @@ log_done =
#cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \ #cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \
`pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk) $(clibusb) `pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk) $(clibusb)
csetos := $(pwre_conf_cc_define) csetos := $(pwre_conf_cc_define)
ifeq ($(flavour),gtk) ifeq ($(flavour),qt)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst)
else
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirqt) cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirqt)
else
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst)
endif endif
rm := rm rm := rm
cp := cp cp := cp
......
...@@ -462,11 +462,11 @@ else ...@@ -462,11 +462,11 @@ else
#Gtk #Gtk
echo "Mandatory :" echo "Mandatory :"
if [ $pwre_conf_qt -eq 1 ]; then # if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so" # pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
else # else
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so" pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
fi # fi
pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 "/usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a:/usr/lib/$hwpl-linux-$gnu/librpcsvc.a" pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 "/usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a:/usr/lib/$hwpl-linux-$gnu/librpcsvc.a"
pwre_config_check_lib libasound LIBASOUND lib lib 0 "/usr/lib/libasound.so:/usr/lib/libasound.a:/usr/lib/$hwpl-linux-$gnu/libasound.so" pwre_config_check_lib libasound LIBASOUND lib lib 0 "/usr/lib/libasound.so:/usr/lib/libasound.a:/usr/lib/$hwpl-linux-$gnu/libasound.so"
...@@ -480,11 +480,11 @@ else ...@@ -480,11 +480,11 @@ else
pwre_config_check_lib libfl LIBFL lib lib 0 "/usr/lib/libfl.so:/usr/lib/libfl.a:/usr/lib/$hwpl-linux-$gnu/libfl.so" pwre_config_check_lib libfl LIBFL lib lib 0 "/usr/lib/libfl.so:/usr/lib/libfl.a:/usr/lib/$hwpl-linux-$gnu/libfl.so"
pwre_config_check_lib libX11 LIBX11 lib lib 0 "/usr/lib/libX11.so:/usr/lib/$hwpl-linux-$gnu/libX11.so" pwre_config_check_lib libX11 LIBX11 lib lib 0 "/usr/lib/libX11.so:/usr/lib/$hwpl-linux-$gnu/libX11.so"
if [ $pwre_conf_qt -eq 1 ]; then # if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui" # pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
else # else
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h" pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
fi # fi
pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h" pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h"
echo "" echo ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment