Fixed bug related with POST 24/127424/1 accepted/tizen/unified/20170428.032836 submit/tizen/20170427.090631 tizen_4.0.m1_release
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 27 Apr 2017 08:03:26 +0000 (17:03 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 27 Apr 2017 08:03:38 +0000 (17:03 +0900)
Change-Id: I40c9b54bb32b33a23fe8c1ef7e06e3f78ceedb1d
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/capi-network-http.spec
src/http_transaction.c
test/http_test.c

index cce800e..90c415a 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-http
 Summary:       Http Framework
-Version:       0.0.22
+Version:       0.0.23
 Release:       0
 Group:         System/Network
 License:       Apache-2.0
index 19a5b4d..f5c87d3 100644 (file)
@@ -414,13 +414,11 @@ int _transaction_submit(gpointer user_data)
        _get_request_body_size(transaction, &body_size);
 
        /* Setup for POST method */
-       if (transaction->write_event) {
-               if (content_len > 0 && content_len <= body_size)
-                       write_event = FALSE;
-               else
-                       write_event = TRUE;
-               DBG("The write_event is %d.\n", write_event);
-       }
+       if (transaction->write_event)
+               write_event = TRUE;
+
+       DBG("The write_event[%d/%d] formpost[%d] upload_event[%d]\n",
+                       transaction->write_event, write_event, request->formpost, transaction->upload_event);
 
        if ((_get_method(request->method) == HTTP_METHOD_POST) && !write_event && !request->formpost) {
                gchar *body = NULL;
@@ -520,7 +518,9 @@ API int http_session_open_transaction(http_session_h http_session, http_method_e
        transaction->timer_event = 0;
        transaction->interface_name = NULL;
        transaction->timeout = 0;
-       transaction->verify_peer = 1;
+       transaction->write_event = 0;
+       transaction->upload_event = FALSE;
+       transaction->verify_peer = TRUE;
        transaction->ca_path = g_strdup(HTTP_DEFAULT_CA_PATH);
        transaction->error[0] = '\0';
        transaction->cancel = 0;
@@ -1151,6 +1151,7 @@ API int http_transaction_open_authentication(http_transaction_h http_transaction
                auth_transaction->realm = g_strdup(transaction->realm);
 
        auth_transaction->write_event = FALSE;
+       auth_transaction->upload_event = FALSE;
 
        auth_transaction->header_cb = NULL;
        auth_transaction->header_user_data = NULL;
index e2a4f31..c275460 100644 (file)
@@ -302,12 +302,12 @@ int test_simple_post(void)
                ERR("Fail to open transaction", ret);
                return 0;
        }
-       ret = http_transaction_request_set_uri(transaction, "http://posttestserver.com/post.php");
+       ret = http_transaction_request_set_uri(transaction, "http://httpbin.org/post");
        if (ret != 0) {
                ERR("Fail to set URI", ret);
                return 0;
        }
-       http_transaction_set_ready_to_write(transaction, TRUE);
+       http_transaction_header_add_field(transaction, "Expect", "");
        http_transaction_request_write_body(transaction, post_msg);
 
        _register_callbacks(transaction);