Commit 8b546ddc authored by smorlat's avatar smorlat

various things in progress.



git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@225 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 3a1871b7
......@@ -23,12 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static ms_thread_t fonis_thread;
typedef struct _FonisContext{
char domain[128];
char username[128];
} FonisContext;
static void *fonis_thread_func(void *arg){
if (p2pproxy_application_start(0,NULL)!=0){
......@@ -55,14 +49,6 @@ static int fonis_create_account(const char *uri, const char *passwd){
static int fonis_login_account(SipSetupContext * ctx,const char *uri, const char *passwd){
if (p2pproxy_accountmgt_isValidAccount==P2PPROXY_ACCOUNTMGT_USER_EXIST) {
FonisContext *fc;
osip_from_t *from;
ctx->data=fc=(FonisContext*)ms_new0(FonisContext,1);
osip_from_init(&from);
osip_from_parse(from,uri);
strncpy(fc->domain,uri->url->host,sizeof(fc->domain);
strncpy(fc->username,uri->url->username,sizeof(fc->username));
osip_from_free(from);
return 0;
}
else return -1;
......@@ -78,7 +64,7 @@ static int fonis_get_stun_servers(SipSetupContext *ctx, char *stun1, char *stun2
FonisContext *fc=(FonisContext*)ctx->data;
int ret=-1;
p2pproxy_resourcemgt_resource_list_t* l=p2pproxy_resourcemgt_new_resource_list();
if (p2pproxy_resourcemgt_lookup_media_resource(l,fc->domain)==0){
if (p2pproxy_resourcemgt_lookup_media_resource(l,ctx->domain)==0){
if (l->size>0) strncpy(stun1,l->resource_uri[0],size);
if (l->size>1) strncpy(stun2,l->resource_uri[1],size);
ret=0;
......@@ -91,7 +77,7 @@ static int fonis_get_stun_relay(SipSetupContext *ctx, char *relay, size_t size){
FonisContext *fc=(FonisContext*)ctx->data;
int ret=-1;
p2pproxy_resourcemgt_resource_list_t* l=p2pproxy_resourcemgt_new_resource_list();
if (p2pproxy_resourcemgt_lookup_media_resource(l,fc->domain)==0){
if (p2pproxy_resourcemgt_lookup_media_resource(l,ctx->domain)==0){
if (l->size>0) strncpy(relay,l->resource_uri[0],size);
ret=0;
}
......
......@@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphonecore.h"
#include "sipsetup.h"
#include "lpconfig.h"
#include "private.h"
#include "mediastreamer2/mediastream.h"
......@@ -676,6 +677,7 @@ void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, co
lc->rsvp_enable = 1;
lc->rpc_enable = 0;
#endif
sip_setup_register_all();
sound_config_read(lc);
net_config_read(lc);
rtp_config_read(lc);
......@@ -1050,6 +1052,33 @@ static osip_to_t *osip_to_create(const char *to){
return ret;
}
static char *guess_route_if_any(LinphoneCore *lc, osip_to_t *parsed_url){
const MSList *elem=linphone_core_get_proxy_config_list(lc);
for(;elem!=NULL;elem=elem->next){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
char prx[256];
if (cfg->ssctx && sip_setup_context_get_proxy(cfg->ssctx,parsed_url->url->host,prx,sizeof(prx))==0){
ms_message("We have a proxy for domain %s",parsed_url->url->host);
if (strcmp(parsed_url->url->host,prx)!=0){
char *route=NULL;
osip_route_t *rt;
osip_route_init(&rt);
if (osip_route_parse(rt,prx)==0){
char *rtstr;
osip_uri_uparam_add(rt->url,osip_strdup("lr"),NULL);
osip_route_to_str(rt,&rtstr);
route=ms_strdup(rtstr);
osip_free(rtstr);
}
osip_route_free(rt);
ms_message("Adding a route: %s",route);
return route;
}
}
}
return NULL;
}
bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **real_url, osip_to_t **real_parsed_url, char **route){
enum_lookup_res_t *enumres=NULL;
osip_to_t *parsed_url=NULL;
......@@ -1113,6 +1142,7 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **rea
}
else *route=ms_strdup(tmproute);
#else
if (tmproute==NULL) *route=guess_route_if_any(lc,*real_parsed_url);
if (tmproute) *route=ms_strdup(tmproute);
#endif
return TRUE;
......@@ -1124,6 +1154,7 @@ bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **rea
if (real_parsed_url!=NULL) *real_parsed_url=parsed_url;
else osip_to_free(parsed_url);
if (tmproute) *route=ms_strdup(tmproute);
else *route=guess_route_if_any(lc,*real_parsed_url);
return TRUE;
}
/* else we could not do anything with url given by user, so display an error */
......@@ -2325,7 +2356,7 @@ void linphone_core_uninit(LinphoneCore *lc)
ui_config_uninit(lc);
lp_config_sync(lc->config);
lp_config_destroy(lc->config);
sip_setup_unregister_all();
#ifdef VIDEO_ENABLED
if (payload_type_h264_packetization_mode_1!=NULL)
payload_type_destroy(payload_type_h264_packetization_mode_1);
......
......@@ -141,6 +141,7 @@ typedef struct autoreplier_config
struct _LinphoneCore;
struct _sdp_context;
struct _SipSetupContext;
typedef struct _StreamParams
{
......@@ -285,6 +286,7 @@ typedef struct _LinphoneProxyConfig
int reg_time;
int rid;
char *type;
struct _SipSetupContext *ssctx;
bool_t frozen;
bool_t reg_sendregister;
bool_t auth_pending;
......
......@@ -572,7 +572,7 @@ static int recvStunResponse(ortp_socket_t sock, char *ipaddr, int *port, int *id
void linphone_core_run_stun_tests(LinphoneCore *lc, LinphoneCall *call){
const char *server=linphone_core_get_stun_server(lc);
if (lc->sip_conf.ipv6_enabled){
ms_warning("stun support is not implemented for ipv6");
return;
......
......@@ -19,6 +19,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
*/
#include "linphonecore.h"
#include "sipsetup.h"
#include <eXosip2/eXosip.h>
#include <osipparser2/osip_message.h>
#include "lpconfig.h"
......@@ -42,6 +43,7 @@ void linphone_proxy_config_destroy(LinphoneProxyConfig *obj){
if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy);
if (obj->reg_identity!=NULL) ms_free(obj->reg_identity);
if (obj->reg_route!=NULL) ms_free(obj->reg_route);
if (obj->ssctx!=NULL) sip_setup_context_free(obj->ssctx);
}
static void linphone_proxy_config_register(LinphoneProxyConfig *obj){
......@@ -503,6 +505,9 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
if (obj==NULL){
return;
}
if (obj->type!=NULL){
lp_config_set_string(config,key,"type",obj->type);
}
if (obj->reg_proxy!=NULL){
lp_config_set_string(config,key,"reg_proxy",obj->reg_proxy);
}
......@@ -520,6 +525,8 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config, int index)
{
const char *tmp;
const char *identity;
const char *proxy;
LinphoneProxyConfig *cfg;
char key[50];
......@@ -528,17 +535,23 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config
if (!lp_config_has_section(config,key)){
return NULL;
}
tmp=lp_config_get_string(config,key,"reg_proxy",NULL);
if (tmp==NULL) return NULL;
cfg=linphone_proxy_config_new();
linphone_proxy_config_set_server_addr(cfg,tmp);
identity=lp_config_get_string(config,key,"reg_identity",NULL);
tmp=lp_config_get_string(config,key,"type",NULL);
proxy=lp_config_get_string(config,key,"reg_proxy",NULL);
if (tmp!=NULL && strlen(tmp)>0){
cfg=linphone_proxy_config_new_from_setup(tmp,identity);
if (cfg==NULL) return NULL;
}else{
if (!identity || !proxy) return NULL;
cfg=linphone_proxy_config_new();
linphone_proxy_config_set_identity(cfg,identity);
linphone_proxy_config_set_server_addr(cfg,proxy);
}
tmp=lp_config_get_string(config,key,"reg_route",NULL);
if (tmp!=NULL) linphone_proxy_config_set_route(cfg,tmp);
tmp=lp_config_get_string(config,key,"reg_identity",NULL);
if (tmp!=NULL) linphone_proxy_config_set_identity(cfg,tmp);
linphone_proxy_config_expires(cfg,lp_config_get_int(config,key,"reg_expires",600));
linphone_proxy_config_enableregister(cfg,lp_config_get_int(config,key,"reg_sendregister",0));
......@@ -548,7 +561,21 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config
}
LinphoneProxyConfig *linphone_proxy_config_new_from_setup(const char *type, const char *identity){
return NULL;
SipSetup *ss=sip_setup_lookup(type);
LinphoneProxyConfig *cfg;
SipSetupContext *ssc;
if (!ss) return NULL;
cfg=linphone_proxy_config_new();
linphone_proxy_config_set_identity(cfg,identity);
ssc=sip_setup_context_new(ss);
if (sip_setup_context_login_account(ssc,identity,NULL)==0){
char proxy[256];
if (sip_setup_context_get_proxy(ssc,NULL,proxy,sizeof(proxy))==0){
linphone_proxy_config_set_server_addr(cfg,proxy);
}
}
cfg->ssctx=ssc;
return cfg;
}
......@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern SipSetup fonis_sip_setup;
#endif
void sip_setup_register_all(void){
}
SipSetup *sip_setup_lookup(const char *type_name){
#ifdef HAVE_FONIS
......@@ -40,8 +42,16 @@ SipSetup *sip_setup_lookup(const char *type_name){
return NULL;
}
void sip_setup_unregister_all(void){
#ifdef HAVE_FONIS
if (fonis_sip_setup.initialized)
fonis_sip_setup.exit();
#endif
}
SipSetupContext *sip_setup_context_new(SipSetup *s){
SipSetupContext *obj=(SipSetupContext*)ms_new(SipSetupContext,1);
SipSetupContext *obj=(SipSetupContext*)ms_new0(SipSetupContext,1);
obj->funcs=s;
obj->data=NULL;
return obj;
......@@ -54,6 +64,12 @@ int sip_setup_new_account(SipSetup *funcs, const char *uri, const char *passwd){
}
int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd){
osip_from_t *from;
osip_from_init(&from);
osip_from_parse(from,uri);
strncpy(ctx->domain,from->url->host,sizeof(ctx->domain));
strncpy(ctx->username,from->url->username,sizeof(ctx->username));
osip_from_free(from);
if (ctx->funcs->login_account)
return ctx->funcs->login_account(ctx,uri,passwd);
return -1;
......@@ -61,7 +77,7 @@ int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, cons
int sip_setup_context_get_proxy(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz){
if (ctx->funcs->get_proxy)
return ctx->funcs->get_proxy(ctx,domain,proxy,sz);
return ctx->funcs->get_proxy(ctx,domain ? domain : ctx->domain,proxy,sz);
return -1;
}
......
......@@ -26,6 +26,8 @@ struct _SipSetup;
struct _SipSetupContext{
struct _SipSetup *funcs;
char domain[128];
char username[128];
void *data;
};
......@@ -45,7 +47,9 @@ struct _SipSetup{
typedef struct _SipSetup SipSetup;
void sip_setup_register_all(void);
SipSetup *sip_setup_lookup(const char *type_name);
void sip_setup_unregister_all(void);
int sip_setup_new_account(SipSetup *s, const char *uri, const char *passwd);
SipSetupContext * sip_setup_context_new(SipSetup *s);
......
/*
linphone, gtk-glade interface.
Copyright (C) 2008 Simon MORLAT (simon.morlat@linphone.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphone.h"
......@@ -41,6 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define LINPHONE_ICON "linphone2.png"
const char *this_program_ident_string="linphone_ident_string=" LINPHONE_VERSION;
static LinphoneCore *the_core=NULL;
static GtkWidget *the_ui=NULL;
......@@ -128,6 +130,52 @@ GtkWidget *linphone_gtk_get_main_window(){
return the_ui;
}
static void parse_item(const char *item, const char *window_name, GtkWidget *w){
char tmp[64];
char *dot;
strcpy(tmp,item);
dot=strchr(tmp,'.');
if (dot){
*dot='\0';
dot++;
if (strcmp(window_name,tmp)==0){
GtkWidget *wd=linphone_gtk_get_widget(w,dot);
if (wd) gtk_widget_hide(wd);
}
}
}
static void parse_hiddens(const char *hiddens, const char *window_name, GtkWidget *w){
char item[64];
const char *i;
const char *b;
int len;
for(b=i=hiddens;*i!='\0';++i){
if (*i==' '){
len=MIN(i-b,sizeof(item)-1);
strncpy(item,b,len);
item[len]='\0';
b=i+1;
parse_item(item,window_name,w);
}
}
len=MIN(i-b,sizeof(item)-1);
if (len>0){
strncpy(item,b,len);
item[len]='\0';
parse_item(item,window_name,w);
}
}
static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name){
const char *hiddens;
if (linphone_gtk_get_core()==NULL) return;
hiddens=linphone_gtk_get_ui_config("hidden_widgets",NULL);
if (hiddens){
parse_hiddens(hiddens,window_name,w);
}
}
#ifdef USE_LIBGLADE
GtkWidget *linphone_gtk_create_window(const char *window_name){
......@@ -147,6 +195,7 @@ GtkWidget *linphone_gtk_create_window(const char *window_name){
glade_xml_signal_autoconnect(gxml);
w=glade_xml_get_widget(gxml,window_name);
if (w==NULL) g_error("Could not retrieve '%s' window from xml file",window_name);
linphone_gtk_configure_window(w,window_name);
return w;
}
......@@ -355,9 +404,24 @@ static void completion_add_text(GtkEntry *entry, const char *text){
save_uri_history();
}
static void linphone_gtk_call_terminated(GtkWidget *mw){
gtk_widget_hide(linphone_gtk_get_widget(mw,"terminate_call"));
gtk_widget_show(linphone_gtk_get_widget(mw,"start_call"));
g_object_set_data(G_OBJECT(mw),"incoming_call",NULL);
}
gboolean check_call_active(){
if (!linphone_core_in_call(linphone_gtk_get_core())){
linphone_gtk_call_terminated(linphone_gtk_get_main_window());
return FALSE;
}
return TRUE;
}
static void linphone_gtk_call_started(GtkWidget *mw){
gtk_widget_hide(linphone_gtk_get_widget(mw,"start_call"));
gtk_widget_show(linphone_gtk_get_widget(mw,"terminate_call"));
g_timeout_add(250,(GSourceFunc)check_call_active,NULL);
}
void linphone_gtk_start_call(GtkWidget *w){
......@@ -379,12 +443,6 @@ void linphone_gtk_uri_bar_activate(GtkWidget *w){
}
static void linphone_gtk_call_terminated(GtkWidget *mw){
gtk_widget_hide(linphone_gtk_get_widget(mw,"terminate_call"));
gtk_widget_show(linphone_gtk_get_widget(mw,"start_call"));
g_object_set_data(G_OBJECT(mw),"incoming_call",NULL);
}
void linphone_gtk_terminate_call(GtkWidget *button){
linphone_core_terminate_call(linphone_gtk_get_core(),NULL);
linphone_gtk_call_terminated(gtk_widget_get_toplevel(button));
......@@ -727,28 +785,37 @@ static void linphone_gtk_check_menu_items(void){
static void linphone_gtk_configure_main_window(){
static gboolean config_loaded=FALSE;
static gboolean show_digits=1;
static gboolean show_identities=1;
static const char *title;
static const char *home;
static const char *icon_path;
static const char *start_call_icon;
static const char *stop_call_icon;
GtkWidget *w=linphone_gtk_get_main_window();
if (!config_loaded){
show_digits=linphone_gtk_get_ui_config_int("show_digits",1);
show_identities=linphone_gtk_get_ui_config_int("identity_frame",1);
title=linphone_gtk_get_ui_config("title",NULL);
home=linphone_gtk_get_ui_config("home","http://www.linphone.org");
icon_path=linphone_gtk_get_ui_config("icon",NULL);
start_call_icon=linphone_gtk_get_ui_config("start_call_icon",NULL);
stop_call_icon=linphone_gtk_get_ui_config("stop_call_icon",NULL);
config_loaded=TRUE;
}
if (show_digits==FALSE) gtk_widget_hide(linphone_gtk_get_widget(w,"dialpad"));
if (show_identities==FALSE) gtk_widget_hide(linphone_gtk_get_widget(w,"identity_frame"));
linphone_gtk_configure_window(w,"main_window");
if (title) gtk_window_set_title(GTK_WINDOW(w),title);
if (icon_path) {
GdkPixbuf *pbuf=create_pixbuf(icon_path);
gtk_window_set_icon(GTK_WINDOW(w),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
if (start_call_icon){
GdkPixbuf *pbuf=create_pixbuf(start_call_icon);
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"start_call_icon")),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
if (stop_call_icon){
GdkPixbuf *pbuf=create_pixbuf(stop_call_icon);
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"terminate_call_icon")),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
if (home){
gchar *tmp;
GtkWidget *menu_item=linphone_gtk_get_widget(w,"home_item");
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.5 on Thu Jan 8 14:52:09 2009 -->
<glade-interface>
<widget class="GtkAssistant" id="p2pwizard">
<property name="title" translatable="yes">Creating a FONICS account</property>
<signal name="apply" handler="linphone_gtk_fonis_wizard_apply"/>
<signal name="prepare" handler="linphone_gtk_fonis_wizard_prepare"/>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">WARNING: experimental feature !
FONICS stands for Free Overlay Network for Interactive Communication Systems
Based on SIP and Peer to Peer technologies, it allows people to find each other through the help of a virtual network.
Once you and your friends registered, you'll be able to call each other simply by entering your friend's username in linphone's sip uri box.
Read more information about FONICS at http://www.fonics.org
</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="page_type">GTK_ASSISTANT_PAGE_INTRO</property>
<property name="title">Introduction</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label" translatable="yes">Please choose a username:</property>
</widget>
</child>
<child>
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
<widget class="GtkEntry" id="username">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="linphone_gtk_fonis_wizard_check_username_clicked"/>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-apply</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="label" translatable="yes">Check availability</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="check_result">
<property name="visible">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="title">Create your account !</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">Done ! Your account is now created and ready to use.</property>
</widget>
<packing>
<property name="page_type">GTK_ASSISTANT_PAGE_CONFIRM</property>
<property name="title">Finished !</property>
</packing>
</child>
</widget>
</glade-interface>
......@@ -25,35 +25,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static int linphone_gtk_get_new_version(const char *version_url, char *version, size_t size){
DWORD dwSize = 0;
DWORD dwDownloaded = 0;
LPSTR pszOutBuffer;
BOOL bResults = FALSE;
HINTERNET hSession = NULL,
hConnect = NULL;
int ret=-1;
DWORD dwDownloaded = 0;
LPSTR pszOutBuffer;
BOOL bResults = FALSE;
HINTERNET hSession = NULL, hConnect = NULL;
int ret=-1;
hSession=InternetOpen("Linphone",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
if (hSession==NULL) return -1;
hConnect=InternetOpenUrl(hSession,version_url,NULL,0,0,0);
if (hConnect==NULL) {
InternetCloseHandle(hSession);
return -1;
}
if (InternetReadFile(hConnect,version,size,&dwDownloaded)){
dwDownloaded=0;
if (InternetReadFile(hConnect,version,size,&dwDownloaded) && dwDownloaded>0){
version[dwDownloaded]='\0';
ms_message("Got response: %s", version);
ret=0;
ms_message("Got response: %s", version);
ret=0;
}
// Close any open handles.
if (hConnect) InternetCloseHandle(hConnect);
if (hSession) InternetCloseHandle(hSession);
return ret;
// Close any open handles.
if (hConnect) InternetCloseHandle(hConnect);
if (hSession) InternetCloseHandle(hSession);
return ret;
}
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment