This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gokdrive. commit 5580cf9153f5af72051c013e1070ef9c549e2c04 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jun 13 23:56:14 2021 +0200 x2gokdrivedebug.h: Introduce this new file and move all EPHYR_DBG stuff into there. And: disable EPHYR_WANT_DEBUG as with it, the project fails to build with standard Debian compiler flags." --- x2gokdrive.c | 1 + x2gokdrivedebug.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ x2gokdriveinit.c | 1 + x2gokdriveremote.c | 3 +++ x2gokdriveremote.h | 21 --------------------- x2gokdriveselection.c | 3 +++ 6 files changed, 59 insertions(+), 21 deletions(-) diff --git a/x2gokdrive.c b/x2gokdrive.c index 8673a6e..a98afd8 100644 --- a/x2gokdrive.c +++ b/x2gokdrive.c @@ -43,6 +43,7 @@ #include "inputstr.h" #include "scrnintstr.h" +#include "x2gokdrivedebug.h" #include "x2gokdrivelog.h" #include "xkbsrv.h" diff --git a/x2gokdrivedebug.h b/x2gokdrivedebug.h new file mode 100644 index 0000000..86368ef --- /dev/null +++ b/x2gokdrivedebug.h @@ -0,0 +1,51 @@ +/* + * X2GoKDrive - A kdrive X server for X2Go (based on Xephyr) + * Author Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> + * + * Copyright © 2018 phoca-GmbH + * + * + * + * Xephyr - A kdrive X server thats runs in a host X window. + * Authored by Matthew Allum <mallum@o-hand.com> + * + * Copyright © 2004 Nokia + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef X2GOKDRIVEDEBUG_H +#define X2GOKDRIVEDEBUG_H + +// # warning DEBUG ENABLED +// #define EPHYR_WANT_DEBUG + +#ifdef EPHYR_WANT_DEBUG +#define EPHYR_DBG(x, a...) \ +if(pthread_self()==debug_sendThreadId)\ +fprintf(stderr,"SEND:"__FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a);\ +else if (pthread_self()==debug_selectThreadId)\ +fprintf(stderr,"SEL:"__FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a);\ +else \ +fprintf(stderr,"MAIN:"__FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a) +#else +#define EPHYR_DBG(x, a...) do {} while (0) +#endif + +#ifdef EPHYR_WANT_DEBUG +unsigned long long int debug_sendThreadId; +unsigned long long int debug_selectThreadId; +#endif /* EPHYR_WANT_DEBUG */ + +#endif /* X2GOKDRIVE_H */ diff --git a/x2gokdriveinit.c b/x2gokdriveinit.c index b2400b9..ac07132 100644 --- a/x2gokdriveinit.c +++ b/x2gokdriveinit.c @@ -38,6 +38,7 @@ #include "x2gokdrivelog.h" #include "glx_extinit.h" #include "x2gokdriveremote.h" +#include "x2gokdrivedebug.h" extern Window EphyrPreExistingHostWin; extern Bool EphyrWantGrayScale; diff --git a/x2gokdriveremote.c b/x2gokdriveremote.c index f317cb3..fb5165e 100644 --- a/x2gokdriveremote.c +++ b/x2gokdriveremote.c @@ -35,6 +35,7 @@ #endif #include "x2gokdriveremote.h" +#include "x2gokdrivedebug.h" #include "x2gokdriveselection.h" #include <zlib.h> @@ -1436,7 +1437,9 @@ void *send_frame_thread (void *threadid) { enum SelectionType r; +#ifdef EPHYR_WANT_DEBUG debug_sendThreadId=pthread_self(); +#endif /* EPHYR_WANT_DEBUG */ while(1) { diff --git a/x2gokdriveremote.h b/x2gokdriveremote.h index d7d368b..b658e1b 100644 --- a/x2gokdriveremote.h +++ b/x2gokdriveremote.h @@ -100,24 +100,6 @@ //Changes 3 - 4: extended clipboard support for web client #define FEATURE_VERSION 4 - -#define EPHYR_WANT_DEBUG 1 -// #warning DEBUG ENABLED - - -#if (EPHYR_WANT_DEBUG) -#define EPHYR_DBG(x, a...) \ -if(pthread_self()==debug_sendThreadId)\ -fprintf(stderr,"SEND:"__FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a);\ -else if (pthread_self()==debug_selectThreadId)\ -fprintf(stderr,"SEL:"__FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a);\ -else \ -fprintf(stderr,"MAIN:"__FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a) -#else -#define EPHYR_DBG(x, a...) do {} while (0) -#endif - - #define MAXMSGSIZE 1024*16 //port to listen by default @@ -450,9 +432,6 @@ struct _remoteHostVars struct SelectionStructure selstruct; } ; -unsigned long long int debug_sendThreadId; -unsigned long long int debug_selectThreadId; - int send_selection_chunk(int sel, unsigned char* data, uint32_t length, uint32_t format, BOOL first, BOOL last, uint32_t compressed, uint32_t total); int send_output_selection(struct OutputChunk* chunk); diff --git a/x2gokdriveselection.c b/x2gokdriveselection.c index d996320..89aa3ed 100644 --- a/x2gokdriveselection.c +++ b/x2gokdriveselection.c @@ -45,6 +45,7 @@ #endif #include "x2gokdriveselection.h" +#include "x2gokdrivedebug.h" #define SELECTION_DELAY 30000 //timeout for selection operation #define INCR_SIZE 256*1024 //size of part for incr selection incr selection @@ -931,7 +932,9 @@ void *selection_thread (void* id) xcb_xfixes_query_version_cookie_t xfixes_query_cookie; xcb_xfixes_query_version_reply_t *xfixes_query; +#ifdef EPHYR_WANT_DEBUG debug_selectThreadId=pthread_self(); +#endif /* EPHYR_WANT_DEBUG */ /* Create the window */ remoteVars->selstruct.xcbConnection = xcb_connect (RemoteHostVars.displayName, NULL); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdrive.git