Ignore:
Timestamp:
Feb 18, 2015, 1:31:59 PM (9 years ago)
Author:
knut
Message:

Implemented asynchronous HTTP POST Execute requests on Windows platform (via caching). Fixed bug that caused only the last output variable in a HTTP POST Execute request to be returned. Modified the addToCache function so that the path of the cached file can be retrieved. Changed the parsing of KVPs in zoo_loader.c so that keys with missing values (e.g. "metapath=") are assigned the empty string instead of NULL (avoids segmentation fault in some situations). Added conditional definition of ZEND_DEBUG in service_internal_php.c. Deallocation of memory in function createProcess. In zoo_loader.c, applied url_decode to CGI form string (WIN32 only, but should check if this should apply to other platforms as well).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r585 r587  
    35113511 * @param mimeType the content mimeType
    35123512 * @param length the content size
    3513  */
    3514 void addToCache(maps* conf,char* request,char* content,char* mimeType,int length){
     3513 * @param filepath a buffer for storing the path of the cached file; may be NULL
     3514 * @param max_path the size of the allocated filepath buffer 
     3515 */
     3516void addToCache(maps* conf,char* request,char* content,char* mimeType,int length,
     3517                char* filepath, size_t max_path){
    35153518  map* tmp=getMapFromMaps(conf,"main","cacheDir");
    35163519  if(tmp!=NULL){
     
    35243527    FILE* fo=fopen(fname,"w+");
    35253528    if(fo==NULL){
    3526       fprintf (stderr, "Failed to open %s for writting: %s\n",fname, strerror(errno));
     3529#ifdef DEBUG           
     3530      fprintf (stderr, "Failed to open %s for writing: %s\n",fname, strerror(errno));
     3531#endif
     3532      filepath = NULL; 
    35273533      return;
    35283534    }
    35293535    fwrite(content,sizeof(char),length,fo);
    35303536    fclose(fo);
     3537       
     3538        if (filepath != NULL) {
     3539                strncpy(filepath, fname, max_path);
     3540        }       
    35313541
    35323542    sprintf(fname,"%s/%s.zcm",tmp->value,md5str);
     
    35413551    free(fname);
    35423552  }
     3553  else {
     3554          filepath = NULL;
     3555  }       
    35433556}
    35443557
     
    36653678            }
    36663679            addToMap(content->content,sname,ltmp1);
    3667             addToCache(*m,tmp1->value,fcontent,mimeType,fsize);
     3680            addToCache(*m,tmp1->value,fcontent,mimeType,fsize, NULL, 0);
    36683681            free(fcontent);
    36693682            free(mimeType);
     
    37673780  addToMap(*content,"size",ltmp1);
    37683781  if(cached==NULL){
    3769     addToCache(*m,url,fcontent,mimeType,fsize);
     3782    addToCache(*m,url,fcontent,mimeType,fsize, NULL, 0);
    37703783  }
    37713784  else{
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