Feat:Delete useless code in FibocomHttpPortRequestSync
@@ -339,90 +339,6 @@ BOAT_RESULT FibocomHttpPortRequestSync(FibocomHttpPortContext *fibocomhttpport_c
BoatLog(BOAT_LOG_VERBOSE,"http_release success");
return result;
-
-#if 0
- httpclient_t client = {0};
- httpclient_data_t client_data = {0};
- BSINT32 response_code;
- BSINT32 ret;
-
- BOAT_RESULT result = BOAT_ERROR;
- boat_try_declare;
-
-
- if (mbedhttpport_context_ptr == NULL
- || request_str == NULL
- || response_str_ptr == NULL
- || response_len_ptr == NULL)
- {
- BoatLog(BOAT_LOG_CRITICAL, "Argument cannot be NULL.");
- result = BOAT_ERROR;
- boat_throw(BOAT_ERROR_INVALID_ARGUMENT, cleanup);
- }
-
- memset(&client, 0x00, sizeof(client));
- memset(&client_data, 0x00, sizeof(client_data));
-
- client.timeout_in_sec = 30;
-
- client_data.is_more = false;
-
- client_data.header_buf = mbedhttpport_context_ptr->http_response_head.string_ptr;
- client_data.header_buf_len = mbedhttpport_context_ptr->http_response_head.string_space;
- memset(client_data.header_buf, 0, client_data.header_buf_len);
-
- client_data.response_buf = mbedhttpport_context_ptr->http_response_body.string_ptr;
- client_data.response_buf_len = mbedhttpport_context_ptr->http_response_body.string_space;
- memset(client_data.response_buf, 0, client_data.response_buf_len);
-
-
- client_data.post_buf = request_str;
- client_data.post_buf_len = strlen(request_str);
-
- client_data.post_content_type = "application/json";
-
- BoatLog(BOAT_LOG_VERBOSE, "[HTTP]POST Start\n");
- ret = httpclient_post(&client, mbedhttpport_context_ptr->remote_url_str, &client_data);
- if (ret < 0)
- {
- BoatLog(BOAT_LOG_VERBOSE, "[HTTP]POST Failed:%d\n", ret);
- }
- else
- {
- BoatLog(BOAT_LOG_VERBOSE, "[HTTP]POST:\n%s\n", client_data.response_buf);
-
- mbedhttpport_context_ptr->http_response_body.string_len = client_data.response_buf_len;
-
- response_code = httpclient_get_response_code(&client);
-
- if (response_code == 200 || response_code == 201)
- {
- *response_str_ptr = mbedhttpport_context_ptr->http_response_body.string_ptr;
- *response_len_ptr = mbedhttpport_context_ptr->http_response_body.string_len;
-
- BoatLog(BOAT_LOG_VERBOSE, "Post: %s", request_str);
- BoatLog(BOAT_LOG_VERBOSE, "Result Code: %d", response_code);
- BoatLog(BOAT_LOG_VERBOSE, "Response: %s", *response_str_ptr);
-
- result = BOAT_SUCCESS;
- }
- else
- {
- BoatLog(BOAT_LOG_NORMAL, "HTTP POST fails with response code %d.", response_code);
- }
-
- }
-
-
- // Exceptional Clean Up
- boat_catch(cleanup)
- {
- BoatLog(BOAT_LOG_NORMAL, "Exception: %d", boat_exception);
- result = boat_exception;
- }
-
- return result;
-#endif
}
