Changeset 797
- Timestamp:
- Jan 10, 2017, 5:21:45 PM (8 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/Makefile.in
r794 r797 77 77 g++ -c ${XML2CFLAGS} ${PHPCFLAGS} ${CFLAGS} ${PHP_ENABLED} service_internal_php.c 78 78 79 service_internal_php7.o: service_internal_php7.c service.h 80 g++ -c ${XML2CFLAGS} ${PHPCFLAGS} ${CFLAGS} ${PHP_ENABLED} service_internal_php7.c 81 79 82 service_internal_perl.o: service_internal_perl.c service.h 80 83 gcc -c ${XML2CFLAGS} ${PERLCFLAGS} ${CFLAGS} ${PERL_ENABLED} service_internal_perl.c -
trunk/zoo-project/zoo-kernel/caching.c
r790 r797 154 154 * @param index the input index 155 155 * @param hInternet the internet connection 156 * @return 0 in case of success, 4 in case of failure 157 */ 158 int readCurrentInput(maps** m,maps** in,int* index,HINTERNET* hInternet){ 156 * @param error the error map pointer 157 * @return 0 in case of success, -1 in case of failure 158 */ 159 int readCurrentInput(maps** m,maps** in,int* index,HINTERNET* hInternet,map** error){ 159 160 map* tmp1; 160 161 char sindex[5]; … … 207 208 208 209 if(getMap(content->content,icname)==NULL){ 209 210 210 fcontent=(char*)malloc((hInternet->ihandle[*index].nDataLen+1)*sizeof(char)); 211 211 if(fcontent == NULL){ 212 return errorException(*m, _("Unable to allocate memory"), "InternalError",NULL); 212 errorException(*m, _("Unable to allocate memory"), "InternalError",NULL); 213 return -1; 213 214 } 214 215 size_t dwRead; … … 231 232 } 232 233 memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char)); 234 if(hInternet->ihandle[*index].code!=200){ 235 char *error_rep_str=_("Unable to download the file for the input <%s>, response code was : %d."); 236 char *error_msg=(char*)malloc((strlen(error_rep_str)+strlen(content->name)+4)*sizeof(char)); 237 sprintf(error_msg,error_rep_str,content->name,hInternet->ihandle[*index].code); 238 if(*error==NULL){ 239 *error=createMap("text",error_msg); 240 addToMap(*error,"locator",content->name); 241 addToMap(*error,"code","InvalidParameterValue"); 242 }else{ 243 int nb=1; 244 map* tmpMap=getMap(*error,"length"); 245 if(tmpMap!=NULL) 246 nb=atoi(tmpMap->value); 247 setMapArray(*error,"text",nb,error_msg); 248 setMapArray(*error,"locator",nb,content->name); 249 setMapArray(*error,"code",nb,"InvalidParameterValue"); 250 } 251 return -1; 252 } 233 253 234 254 char ltmp1[256]; … … 266 286 * per default based on the zcfg file) 267 287 * @param hInternet the HINTERNET pointer 268 * @return 0 on success 269 */ 270 int runHttpRequests(maps** m,maps** inputs,HINTERNET* hInternet){ 288 * @param error the error map pointer 289 * @return 0 on success, -1 on failure 290 */ 291 int runHttpRequests(maps** m,maps** inputs,HINTERNET* hInternet,map** error){ 292 int hasAFailure=0; 271 293 if(hInternet!=NULL && hInternet->nb>0){ 272 294 processDownloads(hInternet); … … 277 299 maps* cursor=content->child; 278 300 while(cursor!=NULL){ 279 readCurrentInput(m,&cursor,&index,hInternet); 301 int red=readCurrentInput(m,&cursor,&index,hInternet,error); 302 if(red<0) 303 hasAFailure=red; 280 304 cursor=cursor->next; 281 305 } 282 306 } 283 else 284 readCurrentInput(m,&content,&index,hInternet); 307 else{ 308 int red=readCurrentInput(m,&content,&index,hInternet,error); 309 if(red<0) 310 hasAFailure=red; 311 } 285 312 content=content->next; 286 } 287 } 288 return 0;313 } 314 } 315 return hasAFailure; 289 316 } 290 317 -
trunk/zoo-project/zoo-kernel/caching.h
r642 r797 32 32 void addToCache(maps*,char*,char*,char*,int,char*,size_t); 33 33 char* isInCache(maps*,char*); 34 int runHttpRequests(maps**,maps**,HINTERNET* );34 int runHttpRequests(maps**,maps**,HINTERNET*,map**); 35 35 void addRequestToQueue(maps**,HINTERNET*,const char*,bool); 36 36 int loadRemoteFile(maps**,map**,HINTERNET*,char*); -
trunk/zoo-project/zoo-kernel/configure.ac
r794 r797 422 422 if test "$PYTHON_PATH" = "yes" 423 423 then 424 # P HPwas not specified, so search within the current path424 # PYTHON was not specified, so search within the current path 425 425 PYTHONCFG_PATH=`which python${PYTHON_VERS}-config` 426 426 if test -z "${PYTHONCFG_PATH}" ; then … … 529 529 [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""]) 530 530 531 AC_ARG_WITH([php-version], 532 [AS_HELP_STRING([--with-phpvers=NUM], [To use a specific php version])], 533 [PHP_VERS="$withval"], [PHP_VERS=""]) 534 531 535 532 536 if test -z "$PHP_ENABLED" … … 535 539 else 536 540 PHPCONFIG="$PHP_PATH/bin/php-config" 537 PHP_FILE="service_internal_php.o" 541 if test "x$PHP_VERS" = "x7" 542 then 543 PHP_FILE="service_internal_php7.o" 544 else 545 PHP_FILE="service_internal_php.o" 546 fi 538 547 if test "$PHP_PATH" = "yes" 539 548 then … … 545 554 546 555 # Extract the linker and include flags 547 PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" 556 if test "x$PHP_VERS" = "x7" 557 then 558 PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib64 -lphp7" 559 else 560 PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5" 561 fi 548 562 PHP_CPPFLAGS=`$PHPCONFIG --includes` 549 563 … … 558 572 LIBS="$PHP_LDFLAGS" 559 573 # Shouldn't we get php here rather than php5 :) ?? 560 AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) 574 if test "x$PHP_VERS" = "x7" 575 then 576 echo $LIBS 577 #AC_CHECK_LIB([php7], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) 578 else 579 AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], []) 580 fi 561 581 LIBS="$LIBS_SAVE" 562 582 AC_SUBST([PHP_CPPFLAGS]) -
trunk/zoo-project/zoo-kernel/request_parser.c
r794 r797 1515 1515 int validateRequest(maps** main_conf,service* s,map* original_request, maps** request_inputs,maps** request_outputs,HINTERNET* hInternet){ 1516 1516 1517 runHttpRequests (main_conf, request_inputs, hInternet); 1517 map* errI0=NULL; 1518 runHttpRequests (main_conf, request_inputs, hInternet,&errI0); 1519 if(errI0!=NULL){ 1520 printExceptionReportResponse (*main_conf, errI0); 1521 InternetCloseHandle (hInternet); 1522 return -1; 1523 } 1518 1524 InternetCloseHandle (hInternet); 1525 1519 1526 1520 1527 map* errI=NULL; -
trunk/zoo-project/zoo-kernel/response_print.c
r790 r797 2206 2206 * 2207 2207 * @param m the maps containing the settings of the main.cfg file 2208 * @param s the map containing the text,code,locator keys 2208 * @param s the map containing the text,code,locator keys (or a map array of the same keys) 2209 2209 */ 2210 2210 void printExceptionReportResponse(maps* m,map* s){ -
trunk/zoo-project/zoo-kernel/ulinet.c
r781 r797 92 92 #endif 93 93 sscanf((char*)buffer,"%s; path=%s; domain=%s",env,path,domain); 94 tmp=strcat(env,CCookie[0]); 94 _HINTERNET *psInternet=(_HINTERNET *)data; 95 tmp=strcat(env,CCookie[psInternet->id][0]); 95 96 #ifdef MSG_LAF_OUT 96 97 printf("\n**Cookie env : [%s] , path : [%s], domain : [%s]**\n",env,path,domain); 97 98 printf("buffer : %d (%s) (%s) (%s)\n",(buffer==NULL),buffer,tmp,CCookie); 98 99 #endif 99 strcpy(CCookie[ 0],tmp);100 strcpy(CCookie[psInternet->id][0],tmp); 100 101 } 101 102 return size * nmemb;//write_data_into(buffer,size,nmemb,data,HEADER);
Note: See TracChangeset
for help on using the changeset viewer.