mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-28 08:01:26 +00:00
Fix spelling errors in comments and strings
This commit is contained in:
parent
d351bb35ce
commit
012bd25779
@ -1157,7 +1157,7 @@ void Application::on_key_down(RedKey key)
|
||||
}
|
||||
|
||||
if (!_sticky_info.sticky_mode) {
|
||||
// during tracing (traced key was pressed and no keyboard event has occured till now)
|
||||
// during tracing (traced key was pressed and no keyboard event has occurred till now)
|
||||
if (_sticky_info.key_first_down) {
|
||||
ASSERT(_sticky_info.key != REDKEY_INVALID);
|
||||
if (key != _sticky_info.key) {
|
||||
@ -1939,8 +1939,8 @@ bool Application::process_cmd_line(int argc, char** argv)
|
||||
parser.add(SPICE_OPT_CA_FILE, "ca-file", "truststore file for secure connections",
|
||||
"ca-file", true);
|
||||
parser.add(SPICE_OPT_HOST_SUBJECT, "host-subject",
|
||||
"subject of the host certifcate. Format: field=value pairs separated"
|
||||
" by commmas. Commas and backslashes within values must be preceded by"
|
||||
"subject of the host certificate. Format: field=value pairs separated"
|
||||
" by commas. Commas and backslashes within values must be preceded by"
|
||||
" a backslash", "host-subject", true);
|
||||
parser.add(SPICE_OPT_PASSWORD, "password", "server password", "password", true, 'w');
|
||||
parser.add(SPICE_OPT_FULL_SCREEN, "full-screen", "open in full screen mode", "auto-conf",
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "common.h"
|
||||
#include "process_loop.h"
|
||||
|
||||
/* intterface for connenctions inside client LAN */
|
||||
/* interface for connections inside client LAN */
|
||||
|
||||
typedef enum {
|
||||
SOCKET_STATUS_OPEN,
|
||||
|
||||
@ -486,7 +486,7 @@ void CursorChannel::create_native_cursor(CursorData* cursor)
|
||||
native_cursor = new UnsupportedCursor(cursor->header());
|
||||
break;
|
||||
default:
|
||||
THROW("invalid curosr type");
|
||||
THROW("invalid cursor type");
|
||||
}
|
||||
cursor->set_opaque(native_cursor);
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ VideoStream::VideoStream(RedClient& client, Canvas& canvas, DisplayChannel& chan
|
||||
memset(_frames, 0, sizeof(_frames));
|
||||
region_init(&_clip_region);
|
||||
if (codec_type != SPICE_VIDEO_CODEC_TYPE_MJPEG) {
|
||||
THROW("invalid vide codec type %u", codec_type);
|
||||
THROW("invalid video codec type %u", codec_type);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -1398,7 +1398,7 @@ void DisplayChannel::handle_stream_destroy(RedPeer::InMessage* message)
|
||||
VideoStream **active_stream = &_active_streams;
|
||||
for (;;) {
|
||||
if (!*active_stream) {
|
||||
THROW("not in actibe streams");
|
||||
THROW("not in active streams");
|
||||
}
|
||||
|
||||
if (*active_stream == _streams[stream_destroy->id]) {
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
/*
|
||||
For each output pixel type the following macros are defined:
|
||||
OUT_PIXEL - the output pixel type
|
||||
COPY_PIXEL(p, out) - assignes the pixel to the place pointed by out and
|
||||
COPY_PIXEL(p, out) - assigns the pixel to the place pointed by out and
|
||||
increases out. Used in RLE.
|
||||
Need special handling because in alpha we copy only
|
||||
the pad byte.
|
||||
@ -168,8 +168,8 @@
|
||||
#define COPY_COMP_PIXEL(in, out) {out->pad = *(in++); out++;}
|
||||
#endif
|
||||
|
||||
// TODO: seperate into routines that decode to dist,len. and to a routine that
|
||||
// actualy copies the data.
|
||||
// TODO: separate into routines that decode to dist,len. and to a routine that
|
||||
// actually copies the data.
|
||||
|
||||
/* returns num of bytes read from in buf.
|
||||
size should be in PIXEL */
|
||||
|
||||
@ -39,7 +39,7 @@ public:
|
||||
|
||||
virtual ~GlzDecodedImage() {}
|
||||
uint8_t *get_data() {return _data;}
|
||||
uint8_t *get_pixel_ref(int offset); // pallete pix_id = byte count
|
||||
uint8_t *get_pixel_ref(int offset); // palette pix_id = byte count
|
||||
uint64_t get_id() {return _id;}
|
||||
uint64_t get_window_head_id() {return _win_head_id;}
|
||||
int get_size() {return _size;}
|
||||
|
||||
@ -68,14 +68,14 @@ void GlzDecoderWindow::post_decode(GlzDecodedImage *image)
|
||||
|
||||
/* index: the physical index in the images array. Note that it can't change between waits since
|
||||
the realloc mutex should be read locked.
|
||||
No starvation for the realloc mutex can occure, since the image we wait for is located before us,
|
||||
No starvation for the realloc mutex can occur, since the image we wait for is located before us,
|
||||
hence, when it arrives - no realloc is needed. */
|
||||
void GlzDecoderWindow::wait_for_image(int index)
|
||||
{
|
||||
Lock lock(_new_image_mutex);
|
||||
GlzDecodedImage *image = _images[index]; // can be performed without locking the _win_mutex,
|
||||
// since it is called after pre and the rw mutex is // locked, hence, physical chnages to the window are
|
||||
// not allowed. In addtion the reading of the image ptr
|
||||
// since it is called after pre and the rw mutex is // locked, hence, physical changes to the window are
|
||||
// not allowed. In addition the reading of the image ptr
|
||||
// is atomic, thus, even if the value changes we are
|
||||
// not affected.
|
||||
|
||||
@ -146,7 +146,7 @@ inline bool GlzDecoderWindow::is_empty()
|
||||
return (!_n_images);
|
||||
}
|
||||
|
||||
/* aprroximated overflow. Considers only the size that currently occupies the window and
|
||||
/* approximated overflow. Considers only the size that currently occupies the window and
|
||||
not the size of the missing images. TODO: consider other measures */
|
||||
inline bool GlzDecoderWindow::will_overflow(uint64_t image_id, uint64_t relative_head_id)
|
||||
{
|
||||
@ -302,7 +302,7 @@ void GlzDecoderWindow::narrow_window(GlzDecodedImage *last_added)
|
||||
|
||||
_missing_list.pop_front(); // removing the last added image from the missing list
|
||||
|
||||
/* maintaing the missing list: removing front images that already arrived */
|
||||
/* maintaining the missing list: removing front images that already arrived */
|
||||
while (!_missing_list.empty()) {
|
||||
int front_win_idx = calc_image_win_idx(_missing_list.front());
|
||||
if (_images[front_win_idx] == NULL) { // still missing
|
||||
|
||||
@ -262,7 +262,7 @@ void PlaybackChannel::handle_start(RedPeer::InMessage* message)
|
||||
start->channels);
|
||||
} catch (...) {
|
||||
LOG_WARN("create player failed");
|
||||
//todo: support disconnecting singel channel
|
||||
//todo: support disconnecting single channel
|
||||
disable();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ void SyncEvent::response(AbstractProcessLoop& events_loop)
|
||||
try {
|
||||
do_response(events_loop);
|
||||
} catch (Exception& e) {
|
||||
LOG_WARN("unhandle exception: %s", e.what());
|
||||
LOG_WARN("unhandled exception: %s", e.what());
|
||||
_err = true;
|
||||
} catch (...) {
|
||||
_err = true;
|
||||
|
||||
@ -273,9 +273,9 @@ void* RedChannel::worker_main(void *data)
|
||||
Platform::set_thread_priority(NULL, channel->get_worker_priority());
|
||||
channel->run();
|
||||
} catch (Exception& e) {
|
||||
LOG_ERROR("unhandle exception: %s", e.what());
|
||||
LOG_ERROR("unhandled exception: %s", e.what());
|
||||
} catch (std::exception& e) {
|
||||
LOG_ERROR("unhandle exception: %s", e.what());
|
||||
LOG_ERROR("unhandled exception: %s", e.what());
|
||||
} catch (...) {
|
||||
LOG_ERROR("unhandled exception");
|
||||
}
|
||||
@ -676,12 +676,12 @@ void RedChannel::handle_notify(RedPeer::InMessage* message)
|
||||
|
||||
|
||||
if (notify->severty > SPICE_NOTIFY_SEVERITY_ERROR) {
|
||||
THROW("bad sevirity");
|
||||
THROW("bad severity");
|
||||
}
|
||||
sevirity = sevirity_strings[notify->severty];
|
||||
|
||||
if (notify->visibilty > SPICE_NOTIFY_VISIBILITY_HIGH) {
|
||||
THROW("bad visibilty");
|
||||
THROW("bad visibility");
|
||||
}
|
||||
visibility = visibility_strings[notify->visibilty];
|
||||
|
||||
|
||||
@ -409,7 +409,7 @@ void TunnelChannel::handle_socket_close(RedPeer::InMessage* message)
|
||||
if (sckt->is_connected()) {
|
||||
sckt->push_disconnect();
|
||||
} else {
|
||||
// close happend in the server side before it received the client
|
||||
// close happened in the server side before it received the client
|
||||
// close msg. we should ack the server and free the socket
|
||||
on_socket_disconnect(*sckt);
|
||||
}
|
||||
@ -502,7 +502,7 @@ void TunnelChannel::on_socket_disconnect(ClientNetSocket& sckt)
|
||||
{
|
||||
TunnelChannel::TunnelSocket* tunnel_sckt = static_cast<TunnelChannel::TunnelSocket*>(&sckt);
|
||||
Message* out_msg;
|
||||
// close intiated by server -> needs ack
|
||||
// close initiated by server -> needs ack
|
||||
if (tunnel_sckt->get_guest_closed()) {
|
||||
DBG(0, "send close ack connection_id=%d", tunnel_sckt->id());
|
||||
out_msg = new Message(SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK, sizeof(SpiceMsgcTunnelSocketClosedAck));
|
||||
|
||||
@ -35,10 +35,10 @@ int main(int argc, char** argv)
|
||||
exit_val = Application::main(argc, argv, version_str);
|
||||
LOG_INFO("Spice client terminated (exitcode = %d)", exit_val);
|
||||
} catch (Exception& e) {
|
||||
LOG_ERROR("unhandle exception: %s", e.what());
|
||||
LOG_ERROR("unhandled exception: %s", e.what());
|
||||
exit_val = e.get_error_code();
|
||||
} catch (std::exception& e) {
|
||||
LOG_ERROR("unhandle exception: %s", e.what());
|
||||
LOG_ERROR("unhandled exception: %s", e.what());
|
||||
exit_val = SPICEC_ERROR_CODE_ERROR;
|
||||
} catch (...) {
|
||||
LOG_ERROR("unhandled exception");
|
||||
|
||||
@ -75,7 +75,7 @@ int32_t Session::read(uint8_t *buf, int32_t size)
|
||||
int now;
|
||||
if ((now = recv(_fd_client, (char *)pos, size, 0)) <= 0) {
|
||||
if (now == 0) {
|
||||
DBG(0, "read error, connetion shutdown");
|
||||
DBG(0, "read error, connection shutdown");
|
||||
return -1;
|
||||
}
|
||||
if (errno == EAGAIN) {
|
||||
|
||||
@ -337,7 +337,7 @@ XIC XPlatform::get_input_context()
|
||||
void XPlatform::set_win_proc(Window win, win_proc_t proc)
|
||||
{
|
||||
if (XSaveContext(x_display, win, win_proc_context, (XPointer)proc)) {
|
||||
THROW("set win proc pailed");
|
||||
THROW("set win proc failed");
|
||||
}
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ bool DynamicScreen::set_screen_size(int size_index)
|
||||
XRRScreenConfiguration* config;
|
||||
|
||||
if (!(config = XRRGetScreenInfo(get_display(), root_window))) {
|
||||
LOG_WARN("get scren info failed");
|
||||
LOG_WARN("get screen info failed");
|
||||
return false;
|
||||
}
|
||||
Rotation rotation;
|
||||
@ -2592,7 +2592,7 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data)
|
||||
int size;
|
||||
|
||||
if (!get_size_bits(header, size)) {
|
||||
THROW("invalid curosr type");
|
||||
THROW("invalid cursor type");
|
||||
}
|
||||
|
||||
uint32_t* cur_data = new uint32_t[cur_size];
|
||||
|
||||
@ -1875,7 +1875,7 @@ bool RedWindow::get_mouse_anchor_point(SpicePoint& pt)
|
||||
|
||||
while (!(vis_region = get_visibale_region(_win))) {
|
||||
if (!vis_region_retries) {
|
||||
THROW("get visibale region failed");
|
||||
THROW("get visible region failed");
|
||||
}
|
||||
--vis_region_retries;
|
||||
usleep(X_RETRY_DELAY_MICRO);
|
||||
|
||||
@ -761,7 +761,7 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, LZImage *image, int inv
|
||||
return lz_data->decode_data.out_surface;
|
||||
}
|
||||
|
||||
// don't handle plts since bitmaps with plt can be decoded globaly to RGB32 (because
|
||||
// don't handle plts since bitmaps with plt can be decoded globally to RGB32 (because
|
||||
// same byte sequence can be transformed to different RGB pixels by different plts)
|
||||
static pixman_image_t *canvas_get_glz(CanvasBase *canvas, LZImage *image,
|
||||
int want_original)
|
||||
@ -1760,7 +1760,7 @@ static void canvas_base_destroy(CanvasBase *canvas)
|
||||
}
|
||||
}
|
||||
|
||||
/* This is kind of lame, but it protects against muliple
|
||||
/* This is kind of lame, but it protects against multiple
|
||||
instances of these functions. We really should stop including
|
||||
canvas_base.c and build it separately instead */
|
||||
#ifdef CANVAS_SINGLE_INSTANCE
|
||||
|
||||
@ -378,7 +378,7 @@ static void gl_canvas_draw_copy(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spic
|
||||
set_mask(canvas, ©->mask, bbox->left, bbox->top);
|
||||
set_op(canvas, copy->rop_decriptor);
|
||||
|
||||
//todo: optimize get_imag (use ogl conversion + remove unnecessary copy of 32bpp)
|
||||
//todo: optimize get_image (use ogl conversion + remove unnecessary copy of 32bpp)
|
||||
surface = canvas_get_image(&canvas->base, copy->src_bitmap, FALSE);
|
||||
surface_to_image(canvas, surface, &image, 0);
|
||||
SET_GLC_RECT(&dest, bbox);
|
||||
|
||||
@ -228,7 +228,7 @@ static void free_tass_vertex_bufs(InternaCtx *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
//naiev bezier flattener
|
||||
//naive bezier flattener
|
||||
static TassVertex *bezier_flattener(InternaCtx *ctx, PathPoint *points)
|
||||
{
|
||||
double ax, bx, cx;
|
||||
|
||||
12
common/lz.c
12
common/lz.c
@ -95,7 +95,7 @@ typedef struct Encoder {
|
||||
LzImageSegment *tail_image_segs;
|
||||
LzImageSegment *free_image_segs;
|
||||
|
||||
// the dicitionary hash table is composed (1) a pointer to the segment the word was found in
|
||||
// the dictionary hash table is composed (1) a pointer to the segment the word was found in
|
||||
// (2) a pointer to the first byte in the segment that matches the word
|
||||
HashEntry htab[HASH_SIZE];
|
||||
|
||||
@ -116,7 +116,7 @@ static int lz_read_image_segments(Encoder *encoder, uint8_t *first_lines,
|
||||
unsigned int num_first_lines);
|
||||
|
||||
|
||||
// return a free image segement if one exists. Make allocation if needed. adds it to the
|
||||
// return a free image segment if one exists. Make allocation if needed. adds it to the
|
||||
// tail of the image segments lists
|
||||
static INLINE LzImageSegment *lz_alloc_image_seg(Encoder *encoder)
|
||||
{
|
||||
@ -367,7 +367,7 @@ void lz_destroy(LzContext *lz)
|
||||
}
|
||||
|
||||
if (encoder->head_image_segs) {
|
||||
encoder->usr->error(encoder->usr, "%s: used_image_segements not empty\n", __FUNCTION__);
|
||||
encoder->usr->error(encoder->usr, "%s: used_image_segments not empty\n", __FUNCTION__);
|
||||
lz_reset_image_seg(encoder);
|
||||
}
|
||||
lz_dealloc_free_segments(encoder);
|
||||
@ -517,12 +517,12 @@ int lz_encode(LzContext *lz, LzImageType type, int width, int height, int top_do
|
||||
if (encoder->stride > (width / PLT_PIXELS_PER_BYTE[encoder->type])) {
|
||||
if (((width % PLT_PIXELS_PER_BYTE[encoder->type]) == 0) || (
|
||||
(encoder->stride - (width / PLT_PIXELS_PER_BYTE[encoder->type])) > 1)) {
|
||||
encoder->usr->error(encoder->usr, "sride overflows (plt)\n");
|
||||
encoder->usr->error(encoder->usr, "stride overflows (plt)\n");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (encoder->stride != width * RGB_BYTES_PER_PIXEL[encoder->type]) {
|
||||
encoder->usr->error(encoder->usr, "sride != width*bytes_per_pixel (rgb)\n");
|
||||
encoder->usr->error(encoder->usr, "stride != width*bytes_per_pixel (rgb)\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -616,7 +616,7 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, unsigned int num_io_bytes,
|
||||
*out_type = encoder->type;
|
||||
|
||||
// TODO: maybe instead of stride we can encode out_n_pixels
|
||||
// (if stride is not necssary in decoding).
|
||||
// (if stride is not necessary in decoding).
|
||||
if (IS_IMAGE_TYPE_PLT[encoder->type]) {
|
||||
encoder->palette = palette;
|
||||
*out_n_pixels = encoder->stride * PLT_PIXELS_PER_BYTE[encoder->type] * encoder->height;
|
||||
|
||||
@ -37,7 +37,7 @@ struct LzUsrContext {
|
||||
TODO : determine size limit for the first segment and each chunk. check validity
|
||||
of the segment or go to literal copy.
|
||||
TODO : currently support only rgb images in which width*bytes_per_pixel = stride OR
|
||||
paletter images in which stride eqauls the min number of bytes to
|
||||
palette images in which stride equals the min number of bytes to
|
||||
hold a line. stride is not necessary for now. just for sanity check.
|
||||
stride should be > 0
|
||||
*/
|
||||
@ -59,9 +59,9 @@ void lz_decode_begin(LzContext *lz, uint8_t *io_ptr, unsigned int num_io_bytes,
|
||||
to_type = the image output type.
|
||||
We assume the buffer is consecutive. i.e. width = stride
|
||||
|
||||
Improtant: if the image is plt1/4 and to_type is rgb32, the image
|
||||
Important: if the image is plt1/4 and to_type is rgb32, the image
|
||||
will decompressed including the last bits in each line. This means buffer should be
|
||||
larger than width*height if neede and you shoud use stride to fix it.
|
||||
larger than width*height if needed and you should use stride to fix it.
|
||||
Note: If the image is down to top, set the stride in the sw surface to negative.
|
||||
use alloc_lz_image_surface create the surface.
|
||||
*/
|
||||
|
||||
@ -146,8 +146,8 @@
|
||||
|
||||
// when encoding, the ref can be in previous segment, and we should check that it doesn't
|
||||
// exceeds its bounds.
|
||||
// TODO: optimization: when only one chunk exists or when the reference is in the same segement,
|
||||
// don't make checks if we reach end of segements
|
||||
// TODO: optimization: when only one chunk exists or when the reference is in the same segment,
|
||||
// don't make checks if we reach end of segments
|
||||
// TODO: optimize to continue match between segments?
|
||||
// TODO: check hash function
|
||||
// TODO: check times
|
||||
@ -286,7 +286,7 @@ match: // RLE or dictionary (both are encoded by distance from ref (-1) a
|
||||
distance--;
|
||||
|
||||
// ip is located now at the position of the second mismatch.
|
||||
// later it will be substracted by 3
|
||||
// later it will be subtracted by 3
|
||||
|
||||
if (!distance) {
|
||||
/* zero distance means a run */
|
||||
@ -346,7 +346,7 @@ match: // RLE or dictionary (both are encoded by distance from ref (-1) a
|
||||
#endif
|
||||
/* encode the match (like fastlz level 2)*/
|
||||
if (distance < MAX_DISTANCE) { // MAX_DISTANCE is 2^13 - 1
|
||||
// when copy is pefrformed, the byte that holds the copy count is smaller than 32.
|
||||
// when copy is performed, the byte that holds the copy count is smaller than 32.
|
||||
// When there is a reference, the first byte is always larger then 32
|
||||
|
||||
// 3 bits = length, 5 bits = 5 MSB of distance, 8 bits = 8 LSB of distance
|
||||
@ -355,7 +355,7 @@ match: // RLE or dictionary (both are encoded by distance from ref (-1) a
|
||||
encode(encoder, (uint8_t)(distance & 255));
|
||||
} else { // more than 3 bits are needed for length
|
||||
// 3 bits 7, 5 bits = 5 MSB of distance, next bytes are 255 till we
|
||||
// recieve a smaller number, last byte = 8 LSB of distance
|
||||
// receive a smaller number, last byte = 8 LSB of distance
|
||||
encode(encoder, (uint8_t)((7 << 5) + (distance >> 8)));
|
||||
for (len -= 7; len >= 255; len -= 255) {
|
||||
encode(encoder, 255);
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
/*
|
||||
For each output pixel type the following macros are defined:
|
||||
OUT_PIXEL - the output pixel type
|
||||
COPY_PIXEL(p, out) - assignes the pixel to the place pointed by out and increases
|
||||
COPY_PIXEL(p, out) - assigns the pixel to the place pointed by out and increases
|
||||
out. Used in RLE. Need special handling because in alpha we
|
||||
copy only the pad byte.
|
||||
COPY_REF_PIXEL(ref, out) - copies the pixel pointed by ref to the pixel pointed by out.
|
||||
|
||||
@ -33,7 +33,7 @@ void *spice_malloc_n_m(size_t n_blocks, size_t n_block_bytes, size_t extra_size)
|
||||
void *spice_malloc0_n(size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_MALLOC SPICE_GNUC_ALLOC_SIZE2(1,2);
|
||||
void *spice_realloc_n(void *mem, size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
/* Optimise: avoid the call to the (slower) _n function if we can
|
||||
/* Optimize: avoid the call to the (slower) _n function if we can
|
||||
* determine at compile-time that no overflow happens.
|
||||
*/
|
||||
#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
|
||||
@ -67,7 +67,7 @@ void *spice_realloc_n(void *mem, size_t n_blocks, size_t n_block_bytes) SPICE_GN
|
||||
}))
|
||||
#else
|
||||
|
||||
/* Unoptimised version: always call the _n() function. */
|
||||
/* Unoptimized version: always call the _n() function. */
|
||||
|
||||
#define _SPICE_NEW(struct_type, n_structs, func) \
|
||||
((struct_type *) spice_##func##_n ((n_structs), sizeof (struct_type)))
|
||||
|
||||
@ -75,7 +75,7 @@ typedef uint8_t BYTE;
|
||||
|
||||
typedef struct QuicFamily {
|
||||
unsigned int nGRcodewords[MAXNUMCODES]; /* indexed by code number, contains number of
|
||||
unmodofied GR codewords in the code */
|
||||
unmodified GR codewords in the code */
|
||||
unsigned int notGRcwlen[MAXNUMCODES]; /* indexed by code number, contains codeword
|
||||
length of the not-GR codeword */
|
||||
unsigned int notGRprefixmask[MAXNUMCODES]; /* indexed by code number, contains mask to
|
||||
|
||||
@ -44,7 +44,7 @@ struct QuicUsrContext {
|
||||
void (*free)(QuicUsrContext *usr, void *ptr);
|
||||
int (*more_space)(QuicUsrContext *usr, uint32_t **io_ptr, int rows_completed);
|
||||
int (*more_lines)(QuicUsrContext *usr, uint8_t **lines); // on return the last line of previous
|
||||
// lines bunch must stil be valid
|
||||
// lines bunch must still be valid
|
||||
};
|
||||
|
||||
int quic_encode(QuicContext *quic, QuicImageType type, int width, int height,
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
/* if image_distance = 0, pixel_distance is the distance between the matching pixels.
|
||||
Otherwise, it is the offset from the beginning of the referred image */
|
||||
#if defined(GLZ_ENCODE_MATCH) /* actually perfroming the encoding */
|
||||
#if defined(GLZ_ENCODE_MATCH) /* actually performing the encoding */
|
||||
static INLINE void encode_match(Encoder *encoder, uint32_t image_distance,
|
||||
size_t pixel_distance, size_t len)
|
||||
#elif defined(GLZ_ENCODE_SIZE) /* compute the size of the encoding except for the match length*/
|
||||
@ -59,7 +59,7 @@ static INLINE int get_encode_ref_size(uint32_t image_distance, size_t pixel_dist
|
||||
#endif
|
||||
|
||||
|
||||
/* encoding the rest of the pixel ditsance and the image_dist and its 2 control bits */
|
||||
/* encoding the rest of the pixel distance and the image_dist and its 2 control bits */
|
||||
|
||||
/* The first 2 MSB bits indicate how many more bytes should be read for image dist */
|
||||
if (pixel_distance < MAX_PIXEL_SHORT_DISTANCE) {
|
||||
|
||||
@ -156,11 +156,11 @@ static INLINE size_t FNAME(do_match)(SharedDictionary *dict,
|
||||
const PIXEL *tmp_ref = ref;
|
||||
|
||||
if (ref > (ref_limit - MIN_REF_ENCODE_SIZE)) {
|
||||
return 0; // in case the hash entry is not relvant
|
||||
return 0; // in case the hash entry is not relevant
|
||||
}
|
||||
|
||||
|
||||
/* min match lenght == MIN_REF_ENCODE_SIZE (depends on pixel type) */
|
||||
/* min match length == MIN_REF_ENCODE_SIZE (depends on pixel type) */
|
||||
|
||||
if (!SAME_PIXEL(*tmp_ref, *tmp_ip)) {
|
||||
return 0;
|
||||
|
||||
@ -234,12 +234,12 @@ int glz_encode(GlzEncoderContext *opaque_encoder,
|
||||
if (stride > (width / PLT_PIXELS_PER_BYTE[type])) {
|
||||
if (((width % PLT_PIXELS_PER_BYTE[type]) == 0) || (
|
||||
(stride - (width / PLT_PIXELS_PER_BYTE[type])) > 1)) {
|
||||
encoder->usr->error(encoder->usr, "sride overflows (plt)\n");
|
||||
encoder->usr->error(encoder->usr, "stride overflows (plt)\n");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (stride != width * RGB_BYTES_PER_PIXEL[type]) {
|
||||
encoder->usr->error(encoder->usr, "sride != width*bytes_per_pixel (rgb)\n");
|
||||
encoder->usr->error(encoder->usr, "stride != width*bytes_per_pixel (rgb)\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@ void glz_encoder_destroy(GlzEncoderContext *opaque_encoder);
|
||||
|
||||
/*
|
||||
assumes width is in pixels and stride is in bytes
|
||||
usr_context : when an image is released from the window due to capicity overflow,
|
||||
usr_context is given as a parmater to the free_image callback.
|
||||
usr_context : when an image is released from the window due to capacity overflow,
|
||||
usr_context is given as a parameter to the free_image callback.
|
||||
o_enc_dict_context: if glz_enc_dictionary_remove_image is called, it should be
|
||||
called with the o_enc_dict_context that is associated with
|
||||
the image.
|
||||
@ -43,7 +43,7 @@ void glz_encoder_destroy(GlzEncoderContext *opaque_encoder);
|
||||
return: the number of bytes in the compressed data and sets o_enc_dict_context
|
||||
|
||||
NOTE : currently supports only rgb images in which width*bytes_per_pixel = stride OR
|
||||
palette images in which stride eqauls the min number of bytes to hold a line.
|
||||
palette images in which stride equals the min number of bytes to hold a line.
|
||||
The stride should be > 0
|
||||
*/
|
||||
int glz_encode(GlzEncoderContext *opaque_encoder, LzImageType type, int width, int height,
|
||||
|
||||
@ -363,7 +363,7 @@ static INLINE void __glz_dictionary_window_free_image(SharedDictionary *dict, Wi
|
||||
dict->window.free_images = image;
|
||||
}
|
||||
|
||||
/* moves all the segments that were associaed with the images to the free segments */
|
||||
/* moves all the segments that were associated with the images to the free segments */
|
||||
static INLINE void __glz_dictionary_window_free_image_segs(SharedDictionary *dict,
|
||||
WindowImage *image)
|
||||
{
|
||||
@ -436,7 +436,7 @@ static INLINE int glz_dictionary_is_in_use(SharedDictionary *dict)
|
||||
static void glz_dictionary_window_remove_head(SharedDictionary *dict, uint32_t encoder_id,
|
||||
WindowImage *end_image)
|
||||
{
|
||||
// note that the segs list heads (one per econder) may be different than the
|
||||
// note that the segs list heads (one per encoder) may be different than the
|
||||
// used_segs_head and it is updated somewhere else
|
||||
while (dict->window.used_images_head != end_image) {
|
||||
WindowImage *image = dict->window.used_images_head;
|
||||
@ -532,7 +532,7 @@ static WindowImage *glz_dictionary_window_add_image(SharedDictionary *dict, LzIm
|
||||
// see glz_encode_tmpl::compress).
|
||||
// Thus, the 'next' field of the list's tail can be accessed only
|
||||
// after all the new tail's data was set. Note that we are relying on
|
||||
// an atomic assignment (32 bit varaible).
|
||||
// an atomic assignment (32 bit variable).
|
||||
// For the other thread that may read 'next' of the old tail, NULL_IMAGE_SEG_ID
|
||||
// is equivalent to a segment with an image id that is different
|
||||
// from the image id of the tail, so we don't need to further protect this field.
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
/*
|
||||
Interface for maintaining lz dictionary that is shared among several encoders.
|
||||
The interface for accessing the dictionary for encoding purposes is located in
|
||||
glz_encoder_diciotnary_protected.h
|
||||
glz_encoder_dictionary_protected.h
|
||||
*/
|
||||
|
||||
typedef void GlzEncDictContext;
|
||||
@ -38,7 +38,7 @@ typedef struct GlzEncDictRestoreData {
|
||||
} GlzEncDictRestoreData;
|
||||
|
||||
/* size : maximal number of pixels occupying the window
|
||||
max_encoders: maximal number of encoders that use the dicitionary
|
||||
max_encoders: maximal number of encoders that use the dictionary
|
||||
usr : callbacks */
|
||||
GlzEncDictContext *glz_enc_dictionary_create(uint32_t size, uint32_t max_encoders,
|
||||
GlzEncoderUsrContext *usr);
|
||||
@ -49,7 +49,7 @@ void glz_enc_dictionary_destroy(GlzEncDictContext *opaque_dict, GlzEncoderUsrCon
|
||||
uint32_t glz_enc_dictionary_get_size(GlzEncDictContext *);
|
||||
|
||||
/* returns the current state of the dictionary.
|
||||
NOTE - you should use it only when no encoder uses the dicitonary. */
|
||||
NOTE - you should use it only when no encoder uses the dictionary. */
|
||||
void glz_enc_dictionary_get_restore_data(GlzEncDictContext *opaque_dict,
|
||||
GlzEncDictRestoreData *out_data,
|
||||
GlzEncoderUsrContext *usr);
|
||||
@ -58,11 +58,11 @@ void glz_enc_dictionary_get_restore_data(GlzEncDictContext *opaque_dict,
|
||||
GlzEncDictContext *glz_enc_dictionary_restore(GlzEncDictRestoreData *restore_data,
|
||||
GlzEncoderUsrContext *usr);
|
||||
|
||||
/* NOTE - you should use this routine only when no encoder uses the dicitonary. */
|
||||
/* NOTE - you should use this routine only when no encoder uses the dictionary. */
|
||||
void glz_enc_dictionary_reset(GlzEncDictContext *opaque_dict, GlzEncoderUsrContext *usr);
|
||||
|
||||
/* image: the context returned by the encoder when the image was encoded.
|
||||
NOTE - you should use this routine only when no encoder uses the dicitonary.*/
|
||||
NOTE - you should use this routine only when no encoder uses the dictionary.*/
|
||||
void glz_enc_dictionary_remove_image(GlzEncDictContext *opaque_dict,
|
||||
GlzEncDictImageContext *image, GlzEncoderUsrContext *usr);
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ struct WindowImage {
|
||||
#define NULL_IMAGE_SEG_ID MAX_IMAGE_SEGS_NUM
|
||||
#define INIT_IMAGE_SEGS_NUM 1000
|
||||
|
||||
/* Images can be seperated into several chunks. The basic unit of the
|
||||
/* Images can be separated into several chunks. The basic unit of the
|
||||
dictionary window is one image segment. Each segment is encoded separately.
|
||||
An encoded match can refer to only one segment.*/
|
||||
struct WindowImageSegment {
|
||||
@ -66,7 +66,7 @@ struct WindowImageSegment {
|
||||
uint32_t pixels_num; // Number of pixels in the segment
|
||||
uint64_t pixels_so_far; // Total no. pixels passed through the window till this segment.
|
||||
// NOTE - never use size delta independently. It should
|
||||
// always be used with respect to a previouse size delta
|
||||
// always be used with respect to a previous size delta
|
||||
uint32_t next;
|
||||
};
|
||||
|
||||
@ -80,7 +80,7 @@ struct __attribute__ ((__packed__)) HashEntry {
|
||||
struct SharedDictionary {
|
||||
struct {
|
||||
/* The segments storage. A dynamic array.
|
||||
By reffering to a segment by its index, insetad of address,
|
||||
By referring to a segment by its index, instead of address,
|
||||
we save space in the hash entries (32bit instead of 64bit) */
|
||||
WindowImageSegment *segs;
|
||||
uint32_t segs_quota;
|
||||
@ -89,8 +89,8 @@ struct SharedDictionary {
|
||||
array in order to keep the indices of the segments consistent
|
||||
after reallocation */
|
||||
|
||||
/* the window in a resultion of image segments */
|
||||
uint32_t used_segs_head; // the lateset head
|
||||
/* the window in a resolution of image segments */
|
||||
uint32_t used_segs_head; // the latest head
|
||||
uint32_t used_segs_tail;
|
||||
uint32_t free_segs_head;
|
||||
|
||||
@ -99,7 +99,7 @@ struct SharedDictionary {
|
||||
// The head is NULL_IMAGE_SEG_ID when the encoder is
|
||||
// not encoding.
|
||||
|
||||
/* the window in a resultion of images. But here the head contains the oldest head*/
|
||||
/* the window in a resolution of images. But here the head contains the oldest head*/
|
||||
WindowImage* used_images_tail;
|
||||
WindowImage* used_images_head;
|
||||
WindowImage* free_images;
|
||||
@ -108,7 +108,7 @@ struct SharedDictionary {
|
||||
uint32_t size_limit; // max number of pixels in a window (per encoder)
|
||||
} window;
|
||||
|
||||
/* Concurrency issues: the reading/wrting of each entry field should be atomic.
|
||||
/* Concurrency issues: the reading/writing of each entry field should be atomic.
|
||||
It is allowed that the reading/writing of the whole entry won't be atomic,
|
||||
since before we access a reference we check its validity*/
|
||||
#ifdef CHAINED_HASH
|
||||
@ -130,8 +130,8 @@ struct SharedDictionary {
|
||||
If possible, release images from the head of the window.
|
||||
Also perform concurrency related operations.
|
||||
|
||||
usr_image_context: when an image is released from the window due to capicity overflow,
|
||||
usr_image_context is given as a parmater to the free_image callback.
|
||||
usr_image_context: when an image is released from the window due to capacity overflow,
|
||||
usr_image_context is given as a parameter to the free_image callback.
|
||||
|
||||
image_head_dist : the number of images between the current image and the head of the
|
||||
window that is associated with the encoder.
|
||||
|
||||
@ -108,7 +108,7 @@ static inline double FNAME(pixels_square_score)(PIXEL *line1, PIXEL *line2)
|
||||
all_ident = all_ident && (!cmp_res);
|
||||
ret += FNAME(PIX_PAIR_SCORE)[cmp_res];
|
||||
|
||||
// ignore squares where al pixels are identical
|
||||
// ignore squares where all pixels are identical
|
||||
if (all_ident) {
|
||||
ret -= (FNAME(PIX_PAIR_SCORE)[0]) * 3;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ unsigned long get_virt_delta(RedMemSlotInfo *info, unsigned long addr, int group
|
||||
|
||||
slot_id = get_memslot_id(info, addr);
|
||||
if (slot_id > info->num_memslots) {
|
||||
PANIC("slod_id %d too big", slot_id);
|
||||
PANIC("slot_id %d too big", slot_id);
|
||||
}
|
||||
|
||||
slot = &info->mem_slots[group_id][slot_id];
|
||||
|
||||
@ -226,7 +226,7 @@ typedef struct RedSocketInData {
|
||||
|
||||
uint32_t num_buffers;
|
||||
|
||||
int32_t num_tokens; // No. tokens conusmed by slirp since the last token msg sent to the
|
||||
int32_t num_tokens; // No. tokens consumed by slirp since the last token msg sent to the
|
||||
// client. can be negative if we loaned some to the client (when the
|
||||
// ready queue is empty)
|
||||
uint32_t client_total_num_tokens;
|
||||
@ -474,13 +474,13 @@ static inline void tunnel_channel_activate_migrated_sockets(TunnelChannel *chann
|
||||
/*******************************************************************************************/
|
||||
|
||||
/* use for signaling that 1) subroutines failed 2)routines in the interface for slirp
|
||||
failed (which triggred from a call to slirp) */
|
||||
failed (which triggered from a call to slirp) */
|
||||
#define SET_TUNNEL_ERROR(channel,format, ...) { \
|
||||
channel->tunnel_error = TRUE; \
|
||||
red_printf(format, ## __VA_ARGS__); \
|
||||
}
|
||||
|
||||
/* should be checked after each subroutine that may cause error or fter calls to slirp routines */
|
||||
/* should be checked after each subroutine that may cause error or after calls to slirp routines */
|
||||
#define CHECK_TUNNEL_ERROR(channel) (channel->tunnel_error)
|
||||
|
||||
struct TunnelChannel {
|
||||
@ -1542,7 +1542,7 @@ static int tunnel_channel_handle_socket_closed(TunnelChannel *channel, RedSocket
|
||||
net_slirp_socket_abort(sckt->slirp_sckt);
|
||||
} else if ((sckt->slirp_status != SLIRP_SCKT_STATUS_WAIT_CLOSE) ||
|
||||
(prev_client_status != CLIENT_SCKT_STATUS_SHUTDOWN_SEND)) {
|
||||
// slirp can be in wait close if both slirp and client sent fin perviously
|
||||
// slirp can be in wait close if both slirp and client sent fin previously
|
||||
// otherwise, the prev client status would also have been wait close, and this
|
||||
// case was handled above
|
||||
red_printf("unexpected slirp_status=%d", sckt->slirp_status);
|
||||
@ -1570,7 +1570,7 @@ static int tunnel_channel_handle_socket_closed_ack(TunnelChannel *channel, RedSo
|
||||
}
|
||||
|
||||
if (sckt->slirp_status != SLIRP_SCKT_STATUS_CLOSED) {
|
||||
red_printf("unexcpected SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK slirp_status=%d",
|
||||
red_printf("unexpected SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK slirp_status=%d",
|
||||
sckt->slirp_status);
|
||||
return FALSE;
|
||||
}
|
||||
@ -1584,12 +1584,12 @@ static int tunnel_channel_handle_socket_receive_data(TunnelChannel *channel, Red
|
||||
{
|
||||
if ((sckt->client_status == CLIENT_SCKT_STATUS_SHUTDOWN_SEND) ||
|
||||
(sckt->client_status == CLIENT_SCKT_STATUS_CLOSED)) {
|
||||
red_printf("unexcpected SPICE_MSGC_TUNNEL_SOCKET_DATA clinet_status=%d",
|
||||
red_printf("unexpected SPICE_MSGC_TUNNEL_SOCKET_DATA client_status=%d",
|
||||
sckt->client_status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// handling a case where the client sent data before it recieved the close msg
|
||||
// handling a case where the client sent data before it received the close msg
|
||||
if ((sckt->slirp_status != SLIRP_SCKT_STATUS_OPEN) &&
|
||||
(sckt->slirp_status != SLIRP_SCKT_STATUS_SHUTDOWN_SEND)) {
|
||||
__tunnel_worker_free_socket_rcv_buf(sckt->worker, recv_data);
|
||||
@ -1606,7 +1606,7 @@ static int tunnel_channel_handle_socket_receive_data(TunnelChannel *channel, Red
|
||||
|
||||
tunnel_socket_assign_rcv_buf(sckt, recv_data, buf_size);
|
||||
if (!sckt->in_data.client_total_num_tokens) {
|
||||
red_printf("token vailoation");
|
||||
red_printf("token violation");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1915,7 +1915,7 @@ static void __restore_ready_chunks_queue(RedSocket *sckt, ReadyTunneledChunkQueu
|
||||
}
|
||||
|
||||
// not using the alloc_buf cb of the queue, since we may want to create the migrated buffers
|
||||
// with other properties (e.g., not releasing tokent)
|
||||
// with other properties (e.g., not releasing token)
|
||||
static void __restore_process_queue(RedSocket *sckt, TunneledBufferProcessQueue *queue,
|
||||
uint8_t *data, int size,
|
||||
socket_alloc_buffer_proc_t alloc_buf)
|
||||
@ -2711,7 +2711,7 @@ static void tunnel_channel_send_socket_out_data(TunnelChannel *channel, PipeItem
|
||||
}
|
||||
|
||||
if (!sckt->out_data.num_tokens) {
|
||||
return; // only when an we will recieve tokens, data will be sent again.
|
||||
return; // only when an we will receive tokens, data will be sent again.
|
||||
}
|
||||
|
||||
ASSERT(sckt->out_data.ready_chunks_queue.head);
|
||||
@ -2767,7 +2767,7 @@ static void tunnel_worker_release_socket_out_data(TunnelWorker *worker, PipeItem
|
||||
|
||||
sckt_out_data->data_size -= sckt_out_data->push_tail_size;
|
||||
|
||||
// compansation. was substructed in the previous lines
|
||||
// compensation. was subtracted in the previous lines
|
||||
sckt_out_data->data_size += sckt_out_data->ready_chunks_queue.offset;
|
||||
|
||||
if (sckt_out_data->push_tail_size == sckt_out_data->push_tail->size) {
|
||||
@ -2784,8 +2784,8 @@ static void tunnel_worker_release_socket_out_data(TunnelWorker *worker, PipeItem
|
||||
// can still send data to socket
|
||||
if (__client_socket_can_receive(sckt)) {
|
||||
if (sckt_out_data->ready_chunks_queue.head) {
|
||||
// the pipe item may alreay be linked, if for example the send was
|
||||
// blocked and before it finshed and called release, tunnel_socket_send was called
|
||||
// the pipe item may already be linked, if for example the send was
|
||||
// blocked and before it finished and called release, tunnel_socket_send was called
|
||||
if (!red_channel_pipe_item_is_linked(
|
||||
&worker->channel->base, &sckt_out_data->data_pipe_item)) {
|
||||
sckt_out_data->data_pipe_item.type = PIPE_ITEM_TYPE_SOCKET_DATA;
|
||||
@ -3097,7 +3097,7 @@ static int tunnel_socket_recv(SlirpUsrNetworkInterface *usr_interface, UserSocke
|
||||
|
||||
if ((sckt->slirp_status == SLIRP_SCKT_STATUS_SHUTDOWN_RECV) ||
|
||||
(sckt->slirp_status == SLIRP_SCKT_STATUS_WAIT_CLOSE)) {
|
||||
SET_TUNNEL_ERROR(worker->channel, "recieve was shutdown");
|
||||
SET_TUNNEL_ERROR(worker->channel, "receive was shutdown");
|
||||
tunnel_shutdown(worker);
|
||||
errno = ECONNRESET;
|
||||
return -1;
|
||||
@ -3155,8 +3155,8 @@ static void null_tunnel_socket_shutdown_send(SlirpUsrNetworkInterface *usr_inter
|
||||
{
|
||||
}
|
||||
|
||||
// can be called : 1) when a FIN is reqested from the guset 2) after shutdown rcv that was called
|
||||
// after recieved failed because the client socket was sent FIN
|
||||
// can be called : 1) when a FIN is requested from the guest 2) after shutdown rcv that was called
|
||||
// after received failed because the client socket was sent FIN
|
||||
static void tunnel_socket_shutdown_send(SlirpUsrNetworkInterface *usr_interface, UserSocket *opaque)
|
||||
{
|
||||
TunnelWorker *worker;
|
||||
@ -3269,7 +3269,7 @@ static void null_tunnel_socket_close(SlirpUsrNetworkInterface *usr_interface, Us
|
||||
// was caused by an error
|
||||
}
|
||||
|
||||
// can be called during migration due to the channel diconnect. But it does not affect the
|
||||
// can be called during migration due to the channel disconnect. But it does not affect the
|
||||
// migrate data
|
||||
static void tunnel_socket_close(SlirpUsrNetworkInterface *usr_interface, UserSocket *opaque)
|
||||
{
|
||||
@ -3289,7 +3289,7 @@ static void tunnel_socket_close(SlirpUsrNetworkInterface *usr_interface, UserSoc
|
||||
|
||||
sckt->slirp_status = SLIRP_SCKT_STATUS_CLOSED;
|
||||
|
||||
// if sckt is not opened yet, close will be sent when we recieve connect ack
|
||||
// if sckt is not opened yet, close will be sent when we receive connect ack
|
||||
if ((sckt->client_status == CLIENT_SCKT_STATUS_OPEN) ||
|
||||
(sckt->client_status == CLIENT_SCKT_STATUS_SHUTDOWN_SEND)) {
|
||||
// check if there is still data to send. the close will be sent after data is released.
|
||||
|
||||
@ -584,7 +584,7 @@ typedef struct {
|
||||
|
||||
typedef struct RedGlzDrawable RedGlzDrawable;
|
||||
|
||||
/* for each qxl drawable, there may be serveral instances of lz drawables */
|
||||
/* for each qxl drawable, there may be several instances of lz drawables */
|
||||
typedef struct GlzDrawableInstanceItem {
|
||||
RingItem glz_link;
|
||||
RingItem free_link;
|
||||
@ -1185,7 +1185,7 @@ static void show_qxl_drawable(RedWorker *worker, QXLDrawable *drawable, const ch
|
||||
case QXL_DRAW_TEXT:
|
||||
break;
|
||||
default:
|
||||
red_error("bad rawable type");
|
||||
red_error("bad drawable type");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
@ -1601,7 +1601,7 @@ static inline void release_drawable(RedWorker *worker, Drawable *item)
|
||||
|
||||
if (item->red_glz_drawable) {
|
||||
item->red_glz_drawable->drawable = NULL;
|
||||
} else { // no refernce to the qxl drawable left
|
||||
} else { // no reference to the qxl drawable left
|
||||
free_qxl_drawable(worker, item->qxl_drawable, item->group_id, item->self_bitmap,
|
||||
item->surface_id);
|
||||
}
|
||||
@ -3837,7 +3837,7 @@ static inline void red_process_drawable(RedWorker *worker, QXLDrawable *drawable
|
||||
/*
|
||||
surface->refs is affected by a drawable (that is
|
||||
dependent on the surface) as long as the drawable is alive.
|
||||
However, surfce->depend_on_me is affected by a drawable only
|
||||
However, surface->depend_on_me is affected by a drawable only
|
||||
as long as it is in the current tree (hasn't been rendered yet).
|
||||
*/
|
||||
red_inc_surfaces_drawable_dependencies(worker, item);
|
||||
@ -4521,7 +4521,7 @@ static void red_draw_qxl_drawable(RedWorker *worker, Drawable *drawable)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
red_printf("invlaid type");
|
||||
red_printf("invalid type");
|
||||
}
|
||||
unlocalize_clip(&clip);
|
||||
}
|
||||
@ -5225,7 +5225,7 @@ static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannel *channel, Dra
|
||||
static GlzDrawableInstanceItem *red_display_add_glz_drawable_instance(RedGlzDrawable *glz_drawable)
|
||||
{
|
||||
ASSERT(glz_drawable->instances_count < MAX_GLZ_DRAWABLE_INSTANCES);
|
||||
// NOTE: We assume the addtions are performed consecutively, without removals in the middle
|
||||
// NOTE: We assume the additions are performed consecutively, without removals in the middle
|
||||
GlzDrawableInstanceItem *ret = glz_drawable->instances_pool + glz_drawable->instances_count;
|
||||
glz_drawable->instances_count++;
|
||||
|
||||
@ -5239,10 +5239,10 @@ static GlzDrawableInstanceItem *red_display_add_glz_drawable_instance(RedGlzDraw
|
||||
}
|
||||
|
||||
/* Remove from the to_free list and the instances_list.
|
||||
When no instance is left - the RedGlzDrawable is released too. (and the qxl drawblae too, if
|
||||
When no instance is left - the RedGlzDrawable is released too. (and the qxl drawable too, if
|
||||
it is not used by Drawable).
|
||||
NOTE - 1) can be called only by the display channel that created the drawable
|
||||
2) it is assumed that the instance was already removed from the dicitonary*/
|
||||
2) it is assumed that the instance was already removed from the dictionary*/
|
||||
static void red_display_free_glz_drawable_instance(DisplayChannel *channel,
|
||||
GlzDrawableInstanceItem *glz_drawable_instance)
|
||||
{
|
||||
@ -5258,7 +5258,7 @@ static void red_display_free_glz_drawable_instance(DisplayChannel *channel,
|
||||
|
||||
ring_remove(&glz_drawable_instance->glz_link);
|
||||
glz_drawable->instances_count--;
|
||||
// whan the remove callback is performed from the channel that the
|
||||
// when the remove callback is performed from the channel that the
|
||||
// drawable belongs to, the instance is not added to the 'to_free' list
|
||||
if (ring_item_is_linked(&glz_drawable_instance->free_link)) {
|
||||
ring_remove(&glz_drawable_instance->free_link);
|
||||
@ -5303,7 +5303,7 @@ static void red_display_handle_glz_drawables_to_free(DisplayChannel* channel)
|
||||
/* releases all the instances of the drawable from the dictionary and the display channel.
|
||||
The release of the last instance will also release the drawable itself and the qxl drawable
|
||||
if possible.
|
||||
NOTE - the caller should prevent encoding using the dicitonary during this operation*/
|
||||
NOTE - the caller should prevent encoding using the dictionary during this operation*/
|
||||
static void red_display_free_glz_drawable(DisplayChannel *channel, RedGlzDrawable *drawable)
|
||||
{
|
||||
RingItem *head_instance = ring_get_head(&drawable->instances);
|
||||
@ -5332,7 +5332,7 @@ static void red_display_free_glz_drawable(DisplayChannel *channel, RedGlzDrawabl
|
||||
}
|
||||
|
||||
/* Clear all lz drawables - enforce their removal from the global dictionary.
|
||||
NOTE - prevents encoding using the dicitonary during the operation*/
|
||||
NOTE - prevents encoding using the dictionary during the operation*/
|
||||
static void red_display_clear_glz_drawables(DisplayChannel *channel)
|
||||
{
|
||||
RingItem *ring_link;
|
||||
@ -5356,7 +5356,7 @@ static void red_display_clear_glz_drawables(DisplayChannel *channel)
|
||||
|
||||
/* Remove from the global lz dictionary some glz_drawables that have no reference to
|
||||
Drawable (their qxl drawables are released too).
|
||||
NOTE - the caller should prevent encoding using the dicitonary during the operation*/
|
||||
NOTE - the caller should prevent encoding using the dictionary during the operation*/
|
||||
static int red_display_free_some_independent_glz_drawables(DisplayChannel *channel)
|
||||
{
|
||||
int n = 0;
|
||||
@ -6916,7 +6916,7 @@ static inline uint8_t *red_get_image_line(RedWorker *worker, QXLDataChunk **chun
|
||||
}
|
||||
|
||||
if (data_size - *offset < stride) {
|
||||
red_printf("bad chunk aligment");
|
||||
red_printf("bad chunk alignment");
|
||||
return NULL;
|
||||
}
|
||||
ret = (*chunk)->data + *offset;
|
||||
@ -8126,7 +8126,7 @@ static inline void flush_display_commands(RedWorker *worker)
|
||||
red_receive(channel);
|
||||
red_send_data(channel, NULL);
|
||||
if (red_now() >= end_time) {
|
||||
red_printf("update timout");
|
||||
red_printf("update timeout");
|
||||
red_disconnect_display((RedChannel *)worker->display_channel);
|
||||
} else {
|
||||
sleep_count++;
|
||||
@ -9497,7 +9497,7 @@ void *red_worker_main(void *arg)
|
||||
if (worker.display_channel && worker.display_channel->glz_dict) {
|
||||
/* during migration, in the dest, the display channel can be initialized
|
||||
while the global lz data not since migrate data msg hasn't been
|
||||
recieved yet */
|
||||
received yet */
|
||||
red_display_handle_glz_drawables_to_free(worker.display_channel);
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ static void openssl_init();
|
||||
#define MM_TIMER_GRANULARITY_MS (1000 / 30)
|
||||
#define MM_TIME_DELTA 400 /*ms*/
|
||||
|
||||
// approximate max recive message size
|
||||
// approximate max receive message size
|
||||
#define RECIVE_BUF_SIZE \
|
||||
(4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) * SPICE_AGENT_MAX_DATA_SIZE)
|
||||
|
||||
@ -1467,7 +1467,7 @@ static int main_channel_restore_vdi_read_state(MainMigrateData *data, uint8_t **
|
||||
switch (state->read_state) {
|
||||
case VDI_PORT_READ_STATE_READ_HADER:
|
||||
if (data->read_buf_len) {
|
||||
red_printf("unexpected recive buf");
|
||||
red_printf("unexpected receive buf");
|
||||
reds_disconnect();
|
||||
return FALSE;
|
||||
}
|
||||
@ -1475,13 +1475,13 @@ static int main_channel_restore_vdi_read_state(MainMigrateData *data, uint8_t **
|
||||
break;
|
||||
case VDI_PORT_READ_STATE_GET_BUFF:
|
||||
if (state->message_recive_len > state->vdi_chunk_header.size) {
|
||||
red_printf("invalid message recive len");
|
||||
red_printf("invalid message receive len");
|
||||
reds_disconnect();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (data->read_buf_len) {
|
||||
red_printf("unexpected recive buf");
|
||||
red_printf("unexpected receive buf");
|
||||
reds_disconnect();
|
||||
return FALSE;
|
||||
}
|
||||
@ -1497,7 +1497,7 @@ static int main_channel_restore_vdi_read_state(MainMigrateData *data, uint8_t **
|
||||
}
|
||||
|
||||
if (state->message_recive_len > state->vdi_chunk_header.size) {
|
||||
red_printf("invalid message recive len");
|
||||
red_printf("invalid message receive len");
|
||||
reds_disconnect();
|
||||
return FALSE;
|
||||
}
|
||||
@ -1680,7 +1680,7 @@ static void reds_main_handle_message(void *opaque, SpiceDataHeader *message)
|
||||
VDAgentExtBuf *buf;
|
||||
|
||||
if (!reds->agent_state.num_client_tokens) {
|
||||
red_printf("token vailoation");
|
||||
red_printf("token violation");
|
||||
reds_disconnect();
|
||||
break;
|
||||
}
|
||||
@ -1788,7 +1788,7 @@ static void reds_main_handle_message(void *opaque, SpiceDataHeader *message)
|
||||
// probably high load on client or server result with incorrect values
|
||||
letancy = 0;
|
||||
red_printf("net test: invalid values, letancy %lu roundtrip %lu. assuming high"
|
||||
"bendwidth", letancy, roundtrip);
|
||||
"bandwidth", letancy, roundtrip);
|
||||
break;
|
||||
}
|
||||
bitrate_per_sec = (uint64_t)(NET_TEST_BYTES * 8) * 1000000 / (roundtrip - letancy);
|
||||
@ -1991,7 +1991,7 @@ static int reds_send_link_error(RedLinkInfo *link, uint32_t error)
|
||||
|
||||
static void reds_show_new_channel(RedLinkInfo *link)
|
||||
{
|
||||
red_printf("channel %d:%d, connected sucessfully, over %s link",
|
||||
red_printf("channel %d:%d, connected successfully, over %s link",
|
||||
link->link_mess->channel_type,
|
||||
link->link_mess->channel_id,
|
||||
link->peer->ssl == NULL ? "Non Secure" : "Secure");
|
||||
@ -2516,7 +2516,7 @@ static void reds_handle_other_links(RedLinkInfo *link)
|
||||
if (link_mess->channel_type == SPICE_CHANNEL_INPUTS && !link->peer->ssl) {
|
||||
SimpleOutItem *item;
|
||||
SpiceMsgNotify *notify;
|
||||
char *mess = "keybord channel is unsecure";
|
||||
char *mess = "keyboard channel is insecure";
|
||||
const int mess_len = strlen(mess);
|
||||
|
||||
if (!(item = new_simple_out_item(SPICE_MSG_NOTIFY, sizeof(SpiceMsgNotify) + mess_len + 1))) {
|
||||
@ -3419,7 +3419,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
}
|
||||
if (interface->major_version != SPICE_INTERFACE_KEYBOARD_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_KEYBOARD_MINOR) {
|
||||
red_printf("unsuported keyboard interface");
|
||||
red_printf("unsupported keyboard interface");
|
||||
return -1;
|
||||
}
|
||||
keyboard = SPICE_CONTAINEROF(sin, SpiceKbdInstance, base);
|
||||
@ -3433,7 +3433,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
}
|
||||
if (interface->major_version != SPICE_INTERFACE_MOUSE_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_MOUSE_MINOR) {
|
||||
red_printf("unsuported mouse interface");
|
||||
red_printf("unsupported mouse interface");
|
||||
return -1;
|
||||
}
|
||||
mouse = SPICE_CONTAINEROF(sin, SpiceMouseInstance, base);
|
||||
@ -3445,7 +3445,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
red_printf("SPICE_INTERFACE_QXL");
|
||||
if (interface->major_version != SPICE_INTERFACE_QXL_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_QXL_MINOR) {
|
||||
red_printf("unsuported qxl interface");
|
||||
red_printf("unsupported qxl interface");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -3462,7 +3462,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
}
|
||||
if (interface->major_version != SPICE_INTERFACE_TABLET_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_TABLET_MINOR) {
|
||||
red_printf("unsuported tablet interface");
|
||||
red_printf("unsupported tablet interface");
|
||||
return -1;
|
||||
}
|
||||
tablet = SPICE_CONTAINEROF(sin, SpiceTabletInstance, base);
|
||||
@ -3479,7 +3479,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
red_printf("SPICE_INTERFACE_PLAYBACK");
|
||||
if (interface->major_version != SPICE_INTERFACE_PLAYBACK_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_PLAYBACK_MINOR) {
|
||||
red_printf("unsuported playback interface");
|
||||
red_printf("unsupported playback interface");
|
||||
return -1;
|
||||
}
|
||||
snd_attach_playback(SPICE_CONTAINEROF(sin, SpicePlaybackInstance, base));
|
||||
@ -3488,7 +3488,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
red_printf("SPICE_INTERFACE_RECORD");
|
||||
if (interface->major_version != SPICE_INTERFACE_RECORD_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_RECORD_MINOR) {
|
||||
red_printf("unsuported record interface");
|
||||
red_printf("unsupported record interface");
|
||||
return -1;
|
||||
}
|
||||
snd_attach_record(SPICE_CONTAINEROF(sin, SpiceRecordInstance, base));
|
||||
@ -3501,7 +3501,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
}
|
||||
if (interface->major_version != SPICE_INTERFACE_VDI_PORT_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_VDI_PORT_MINOR) {
|
||||
red_printf("unsuported vdi port interface");
|
||||
red_printf("unsupported vdi port interface");
|
||||
return -1;
|
||||
}
|
||||
attach_to_red_agent(SPICE_CONTAINEROF(sin, SpiceVDIPortInstance, base));
|
||||
@ -3516,7 +3516,7 @@ __visible__ int spice_server_add_interface(SpiceServer *s,
|
||||
}
|
||||
if (interface->major_version != SPICE_INTERFACE_NET_WIRE_MAJOR ||
|
||||
interface->minor_version < SPICE_INTERFACE_NET_WIRE_MINOR) {
|
||||
red_printf("unsuported net wire interface");
|
||||
red_printf("unsupported net wire interface");
|
||||
return -1;
|
||||
}
|
||||
net = SPICE_CONTAINEROF(sin, SpiceNetWireInstance, base);
|
||||
|
||||
@ -31,7 +31,7 @@ typedef struct RedsStreamContext {
|
||||
SpiceWatch *watch;
|
||||
|
||||
/* set it to TRUE if you shutdown the socket. shutdown read doesn't work as accepted -
|
||||
receive may return data afterwards. check the flag before calling receive*/
|
||||
receive may return data afterward. check the flag before calling receive*/
|
||||
int shutdown;
|
||||
SSL *ssl;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user