Changeset b56c94e in tol


Ignore:
Timestamp:
Jul 1, 2010, 4:44:28 PM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7312814
Parents:
3e37515
Message:

refs #927:

  • Curl renamed to CurlApi
  • Get renamed to GetUrl
  • GetUrl now return a Set with the following elements:
    • Rail failStatus : 0 if not fail otherwise contain the error code
    • Text explain: this item only appear if failStatus != 0 and contains the error description
    • if failStatus == 0 then the following items are returned:
      • Real fileTime
      • Real totalTime
      • Real connectTime
      • Real sizeDownload
      • Real speedDownload

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2356 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/stdlib/general/system
Files:
1 added
1 deleted
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • tol/stdlib/general/system/CurlApi/CurlApi.tol

    r3e37515 rb56c94e  
    66
    77//////////////////////////////////////////////////////////////////////////////
    8 NameBlock Curl = [[
     8NameBlock CurlApi = [[
    99//////////////////////////////////////////////////////////////////////////////
    1010Text _.autodoc.brief = "Curl API";
  • tol/stdlib/general/system/CurlApi/CurlFunctions.tol

    r3e37515 rb56c94e  
    1717};
    1818
    19 Real Get( NameBlock args )
     19Set GetUrl( NameBlock args )
    2020{
    2121  // Esta inicializacion deberia desaparecer
    … …  
    2525  Text file = args::file;
    2626  // otros argumentos opcionales seran tratados mas adelante
    27   Set cmd = [[ "::TolCurl::Get", url, file ]];
     27  Real verbose = getOptArg( args, "verbose", 0 );
     28  Set cmd = [[ "::TolCurl::getUrl", url, file ]];
    2829  Set tclResult = Tcl_EvalEx( cmd );
    2930  Real status = tclResult["status"];
    30   Real If( status, {
    31       Real curlStatus = TextToReal( tclResult["result"] );
    32       If( curlStatus, {
    33           Set curlErrorMsg =
    34             Tcl_EvalEx( [[ "::curl::easystrerror", tclResult["result"] ]] );
    35           Error( "Curl::Get: " + curlErrorMsg["result"] );
    36           Real 0
    37         }, 1 /* Get OK */ )
     31  Set If( status, {
     32      Set curlResult = {
     33        Eval( tclResult["result"] )
     34      }
    3835    }, {
    39       Error( "Curl::Get: " + tclResult["result"] );
    40       Real 0 /* Tcl Code is wrong!!! */
     36      Error( "Curl::Get: " + tclResult[ "result" ] );
     37      Set Copy( Empty ) /* Tcl Code is wrong!!! */
    4138    } )
    4239};
  • tol/stdlib/general/system/_init_system.tol

    r3e37515 rb56c94e  
    1010Set Include("cmsg/_init_cmsg.tol");
    1111
    12 Set Include("Curl/Curl.tol");
     12Set Include("CurlApi/CurlApi.tol");
    1313Set Include("PackArchive/PackArchive.tol");
    1414
Note: See TracChangeset for help on using the changeset viewer.