@@ -151,7 +151,7 @@ spice_session_setup_from_vv(VirtViewerFile *file, SpiceSession *session)
151
151
152
152
void spice_session_setup (SpiceSession * session , const char * host , const char * port ,
153
153
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 ) {
155
155
156
156
g_return_if_fail (SPICE_IS_SESSION (session ));
157
157
@@ -170,6 +170,8 @@ void spice_session_setup(SpiceSession *session, const char *host, const char *po
170
170
g_object_set (session , "ca" , ca_cert , NULL );
171
171
if (cert_subj )
172
172
g_object_set (session , "cert-subject" , cert_subj , NULL );
173
+ if (proxy )
174
+ g_object_set (session , "proxy" , proxy , NULL );
173
175
}
174
176
175
177
static void signal_handler (int signal , siginfo_t * info , void * reserved ) {
@@ -214,7 +216,7 @@ gboolean getJvmAndMethodReferences (JNIEnv *env) {
214
216
215
217
JNIEXPORT jint JNICALL
216
218
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 )
218
220
{
219
221
const gchar * host = NULL ;
220
222
const gchar * port = NULL ;
@@ -235,7 +237,7 @@ Java_com_undatech_opaque_SpiceCommunicator_SpiceClientConnect (JNIEnv *env, jobj
235
237
ca_file = (* env )-> GetStringUTFChars (env , cf , NULL );
236
238
cert_subj = (* env )-> GetStringUTFChars (env , cs , NULL );
237
239
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 );
239
241
240
242
jvm = NULL ;
241
243
jni_connector_class = NULL ;
@@ -246,14 +248,14 @@ Java_com_undatech_opaque_SpiceCommunicator_SpiceClientConnect (JNIEnv *env, jobj
246
248
247
249
248
250
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 )
251
253
{
252
254
spice_connection * conn ;
253
255
254
256
soundEnabled = sound ;
255
257
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 );
257
259
return connectSession (conn );
258
260
}
259
261
@@ -477,6 +479,7 @@ int CreateOvirtSession(JNIEnv *env, jobject obj, const gchar *uri, const gchar *
477
479
gchar * ghost = NULL ;
478
480
gchar * ticket = NULL ;
479
481
gchar * spice_host_subject = NULL ;
482
+ gchar * proxyuri = NULL ;
480
483
481
484
if (!getJvmAndMethodReferences (env )) {
482
485
success = -1 ;
@@ -597,6 +600,7 @@ int CreateOvirtSession(JNIEnv *env, jobject obj, const gchar *uri, const gchar *
597
600
"secure-port" , & secure_port ,
598
601
"ticket" , & ticket ,
599
602
"host-subject" , & spice_host_subject ,
603
+ "proxy" , & proxyuri ,
600
604
NULL );
601
605
602
606
gport = g_strdup_printf ("%d" , port );
@@ -622,7 +626,7 @@ int CreateOvirtSession(JNIEnv *env, jobject obj, const gchar *uri, const gchar *
622
626
g_object_get (G_OBJECT (proxy ), "ca-cert" , & ca_cert , NULL );
623
627
624
628
// 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 );
626
630
}
627
631
628
632
error :
0 commit comments