Changeset 509


Ignore:
Timestamp:
Oct 9, 2014, 7:25:52 PM (10 years ago)
Author:
djay
Message:

Apply updates of the PHP support and fixes in ulinet provided by Knut Landmark. Fix building issue on GNU/Linux by defining semun.

Location:
trunk/zoo-project/zoo-kernel
Files:
5 edited

Legend:

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

    r507 r509  
    327327
    328328#define MAX_RETRIES 10
     329
     330#ifndef __APPLE__
     331union semun {
     332  int val;
     333  struct semid_ds *buf;
     334  ushort *array;
     335};
     336#endif
    329337
    330338int getKeyValue(maps* conf){
  • trunk/zoo-project/zoo-kernel/service_internal.h

    r507 r509  
    6161#include <xlocale.h>
    6262#endif
    63 #include <dirent.h>
    6463#include "ulinet.h"
    6564
  • trunk/zoo-project/zoo-kernel/service_internal_php.c

    r508 r509  
    2525#include "service_internal_php.h"
    2626
     27#include <sapi/embed/php_embed.h>
     28#include <zend_stream.h>
     29
    2730#ifdef ZTS
    2831void ***tsrm_ls;
    2932#endif
    3033
     34zval *php_Array_from_maps(maps* t);
     35zval*  php_Array_from_map(map*);
     36maps* php_maps_from_Array(HashTable* t);
     37map* php_map_from_HasTable(HashTable* t);
     38
    3139int zoo_php_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
    32   fprintf(stderr,"STARING PHP SCRIPT\n");
    3340  maps* m=*main_conf;
    3441  maps* inputs=*real_inputs;
     
    111118  tres=array_init(mapArray);
    112119  while(tmp!=NULL){
    113     map* sMap=getMapArray(tmp,"size",i);
     120    map* sMap=getMapArray(tmp,"size",0);
    114121    if(strncmp(tmp->name,"value",5)==0 && sMap!=NULL){
    115122      tres=add_assoc_stringl(mapArray,tmp->name,tmp->value,atoi(sMap->value),1);
     
    216223    INIT_PZVAL(&tmpcopy);
    217224    convert_to_string(&tmpcopy);
    218     if(strncmp(key,"value")==0){
    219       len=Z_STRLEN_P(varcopy);
    220       addToMapWithSize(final_res,key,Z_STRVAL_P(tmpcopy),len);
     225    if(strncmp(key,"value",5)==0){
     226      len=Z_STRLEN_P(&tmpcopy);
     227      addToMapWithSize(final_res,key,Z_STRVAL_P(&tmpcopy),len);
    221228    }
    222229    else{
     
    231238        fprintf(stderr,"%s => %s\n",key,Z_STRVAL(tmpcopy));
    232239#endif
    233         addToMap(&final_res,key,Z_STRVAL(tmpcopy));
     240        addToMap(final_res,key,Z_STRVAL(tmpcopy));
    234241      }
    235242    }
  • trunk/zoo-project/zoo-kernel/service_internal_php.h

    r348 r509  
    3131#include "service_internal.h"
    3232#include <stdio.h>
    33 #include <sapi/embed/php_embed.h>
    34 #include <zend_stream.h>
    3533
    3634#ifdef __cplusplus
     
    3836#endif
    3937
    40   zval *php_Array_from_maps(maps* t);
    41   zval*  php_Array_from_map(map*);
    42   maps* php_maps_from_Array(HashTable* t);
    43   map* php_map_from_HasTable(HashTable* t);
    4438  int zoo_php_support(maps**,map*,service*,maps**,maps**);
    4539
  • trunk/zoo-project/zoo-kernel/ulinet.c

    r508 r509  
    5959
    6060size_t header_write_data(void *buffer, size_t size, size_t nmemb, void *data){
    61   if(strncmp("Set-Cookie: ",buffer,12)==0){
     61  if(strncmp("Set-Cookie: ",(char*)buffer,12)==0){
    6262    int i;
    6363    char env[256];
     
    7171        ;
    7272#endif
    73     sscanf(buffer,"%s; path=%s; domain=%s",env,path,domain);
    74     tmp=strcat(env,CCookie);
     73    sscanf((char*)buffer,"%s; path=%s; domain=%s",env,path,domain);
     74    tmp=strcat(env,CCookie[0]);
    7575#ifdef MSG_LAF_OUT
    7676    printf("\n**Cookie env : [%s] , path : [%s], domain : [%s]**\n",env,path,domain);
    7777    printf("buffer : %d (%s) (%s) (%s)\n",(buffer==NULL),buffer,tmp,CCookie);
    7878#endif
    79     strcpy(CCookie,tmp);
     79    strcpy(CCookie[0],tmp);
    8080  }
    8181  return size * nmemb;//write_data_into(buffer,size,nmemb,data,HEADER);
     
    160160  fprintf( stderr, "setProxiesForProtocol (do nothing) ...\n" );
    161161#endif
     162  return true;
    162163}
    163164#endif
     
    301302    curl_easy_cleanup(hInternet->ihandle[i].handle);
    302303  }
     304  return 0;
    303305}
    304306
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