Languages

Menu
Sites
Language
Calling the http_transaction_destroy() method causes segmentation fault.

I am using the internet (http.h) methods on a native app for Gear S3.

I am able to create a session, create a transaction, set callbacks on the transaction, and then submit the transaction.  However, I don't know where I need to destroy the transaction via http_transaction_destroy()?  When I put it in the transation_complete callback, it causes a segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
0xf7277d24 in ?? () from C:\tizen-studio\platforms\tizen-3.0\wearable\rootstraps\wearable-3.0-device.core/lib/libc.so.6

If I don't destroy the transaction handle, it seems to work, but I am guessing this will cause the transaction handles to continuously climb as I execute new transactions.

Thanks,

Kim

Edited by: Ippolito on 26 Mar, 2018
View Selected Answer

Responses

2 Replies
Mark as answer
GEUNSOO KIM

1. usually those parameter-passed hadles (like http_transaction_h) are not suppose to be destroyed in any callbacks unless API documents say so. In many cases, they are working in asynchronous, so altering theose parameters will make troubles.

2. I assume that you are using "transaction" as non-local variable and using the same variable all the time. In that case, maybe you can add destroy() when "test" button is pressed. Of cause you should check the handle first. if it is not NULL, destroy it and set it to NULL first, then take your old routines.

3. or you can use "libcurl" instead of "http" library. it seems that Samsung have added "http" library recently so there are far less examples or documents compared with "libcurl". and "libcurl" can do anything "http" can do. (I guess that backbone of new "http" is "libcurl"..)

Good luck.

 

Ippolito

Geunsoo,

Thanks for your response.  Feedback on your three comments:

1. I think you are right - this is what the problem is - so I shouldn't try to destroy the handle in the callback.

2. I will try this to see if it works.

3. I just started to look at libcurl also - so this might be an alternative.

Thanks, and I will post what I find with 2 & 3.

Thanks!