rfbSendServerCutText(screen, selection_str, strlen(selection_str));
len = strlen(selection_str); if (check_sel_direction("send", "cutbuffer_send", selection_str, len)) { rfbSendServerCutText(screen, selection_str, len); }
static void cutbuffer_send(void) {	Atom type;	int format, slen, dlen;	unsigned long nitems = 0, bytes_after = 0;	unsigned char* data = NULL;	selection_str[0] = '\0';	slen = 0;	/* read the property value into selection_str: */	do {		if (XGetWindowProperty(dpy, DefaultRootWindow(dpy),		    XA_CUT_BUFFER0, nitems/4, PROP_MAX/16, False,		    AnyPropertyType, &type, &format, &nitems, &bytes_after,		    &data) == Success) {			dlen = nitems * (format/8);			if (slen + dlen > PROP_MAX) {				/* too big */				rfbLog("warning: truncating large CUT_BUFFER0"				   " selection > %d bytes.\n", PROP_MAX);				XFree(data);				break;			}			memcpy(selection_str+slen, data, dlen);			slen += dlen;			selection_str[slen] = '\0';			XFree(data);		}	} while (bytes_after > 0);	selection_str[PROP_MAX] = '\0';	if (! all_clients_initialized()) {		rfbLog("cutbuffer_send: no send: uninitialized clients\n");		return; /* some clients initializing, cannot send */ 	}	/* now send it to any connected VNC clients (rfbServerCutText) */	if (!screen) {		return;	}	rfbSendServerCutText(screen, selection_str, strlen(selection_str));}