From: Munkyu Im Date: Thu, 4 Sep 2014 13:43:22 +0000 (+0900) Subject: proxy: Save http proxy information X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94cb4d857aabdcf4221971f76f4cd87d4c7804c0;p=sdk%2Femulator%2Fqemu.git proxy: Save http proxy information It's for setting proxy in Emulator Control Panel. Change-Id: Ica57435c08d7dbe458f36741208b39dce7428080 Signed-off-by: Munkyu Im --- diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index 7d45b99720..a651d00f13 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -77,6 +77,7 @@ int get_emul_resolution_height(void) return _emul_info.resolution_h; } + /* sdl bits per pixel */ void set_emul_sdl_bpp(int bpp) { @@ -294,3 +295,24 @@ char* get_emul_vm_name(void) return _emul_info.vm_name; } +/* emualtor http proxy */ +void set_emul_http_proxy_addr(char *addr) +{ + strcpy(_emul_info.http_proxy_addr, addr); +} + +char* get_emul_http_proxy_addr(void) +{ + return _emul_info.http_proxy_addr; +} + +void set_emul_http_proxy_port(char *port) +{ + strcpy(_emul_info.http_proxy_port, port); +} + +char* get_emul_http_proxy_port(void) +{ + return _emul_info.http_proxy_port; +} + diff --git a/tizen/src/emul_state.h b/tizen/src/emul_state.h index 62fe4eb77d..737f3397ef 100644 --- a/tizen/src/emul_state.h +++ b/tizen/src/emul_state.h @@ -3,7 +3,7 @@ * * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. * - * Contact: + * Contact: * SeokYeon Hwang * MunKyu Im * GiWoong Kim @@ -33,10 +33,12 @@ #ifndef __EMUL_STATE_H__ #define __EMUL_STATE_H__ - #include "maru_common.h" #include "maru_finger.h" +#define MAX_ADDR_LEN 128 +#define MAX_PORT_LEN 6 + enum { RESET = 0, BOOT_COMPLETED = 1, @@ -91,6 +93,8 @@ typedef struct EmulatorConfigInfo { int vm_base_port; int device_serial_number; int ecs_port; + char http_proxy_addr[MAX_ADDR_LEN]; + char http_proxy_port[MAX_PORT_LEN]; char *vm_name; /* add here */ } EmulatorConfigInfo; @@ -122,6 +126,8 @@ void set_emul_rotation(short rotation_type); void set_emul_caps_lock_state(int state); void set_emul_num_lock_state(int state); void set_emul_vm_name(char *vm_name); +void set_emul_http_proxy_addr(char *addr); +void set_emul_http_proxy_port(char *port); /* getter */ bool get_emul_skin_enable(void); @@ -144,5 +150,7 @@ int get_host_lock_key_state_darwin(int key); int get_emul_caps_lock_state(void); int get_emul_num_lock_state(void); char* get_emul_vm_name(void); +char* get_emul_http_proxy_addr(void); +char* get_emul_http_proxy_port(void); #endif /* __EMUL_STATE_H__ */ diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 3ed27c68a7..fa7c841f6f 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -300,6 +300,13 @@ static void prepare_basic_features(gchar * const kernel_cmdline) http_proxy, https_proxy, ftp_proxy, socks_proxy, dns, get_emul_resolution_width(), get_emul_resolution_height()); + if(strlen(http_proxy) > 0) { + gchar** proxy = g_strsplit(http_proxy, ":", 2); + INFO("http_proxy address: %s, port: %s\n", proxy[0], proxy[1]); + set_emul_http_proxy_addr(proxy[0]); + set_emul_http_proxy_port(proxy[1]); + g_strfreev(proxy); + } g_strlcat(kernel_cmdline, tmp_str, LEN_MARU_KERNEL_CMDLINE); g_free(tmp_str);