Fix TCP/IP API
Change-Id: I302bf1ff97d2560e6f68402e0fae609e1435e257
diff --git a/mbtk/mbtk_lib/src/mbtk_http_base.c b/mbtk/mbtk_lib/src/mbtk_http_base.c
index 40a6742..657b838 100755
--- a/mbtk/mbtk_lib/src/mbtk_http_base.c
+++ b/mbtk/mbtk_lib/src/mbtk_http_base.c
@@ -6,12 +6,6 @@
static void http_sock_cb_func(int handle, int fd, int event);
-static mbtk_init_info http_init_info =
-{
- MBTK_NET_LINUX,
- NULL,
- http_sock_cb_func
-};
static bool http_sock_inited = FALSE;
static int http_handle = -1;
static int http_fd = -1;
@@ -36,7 +30,11 @@
return -1;
}
- http_handle = mbtk_sock_init(&http_init_info);
+ mbtk_init_info init_info;
+ memset(&init_info, 0x0, sizeof(mbtk_init_info));
+ init_info.net_type = MBTK_NET_LINUX;
+ init_info.sock_cb = http_sock_cb_func;
+ http_handle = mbtk_sock_init(&init_info);
if(http_handle < 0) {
LOGE("mbtk_sock_init() fail.");
return -1;
@@ -174,7 +172,7 @@
char read_buf[1];
int read_len = 0;
while(TRUE) {
- if(mbtk_sock_read_async(http_handle, sock_fd, read_buf, 1) == 1) {
+ if(mbtk_sock_read_sync(http_handle, sock_fd, read_buf, 1) == 1) {
*buf_ptr++ = read_buf[0];
read_len++;