Age | Commit message (Collapse) | Author | Files | Lines |
|
All versions now perform same check for XtransConn data to decide
whether to use _X11TransClose or regular close, which is needed for
being able to read data from pre-recorded files instead of live sockets.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
We don't print any other data from packet when Verbose == 0, just had
a few random "data: (6)" type lines sneak through.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Avoids having to try to time a ^C after the signal handler is set up
but before any data is handled.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Prints atoms, cardinals, integers, and windows as formatted values
instead of lists of bytes.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
Currently used for core protocol window properties, but will be
used for extensions that have similar property handling requests
in the future.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Uses them to display strings instead of just numeric ids for atoms
beyond the builtin set in other requests, such as property lookups.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Used for GC struct members, which are defined in the protocol as 32-bit,
so no need to waste time and memory copying into 64-bit longs everywhere
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Adds a getreqlen inline function to handle the big requests check.
As noted in the comment, it must be called *before* the printreqlen
macro does its own check, since printreqlen "fixes" the buf pointer
when it's done to align all the remaining fields with their correct
positions after skipping over the extra big requests 32-bit length
field after the normal 16-bit length field.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
instead of shifting the whole word as each byte is loaded into place
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
Clears gcc warning from casting a const char * to char *:
server.c: In function `SaveBytes':
server.c:203: warning: cast discards qualifiers from pointer target type
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
|
Fixes compiler warning:
"fd.c", line 481: warning: statement not reached
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Performed with util/modular/x-indent-all.sh, followed by manual fixups
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Reading through Xtranssock.c reveals that when _X11TransConnect returns the
value TRANS_TRY_CONNECT_AGAIN, it turns off the abstract socket flag, so
that attempting _X11TransConnect might succeed the second time where it
failed the first time.
Now xscope will attempt the connection a second time when it receives the
TRANS_TRY_CONNECT_AGAIN return value on the first connection attempt.
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
In USE_XTRANS mode, MakeConnection() cycles through a selection of
protocol choices until it finds one where it can open a socket to
the server. It then attempts an X11 connection via that socket and
aborts if one isn't possible.
This patch modifies the code to try an alternate protocol if the X11
connection fails.
https://bugs.freedesktop.org/show_bug.cgi?id=46696
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=46691
Use correct write FD to select() on.
FlushFD() contains logic to handle the Xclient or Xserver blocking on
a write() by changing the global read and write fd_set's so that
MainLoop() will select() on the blocking write FD instead of the peer
read FD. Unfortunately, the code contains a logic error so that it
winds up select()ing for write on the peer FD instead of the blocked FD.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Different platforms use different names for the fd_set members,
so use the existing Xpoll.h macros for greater portability.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=46689
Change fd_set debug output to display actual contents of first 32 or 64 bits.
In xscope-1.3.1, MainLoop() contains debug(128,...) code that appears
intended to display the fd_set contents before and after the main
select() call. In most implementations, fd_set will be a struct though
it is printed as an int, thus the actual debug output is unlikely to
usefully reflect the actual fd_set contents.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=46664
The length fields for PolyText16 and ImageText16 represent the number of
16-bit characters in the request but PrintString16() and PrintTString16()
treat the lengths as the number of octets in the string - thus printing
only half of the characters.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Error detected by Solaris Studio 12.3 code analyzer:
WARNING 1 (MRC): missing null-pointer check after malloc: calloc(((ullong)MaxFD),48) at:
InitializeFD() <app/xscope/fd.c : 107>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Makes the dependency on x11proto explicit - it was already needed for
the X11 headers included in various files, but now needs to be at least
7.0.17 for the _X_NORETURN definition in Xfuncproto.h
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Required in order to build with Studio cc now that xorg-macros is
setting -errwarn=E_FUNC_HAS_NO_RETURN_STMT since a bug in the Solaris
system headers causes the noreturn attribute to not be correctly
applied to the exit() prototype in <stdlib.h> when building with
Studio instead of gcc.
Otherwise compiler exits with error:
"scope.c", line 643: Function has no return statement : CMDQuit
Uses Studio-specific pragma instead of adding another exit() prototype
with a noreturn attribute to avoid causing gcc to warn about having
a redundant prototype for the exit() function.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
It's already defined in scope.h, which is more widely #included and
a more logical home for it.
Clears a bunch of gcc warnings of:
scope.h:125:13: warning: redundant redeclaration of ‘ScopeEnabled’
x11.h:266:13: note: previous declaration of ‘ScopeEnabled’ was here
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
All OS routines take and return ints for file descriptors, so stop
converting back and forth to shorts.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
We still allocate one fdinfo struct for every possible FD up front
instead of resizing as needed, but they're much smaller now that
we just have a pointer to the 32k buffer instead of including it
directly in the fdinfo.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Previously we'd allocate a buffer of 32k each for each fd up to the
compiled in StaticMaxFD, which could be as large as 65535 on some
systems (that's the Solaris 64-bit default FD_SETSIZE), resulting in
gigabytes of bss allocation on startup.
Now we don't allocate until we're actually setting up the fdinfo for
use as part of a client<->server connection.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
We still allocate a QueueHeader (a struct containing 2 pointers) for
every possible FD, instead of allocating only as needed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
We still allocate one ConnState struct for every possible FD up front
instead of resizing as needed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Remove unnecessary casts from (void *)
Ensure return value is checked.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|