Commit Graph

1239 Commits

Author SHA1 Message Date
Daniel P. Berrange
b5060ff813 Add a 'syntax-check' make target
The 'make syntax-check' target is used to perform various code
style sanity checks, as well as to detect certain trivial error
patterns. The target is placed in GNUmakefile, instead of Makefile.am
since it relies on GNU specific make extensions.

The actual GNUmakefile and maint.mk files are taken from the
GNULIB project, unchanged

The cfg.mk file is used to configure which of the syntax checks
are activated, to allow addition of new project specific syntax
checks, and to blacklist certain files which should not be checked

* .mailmap: Add mapping for various broken email addrs in
  commit log, to stop complaints about AUTHORS file missing
  entries
* GNUmakefile: define the 'syntax-check' rule
* maint.mk: definition of standard syntax checks
* cfg.mk: configuration for checks
2012-01-13 18:12:00 +02:00
Daniel P. Berrange
68c2897e5b Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
51f1ad54ad Replace test XXX -a YYY with test XXX && test YYY
The '-a' and '-o' operators to test are not portable. Always
combine two invocations of 'test' using || or && instead.
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
7427b23d84 Add missing includes of config.h
Not all files were including config.h
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
d46bc77278 Remove bogus include of strings.h
The tests include strings.h but don't need any of its functions
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
2d530f929f Remove unused backup file
The common/glc.c.save file appears to be a obsolete copy of
glc.c
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
02d56750bd Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
8ab7c4535a Remove 'the the' typos 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
9f087ee7f0 Remove unused assert.h include
The assert.h include was never used in any code
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
440ba5d8f0 Always quote first arg to AC_DEFINE
The first arg to AC_DEFINE should always be quoted
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
0de78e9f59 Fix up copyright decl to always use 'Copyright (C) Red Hat, Inc.'
A couple of files were missing '(C)' in the copyright header
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
d6c31a6970 Improve usefulness of README file
The COPYING file already contains the license text, so the README
file need not repeat it. Instead put in a description of what
SPICE is, simple install instructions & pointers to mailing lists
and bug trackers
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
c9b38f6ac7 Fill out the AUTHORS file with some content
The AUTHORS file is empty, fill it in with a list of present and
past maintainers, and email addresses of all people who have
contributed patches
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
42df032c47 Remove casts from void * with xrealloc() calls
The xrealloc() function returns void*, so the return value
never needs to be cast
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
d262f1d96e Rewrite code to avoid triggering warning about casting param to free()
Since free() takes a void* parameters do not need to be cast.

The existing code here is actally fine, but it trips up the
syntax-check rule, so tweak it to an equivalent construct
which passes the syntax check
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
faf0947ebb Remove useless if() before free()
The free() function allows NULL to be passed in, so any
code which puts a if() before free() is wasting time
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
64f4826b6d Death to all TABs
Source files should all use spaces instead of tabs for
indentation. Update the few files not already in
compliance
2012-01-13 18:11:58 +02:00
Alon Levy
8a36c625a6 common/ssl_verify: special case to WIN32 that isn't MINGW32 2012-01-13 17:42:23 +02:00
Alon Levy
7a63185b9b common/bitops: mingw32: reorder so __GNUC__ define is checked first 2012-01-13 17:42:23 +02:00
Alon Levy
c7f4e52000 common/backtrace: for mingw32 no pipe/wait_pid, just disable 2012-01-13 17:42:23 +02:00
Alon Levy
a9bf749779 client/windows: fix several assigned but not used errors 2012-01-13 17:42:23 +02:00
Alon Levy
96c292a0b4 client/windows: arraysize(inf.bmiColors) == 1 in mingw32 2012-01-13 17:42:23 +02:00
Alon Levy
fe61197643 client/windows: fix typo, make error messages unique 2012-01-13 17:42:23 +02:00
Alon Levy
54a7b36a57 client/windows/main: mingw32 provides PACKAGE_VERSION 2012-01-13 17:42:23 +02:00
Alon Levy
4236d1440b client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.h 2012-01-13 17:42:22 +02:00
Alon Levy
be3711f8b4 client: mingw32 build needs the jpeg_boolean define 2012-01-13 17:42:22 +02:00
Alon Levy
5430f3a61f client/common.h: mingw32 fix
define PACKAGE_VERSION only ifndef __GNUC__
Since it is defined by autoconf and so it kinda comes with using the GNU
compilers.
2012-01-13 17:42:22 +02:00
Alon Levy
01102ff62b client/Makefile.am: mingw32 fixes
* build resource file with windres
* include client/windows and not client/x11
* use CXIMAGE_CFLAGS (it's already set to -DDISABLE_CXIMAGE correctly)
2012-01-13 17:42:21 +02:00
Alon Levy
9d2768d7de client: log command line (rhbz 767581) 2012-01-13 17:37:50 +02:00
Hans de Goede
0ac13ecbc4 client-x11: Fix building with gcc-4.7
Without this change gcc says:
x11/res.cpp:31:1: error: narrowing conversion of ‘(((unsigned int)_alt_image.<anonymous struct>::width) * 4u)’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
x11/res.cpp:61:1: error: narrowing conversion of ‘_red_icon.<anonymous struct>::width’ from ‘const uint32_t {aka const unsigned int}’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
x11/res.cpp:61:1: error: narrowing conversion of ‘_red_icon.<anonymous struct>::height’ from ‘const uint32_t {aka const unsigned int}’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
cc1plus: all warnings being treated as errors

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-13 15:26:57 +01:00
Hans de Goede
c6800dacf0 smartcard handling: Fix compilation when ASSERT-s are turned on
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-13 15:21:17 +01:00
Yonit Halperin
65c859ba81 server: add support for SPICE_COMMON_CAP_MINI_HEADER
Support for a header without a serial and without sub list.
red_channel: Support the two types of headers.
             Keep a consistent consecutive messages serial.
red_worker: use urgent marshaller instead of sub list.
snd_worker: Sound channels need special support since they still don't use
            red_channel for sending & receiving.
2012-01-12 16:33:36 +02:00
Yonit Halperin
ec0bf2488f configure: spice-protocol >= 0.10.1 (mini header support) 2012-01-12 16:33:35 +02:00
Yonit Halperin
8b64b95c43 server: Limit the access to SpiceDataHeader of messages - only via red_channel. 2012-01-12 16:17:02 +02:00
Yonit Halperin
a54f26d04e server/red_worker: pass remote caps to display/cursor red_channel_client's 2012-01-12 16:17:01 +02:00
Yonit Halperin
b689abe576 server/red_channel: introduce urgent marshaller
When red_channel::red_channel_client_begin_send_message is called,
the message that is pending in the urgent marshaller will be sent before
the one in the main channel.
The urgent marshaller should be used if in the middle of marshalling one message,
you find out you need to send another message before. This functionality
is equivalent to the sub_list messages. It will replace them in the following
patches, when sub_list is removed from Spice data header.
2012-01-12 16:17:00 +02:00
Yonit Halperin
33feaf75d6 spice.proto: add SPICE_MSG_LIST to base channel 2012-01-12 16:17:00 +02:00
Hans de Goede
5ea8687843 codegen: Fix enums.h generation
With the new usbredir code we have the new concept of the abstract /
generic spicevmc channel type (which just tunnels data from a qemu chardev),
and we've the usbredir channel, which is the only current user of this.

This was reflected in the protocols enum in spice-protocol.h by a manual
edit done by me, my bad. This patch teaches spice.proto about the relation
between the abstract spicevmc channel and the usbredir channel and
modifies codegen to deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-12 14:42:47 +01:00
Daniel P. Berrange
492ddb5d1d Do not assume that SPICE is using a TCP socket
If setting the TCP_NODELAY socket option fails with ENOTSUP,
then don't treat this is a fatal error. SPICE is likely just
running over a UNIX socket instead.

* server/inputs_channel.c: Ignore TCP_NODELAY socket opt fails

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Daniel P. Berrange
bd07dde530 Allow auth to be skipped when attaching to pre-accepted clients
When an applications passes in a pre-accepted socket for a
client, they may well have already performed suitable authentication
out of band. They should thus have the option to request that any
spice authentication is skipped.

* server/reds.c, spice.h: Add flag for skipping auth

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Daniel P. Berrange
d55b68b6b4 Add APIs for injecting a client connection socket
Allow applications to pass a pre-accepted client socket file
descriptor in. The new APIs are spice_server_add_ssl_client
and spice_server_add_client

* server/reds.c: Implement new APIs
* server/spice.h: Define new APIs

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Daniel P. Berrange
803be1bea7 Move SSL setup out of reds_accept_ssl_connection
To allow setup of an SSL client, from a passed in client
socket, move all the SSL client initialization code out
of reds_accept_ssl_connection and into a new method called
reds_init_client_ssl_connection

* server/reds.c: Introduce reds_init_client_ssl_connection

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Daniel P. Berrange
3a3a32ebbc Rename __reds_accept_connection into reds_init_client_connection
Remove the accept() call from __reds_accept_connection and
rename it to reds_init_client_connection. The caller is now
responsible for accepting the new socket. The method
reds_init_client_connection merely initializes it for
usage.

* server/reds.c: Add reds_init_client_connection

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Daniel P. Berrange
4eb78d39c5 Merge reds_accept_connection into reds_accept
Neither reds_accept_connection or reds_accept are very long,
so the split is pointless & increases code size for no gain.
Merge them together to reduce code size

* server/reds.c: Merge reds_accept_connection into reds_accept

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-01-09 18:57:57 +01:00
Hans de Goede
3435df1234 spicevmc: Set sockopt nodelay for usbredir channels
We want as little latency as possible with usb channels.

Signed-off-by: Hans de goede <hdegoede@redhat.com>
2011-12-22 12:48:10 +01:00
Yonit Halperin
fe001ca19d server: don't reset the display channel when disconnecting all its clients ,FDBZ #43977
The display channel was unnecessarily set to NULL when we disconnect all the clients
(on flush display commands timeout).
As a result, we recreated the display channel when a new client was connected.
The display channel was created with default red_channel.client_cbs, while its
correct client_cbs are the ones that are set by the red_dispatcher when it creates
the first display_channel.
This fix enforces a single creation of the display channel (per qxl), via the red_dispatcher.
2011-12-22 12:58:25 +02:00
Uri Lublin
8b797180ee client: screen: fix typo _forec_update_timer
sed -i 's/_forec_update_timer/_force_update_timer/' screen.cpp screen.h
2011-12-22 11:44:53 +02:00
Uri Lublin
a3a3b34a46 client: RedScreen::RedScreen: fix initialization order of _menu_needs_update
Related to a91b0b3ff7
2011-12-22 11:41:23 +02:00
Uri Lublin
fdcef17364 client: foreign-menu: pass "active" param when creating a ForeignMenu (#769020)
The default stays the same -- false.

A race could prevent setting ForeignMenu::_active correctly.
That happened when Application::on_app_activated was called before
_foriegn_menu was created. When foriegn_menu was created its
_active defaults to false, and that has not changed, until focus
was taken out and back in spice-client window.

This caused usbrdr to sometimes not auto-share devices, unless
the user switched focus to a different application and back to
spicec.

The fix updates ForiegnMenu::_active upon creation.
2011-12-20 18:44:11 +02:00
Uri Lublin
a91b0b3ff7 client: update menu if needed when exiting full-screen mode (#758260) 2011-12-20 18:44:05 +02:00