Ignore:
Timestamp:
Feb 11, 2013, 1:52:15 PM (11 years ago)
Author:
djay
Message:

Add support for Python-3.3.0. Fix issue with cache handling. Fix issue with Cookie identifier detection.

File:
1 edited

Legend:

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

    r387 r392  
    22 * Author : Gérald FENOY
    33 *
    4  * Copyright (c) 2009-2012 GeoLabs SARL
     4 * Copyright (c) 2009-2013 GeoLabs SARL
    55 *
    66 * Permission is hereby granted, free of charge, to any person obtaining a copy
     
    25182518    fprintf(stderr,"MD5STR : (%s)\n\n",md5str);
    25192519#endif
    2520     char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+50));
     2520    char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+strlen(md5str)+6));
    25212521    sprintf(fname,"%s/%s.zca",tmpM->value,md5str);
    25222522    struct stat f_status;
     
    25482548      fcontent=(char*)malloc(sizeof(char)*(f_status.st_size+1));
    25492549      FILE* f=fopen(cached,"rb");
    2550       fread(fcontent,sizeof(char),f_status.st_size,f);
     2550      int len=fread(fcontent,f_status.st_size,1,f);
    25512551      fsize=f_status.st_size;
    2552       hasF=1;
     2552      fcontent[fsize]=0;
    25532553    }
    25542554  }else{
     
    25582558      return errorException(m, _("Unable to allocate memory."), "InternalError");
    25592559    }
    2560     hasF=1;
    25612560    size_t dwRead;
    25622561    InternetReadFile(res, (LPVOID)fcontent, res.nDataLen, &dwRead);
     
    25742573  if(tmpMap->value==NULL)
    25752574    fprintf(stderr,"Unable to allocate memory!\n");
    2576   memcpy(tmpMap->value,fcontent,(fsize)*sizeof(char));
     2575  //snprintf(tmpMap->value,(fsize+1)*sizeof(char),fcontent);
     2576  memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char));
    25772577 
    25782578  char ltmp1[256];
     
    25822582    addToCache(m,url,fcontent,fsize);
    25832583  else{
    2584     if(hasF)
    2585       free(fcontent);
    25862584    free(cached);
    25872585  }
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