110 jobject aPeer, |
110 jobject aPeer, |
111 jint aNativeHttpTransaction, |
111 jint aNativeHttpTransaction, |
112 jobjectArray aHeaders, |
112 jobjectArray aHeaders, |
113 jbyteArray aPostData, |
113 jbyteArray aPostData, |
114 jint aPostDataLength, |
114 jint aPostDataLength, |
115 jint aResponseTimeout) |
115 jint aResponseTimeout, |
|
116 jboolean aPartialDataFlag) |
116 { |
117 { |
117 LOG(ESOCKET,EInfo,"http jni _submitTransaction"); |
118 LOG(ESOCKET,EInfo,"http jni _submitTransaction"); |
118 NativeHttpTransaction* tran = reinterpret_cast<NativeHttpTransaction*>(aNativeHttpTransaction); |
119 NativeHttpTransaction* tran = reinterpret_cast<NativeHttpTransaction*>(aNativeHttpTransaction); |
119 int respTimeOut = aResponseTimeout; |
120 int respTimeOut = aResponseTimeout; |
120 tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); |
121 tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); |
121 try |
122 try |
122 { |
123 { |
123 TRAPD(err,tran->SubmitL(aJni, &aPeer,aHeaders, aPostData, aPostDataLength, respTimeOut)); |
124 TRAPD(err,tran->SubmitL(aJni, &aPeer,aHeaders, aPostData, aPostDataLength, respTimeOut, aPartialDataFlag)); |
124 return err; |
125 return err; |
125 } |
126 } |
126 catch (...) |
127 catch (...) |
127 { |
128 { |
128 ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); |
129 ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); |
291 CleanupStack::PopAndDestroy(repository); |
293 CleanupStack::PopAndDestroy(repository); |
292 } |
294 } |
293 LOG(ESOCKET,EInfo,"GetUserAgentL() -"); |
295 LOG(ESOCKET,EInfo,"GetUserAgentL() -"); |
294 return header; |
296 return header; |
295 } |
297 } |
|
298 |
|
299 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1postData |
|
300 (JNIEnv *aJni, jobject, jint aNativeHttpTransaction, jbyteArray aPostData, jint aPostDataLength, jboolean iEndOfRequest) |
|
301 { |
|
302 LOG(ESOCKET,EInfo,"http jni _postData"); |
|
303 NativeHttpTransaction* tran = reinterpret_cast<NativeHttpTransaction*>(aNativeHttpTransaction); |
|
304 try |
|
305 { |
|
306 TRAPD(err,tran->PostDataL(aJni, aPostData, aPostDataLength, iEndOfRequest)); |
|
307 return err; |
|
308 } |
|
309 catch (...) |
|
310 { |
|
311 ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); |
|
312 return -1; |
|
313 } |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 } |
|
319 |