Skip to content

Commit 2922f97

Browse files
committed
Added support for SpiceProxy into Opaque.
1 parent 148799c commit 2922f97

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

eclipse_projects/Opaque/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.undatech.opaque"
4-
android:versionCode="124"
5-
android:versionName="1.2.4" >
4+
android:versionCode="125"
5+
android:versionName="1.2.5" >
66

77
<uses-sdk
88
android:minSdkVersion="9"

eclipse_projects/Opaque/jni/src/android/android-service.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ spice_session_setup_from_vv(VirtViewerFile *file, SpiceSession *session)
151151

152152
void spice_session_setup(SpiceSession *session, const char *host, const char *port,
153153
const char *tls_port, const char *password, const char *ca_file,
154-
GByteArray *ca_cert, const char *cert_subj) {
154+
GByteArray *ca_cert, const char *cert_subj, const char *proxy) {
155155

156156
g_return_if_fail(SPICE_IS_SESSION(session));
157157

@@ -170,6 +170,8 @@ void spice_session_setup(SpiceSession *session, const char *host, const char *po
170170
g_object_set(session, "ca", ca_cert, NULL);
171171
if (cert_subj)
172172
g_object_set(session, "cert-subject", cert_subj, NULL);
173+
if (proxy)
174+
g_object_set(session, "proxy", proxy, NULL);
173175
}
174176

175177
static void signal_handler(int signal, siginfo_t *info, void *reserved) {
@@ -214,7 +216,7 @@ gboolean getJvmAndMethodReferences (JNIEnv *env) {
214216

215217
JNIEXPORT jint JNICALL
216218
Java_com_undatech_opaque_SpiceCommunicator_SpiceClientConnect (JNIEnv *env, jobject obj, jstring h, jstring p,
217-
jstring tp, jstring pw, jstring cf, jstring cs, jboolean sound)
219+
jstring tp, jstring pw, jstring cf, jstring cs, jboolean sound)
218220
{
219221
const gchar *host = NULL;
220222
const gchar *port = NULL;
@@ -235,7 +237,7 @@ Java_com_undatech_opaque_SpiceCommunicator_SpiceClientConnect (JNIEnv *env, jobj
235237
ca_file = (*env)->GetStringUTFChars(env, cf, NULL);
236238
cert_subj = (*env)->GetStringUTFChars(env, cs, NULL);
237239

238-
result = spiceClientConnect (host, port, tls_port, password, ca_file, NULL, cert_subj, sound);
240+
result = spiceClientConnect (host, port, tls_port, password, ca_file, NULL, cert_subj, sound, NULL);
239241

240242
jvm = NULL;
241243
jni_connector_class = NULL;
@@ -246,14 +248,14 @@ Java_com_undatech_opaque_SpiceCommunicator_SpiceClientConnect (JNIEnv *env, jobj
246248

247249

248250
int spiceClientConnect (const gchar *h, const gchar *p, const gchar *tp,
249-
const gchar *pw, const gchar *cf, GByteArray *cc,
250-
const gchar *cs, const gboolean sound)
251+
const gchar *pw, const gchar *cf, GByteArray *cc,
252+
const gchar *cs, const gboolean sound, const gchar *proxy)
251253
{
252254
spice_connection *conn;
253255

254256
soundEnabled = sound;
255257
conn = connection_new();
256-
spice_session_setup(conn->session, h, p, tp, pw, cf, cc, cs);
258+
spice_session_setup(conn->session, h, p, tp, pw, cf, cc, cs, proxy);
257259
return connectSession(conn);
258260
}
259261

@@ -477,6 +479,7 @@ int CreateOvirtSession(JNIEnv *env, jobject obj, const gchar *uri, const gchar *
477479
gchar *ghost = NULL;
478480
gchar *ticket = NULL;
479481
gchar *spice_host_subject = NULL;
482+
gchar *proxyuri = NULL;
480483

481484
if (!getJvmAndMethodReferences (env)) {
482485
success = -1;
@@ -597,6 +600,7 @@ int CreateOvirtSession(JNIEnv *env, jobject obj, const gchar *uri, const gchar *
597600
"secure-port", &secure_port,
598601
"ticket", &ticket,
599602
"host-subject", &spice_host_subject,
603+
"proxy", &proxyuri,
600604
NULL);
601605

602606
gport = g_strdup_printf("%d", port);
@@ -622,7 +626,7 @@ int CreateOvirtSession(JNIEnv *env, jobject obj, const gchar *uri, const gchar *
622626
g_object_get(G_OBJECT(proxy), "ca-cert", &ca_cert, NULL);
623627

624628
// We are ready to start the SPICE connection.
625-
success = spiceClientConnect (ghost, gport, gtlsport, ticket, NULL, ca_cert, spice_host_subject, sound);
629+
success = spiceClientConnect (ghost, gport, gtlsport, ticket, NULL, ca_cert, spice_host_subject, sound, proxyuri);
626630
}
627631

628632
error:

eclipse_projects/Opaque/jni/src/android/android-service.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void detachThreadFromJvm ();
5757

5858
int spiceClientConnect (const gchar *h, const gchar *p, const gchar *tp,
5959
const gchar *pw, const gchar *cf, GByteArray *cc,
60-
const gchar *cs, const gboolean sound);
60+
const gchar *cs, const gboolean sound, const gchar *proxy);
6161

6262
int spiceClientConnectVv (VirtViewerFile *vv_file, const gboolean sound);
6363

0 commit comments

Comments
 (0)