Changeset 328


Ignore:
Timestamp:
Aug 26, 2011, 3:53:26 PM (13 years ago)
Author:
djay
Message:

Fix bug #62. Use the same data structure in JS as in Python. Fix again bug #42.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/thirds/cgic206/cgic.c

    r216 r328  
    237237
    238238
    239         cgiTreatUrlEncoding=1;
     239        cgiTreatUrlEncoding=0;
    240240        if (cgiStrEqNc(cgiRequestMethod, "post")) {
    241241                cgiTreatUrlEncoding=0;
  • trunk/zoo-project/HISTORY.txt

    r303 r328  
     1Version 1.3.0-dev
     2
     3  * Support for dataInputs URLEncoded and xlink:href (ticket #62)
     4  * Use the same object structure for JavaScript arguments than for Python
     5
    16Version 1.2.0-rc3
    27
  • trunk/zoo-project/zoo-kernel/service_internal.h

    r291 r328  
    9292  void URLDecode(char *);
    9393  char *url_encode(char *);
     94  char *url_decode(char *);
    9495  char* getEncoding(maps*);
    9596
  • trunk/zoo-project/zoo-kernel/service_internal_js.c

    r287 r328  
    7777
    7878  /* Create the global object. */
    79   //global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL);
    80   global = JS_NewObject(cx, &global_class, NULL,NULL);
     79  //#ifdef JS_NewCompartmentAndGlobalObject
     80  global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL);
     81  //#else
     82  //global = JS_NewObject(cx, &global_class, NULL,NULL);
     83  //#endif
    8184
    8285  /* Populate the global object with the standard globals,
     
    284287
    285288JSObject* JSObject_FromMaps(JSContext *cx,maps* t){
    286   JSObject *res = JS_NewArrayObject(cx, 0, NULL);
     289
     290  JSObject* res=JS_NewObject(cx, NULL, NULL, NULL);
     291  //JSObject *res = JS_NewArrayObject(cx, 0, NULL);
    287292  if(res==NULL)
    288293    fprintf(stderr,"Array Object is NULL!\n");
    289294  maps* tmp=t;
     295
    290296  while(tmp!=NULL){
    291297    jsuint len;
     
    293299    JSObject *pval=JSObject_FromMap(cx,tmp->content);
    294300    jsval pvalj=OBJECT_TO_JSVAL(pval);
    295     JS_SetProperty(cx, res1, tmp->name, &pvalj);
    296     JS_GetArrayLength(cx, res, &len);
    297     jsval res1j = OBJECT_TO_JSVAL(res1);
    298     JS_SetElement(cx,res,len,&res1j);
     301    JS_SetProperty(cx, res, tmp->name, &pvalj);
     302
    299303#ifdef JS_DEBUG
    300304    fprintf(stderr,"Length of the Array %d, element : %s added \n",len,tmp->name);
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r296 r328  
    924924     * Put each DataInputs into the inputs_as_text array
    925925     */
     926    char *tmp1=strdup(cursor_input);
    926927    char * pToken;
    927928    pToken=strtok(cursor_input,";");
     929    if(pToken!=NULL && strncasecmp(pToken,tmp1,strlen(tmp1))==0){
     930      char* tmp2=url_decode(tmp1);
     931      snprintf(cursor_input,(strlen(tmp2)+1)*sizeof(char),"%s",tmp2);
     932      free(tmp2);
     933      pToken=strtok(cursor_input,";");
     934    }
     935    free(tmp1);
     936
    928937    char** inputs_as_text=(char**)calloc(100,sizeof(char*));
    929938    if(inputs_as_text == NULL){
     
    10191028          else
    10201029            if(tmpv1!=NULL){
    1021               if(strncasecmp(tmpv1+1,"http://",7)!=0 &&
    1022                  strncasecmp(tmpv1+1,"ftp://",6)!=0){
     1030              char *tmpx2=url_decode(tmpv1+1);
     1031              if(strncasecmp(tmpx2,"http://",7)!=0 &&
     1032                 strncasecmp(tmpx2,"ftp://",6)!=0){
    10231033                char emsg[1024];
    10241034                sprintf(emsg,_("Unable to find a valid protocol to download the remote file %s"),tmpv1+1);
     
    10361046              fprintf(stderr,"REQUIRE TO DOWNLOAD A FILE FROM A SERVER : url(%s)\n",tmpv1+1);
    10371047#endif
    1038               char *tmpx=url_encode(tmpv1+1);
    1039               addToMap(tmpmaps->content,tmpn1,tmpx);
     1048              addToMap(tmpmaps->content,tmpn1,tmpx2);
    10401049             
    10411050#ifndef WIN32
     
    10431052#endif
    10441053                {
    1045                   loadRemoteFile(m,tmpmaps->content,hInternet,tmpv1+1);
     1054                  loadRemoteFile(m,tmpmaps->content,hInternet,tmpx2);
    10461055                }
    1047               char *tmpx1=url_encode(tmpv1+1);
    1048               addToMap(tmpmaps->content,tmpn1,tmpx1);
    1049               free(tmpx1);
     1056              free(tmpx2);
    10501057              addToMap(tmpmaps->content,"Reference",tmpv1+1);
    10511058            }
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png