_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;
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;
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;
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);