.reference

git-svn-id: svn://ultimatepp.org/upp/trunk@4830 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-04-19 13:35:38 +00:00
parent 28471b5a29
commit 49061f09ba
4 changed files with 11 additions and 8 deletions

View file

@ -1,4 +1,4 @@
#ifndef _SocketProgress_icpp_init_stub
#define _SocketProgress_icpp_init_stub
#ifndef _GuiWebDownload_icpp_init_stub
#define _GuiWebDownload_icpp_init_stub
#include "CtrlLib/init"
#endif

View file

@ -21,13 +21,14 @@ void Loader::Perform()
if(!EditText(url, "Download", "URL"))
break;
loaded = 0;
HttpRequest http(url);
http.MaxContentSize(INT_MAX);
pi.Reset();
http.New();
http.Url(url).MaxContentSize(INT_MAX);
http.WhenContent = THISBACK(ProcessContent);
http.WhenWait = THISBACK(ShowProgress);
http.WhenWait = http.WhenDo = THISBACK(ShowProgress);
http.Execute();
if(!http.IsSuccess())
Exclamation("Failed !");
Exclamation("Failed !&\1" + http.GetErrorDesc());
}
}
@ -38,7 +39,7 @@ void Loader::ProcessContent(const void *ptr, int size)
void Loader::ShowProgress()
{
DDUMP(http.GetPeerAddr());
DDUMP(http.GetPeerAddr());
if(http.GetContentLength() >= 0)
pi.Set((int)loaded, (int)http.GetContentLength());
else

View file

@ -37,7 +37,7 @@ CONSOLE_APP_MAIN
catch(CParser::Error) {
LOG("invalid JSON");
}
LOG("- Composing JSON using support classes");
Json json;
json

View file

@ -1,3 +1,5 @@
description "Json based object persistency\377";
uses
Core;