[gtk-vnc-devel] debug output



Hi, I just pushed this trivial patch, which shows the server version.

-- 
Jonh Wendell
www.bani.com.br

# HG changeset patch
# User Jonh Wendell <wendell bani com br>
# Date 1206891752 10800
# Node ID ed430aa8ee399476340a8764bd435f577a38ab9d
# Parent  159641abed9647ea7965b5ec55838fe0f78cdc42
Changed debug output in protocol initialization

diff -r 159641abed96 -r ed430aa8ee39 src/gvnc.c
--- a/src/gvnc.c	Sat Mar 29 16:27:10 2008 -0300
+++ b/src/gvnc.c	Sun Mar 30 12:42:32 2008 -0300
@@ -2721,23 +2721,24 @@ gboolean gvnc_initialize(struct gvnc *gv
 	if (ret != 2)
 		goto fail;
 
-	if (gvnc->major != 3)
+	if (gvnc->major != 3) {
+		GVNC_DEBUG("Major server version not supported (%d)\n", gvnc->major);
 		goto fail;
-	if (gvnc->minor != 3 &&
-	    gvnc->minor != 4 &&
-	    gvnc->minor != 5 &&
-	    gvnc->minor != 6 &&
-	    gvnc->minor != 7 &&
-	    gvnc->minor != 8)
+	}
+	if (gvnc->minor < 3 || gvnc->minor > 8) {
+		GVNC_DEBUG("Server version not supported (%d.%d)\n", gvnc->major, gvnc->minor);
 		goto fail;
+	}
+	GVNC_DEBUG("Server version: %d.%d\n", gvnc->major, gvnc->minor);
 
 	/* For UltraVNC ... */
-	if  (gvnc->minor > 3 && gvnc->minor < 7) gvnc->minor = 3;
+	if  (gvnc->minor > 3 && gvnc->minor < 7)
+		gvnc->minor = 3;
 
 	snprintf(version, 12, "RFB %03d.%03d\n", gvnc->major, gvnc->minor);
 	gvnc_write(gvnc, version, 12);
 	gvnc_flush(gvnc);
-	GVNC_DEBUG("Negotiated protocol %d %d\n", gvnc->major, gvnc->minor);
+	GVNC_DEBUG("Using version: %d.%d\n", gvnc->major, gvnc->minor);
 
 	if (!gvnc_perform_auth(gvnc)) {
 		GVNC_DEBUG("Auth failed\n");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]