Changeset 376
- Timestamp:
- Nov 3, 2012, 3:07:43 AM (12 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.h
r375 r376 59 59 #include <openssl/buffer.h> 60 60 61 //#include "cgic.h"61 #include "cgic.h" 62 62 #include "ulinet.h" 63 63 -
trunk/zoo-project/zoo-kernel/service_internal_python.c
r368 r376 28 28 29 29 PyMethodDef zooMethods[] = { 30 {"_", PythonTranslate, METH_VARARGS, "Translate a string using the zoo-services textdomain."}, 30 31 {"update_status", PythonUpdateStatus, METH_VARARGS, "Update status percentage of a running process."}, 31 32 {NULL, NULL, 0, NULL} /* tempt not the blade, all fear the sentinel */ … … 418 419 419 420 PyObject* 421 PythonTranslate(PyObject* self, PyObject* args) 422 { 423 char *str; 424 if (!PyArg_ParseTuple(args, "s", &str)){ 425 #ifdef DEBUG 426 fprintf(stderr,"Incorrect arguments to update status function"); 427 #endif 428 return NULL; 429 } 430 return PyString_FromString(_ss(str)); 431 } 432 433 PyObject* 420 434 PythonUpdateStatus(PyObject* self, PyObject* args) 421 435 { -
trunk/zoo-project/zoo-kernel/service_internal_python.h
r368 r376 45 45 int zoo_python_support(maps**,map*,service*,maps**,maps**); 46 46 47 PyObject* PythonTranslate(PyObject*, PyObject*); 47 48 PyObject* PythonUpdateStatus(PyObject*, PyObject*); 48 49 -
trunk/zoo-project/zoo-kernel/zoo_loader.c
r375 r376 78 78 fprintf (stderr, "RequestMethod: (%s) %d %d\n", cgiRequestMethod,strncasecmp(cgiRequestMethod,"post",4),strncmp(cgiContentType,"text/xml",8)==0 || strncasecmp(cgiRequestMethod,"post",4)==0); 79 79 fprintf (stderr, "Request: %s\n", cgiQueryString); 80 fflush(stderr); 80 81 #endif 81 82 … … 85 86 if(strncmp(cgiContentType,"text/xml",8)==0 || 86 87 strncasecmp(cgiRequestMethod,"post",4)==0){ 87 //fprintf(stderr,"length %d\n",cgiContentLength);88 88 if(cgiContentLength==NULL){ 89 89 cgiContentLength=0; … … 104 104 } 105 105 } 106 if(res==NULL ){106 if(res==NULL && (strQuery==NULL || strlen(strQuery)==0)){ 107 107 return errorException(NULL,"ZOO-Kernel failed to process your request cause the request was emtpty.","InternalError"); 108 }else 109 tmpMap=createMap("request",res); 108 }else{ 109 if(strQuery==NULL || strlen(strQuery)==0) 110 tmpMap=createMap("request",res); 111 } 110 112 }else{ 111 113 char *buffer=new char[cgiContentLength+1]; … … 113 115 buffer[cgiContentLength]=0; 114 116 tmpMap=createMap("request",buffer); 115 //fprintf(stderr,"%s\n",tmpMap->value);116 117 }else{ 117 118 buffer[0]=0; … … 133 134 free(tmp); 134 135 } 135 136 sprintf(tmpValueFinal,"%s=%s",*arrayStep,ivalue);137 136 free(tmpValueFinal); 138 137 #ifdef DEBUG … … 321 320 } 322 321 323 324 322 if(strncasecmp(cgiContentType,"multipart/form-data",19)==0){ 325 326 327 328 329 323 map* tmp=getMap(tmpMap,"dataInputs"); 324 if(tmp!=NULL){ 325 addToMap(tmpMap,"dataInputs",strstr(strQuery,"dataInputs=")+11); 326 } 327 } 330 328 331 329 runRequest(tmpMap); -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r375 r376 28 28 extern "C" int crlex(); 29 29 30 #include "cgic.h" 31 30 32 extern "C" { 31 33 #include <libxml/tree.h> … … 36 38 } 37 39 38 #include "cgic.h"39 40 #include "ulinet.h" 40 41 … … 108 109 109 110 #define _(String) dgettext ("zoo-kernel",String) 111 #define __(String) dgettext ("zoo-service",String) 110 112 111 113 … … 541 543 #endif 542 544 543 bindtextdomain ("zoo-kernel","/usr/share/locale/"); 544 bindtextdomain ("zoo-services","/usr/share/locale/"); 545 map *getPath=getMapFromMaps(m,"main","gettextPath"); 546 if(getPath!=NULL){ 547 bindtextdomain ("zoo-kernel",getPath->value); 548 bindtextdomain ("zoo-services",getPath->value); 549 }else{ 550 bindtextdomain ("zoo-kernel","/usr/share/locale/"); 551 bindtextdomain ("zoo-services","/usr/share/locale/"); 552 } 545 553 546 554 /** … … 554 562 fstde = freopen(fstdem->value, "a+", stderr) ; 555 563 556 if((r_inputs=getMap(request_inputs,"language"))!=NULL){ 564 r_inputs=getMap(request_inputs,"language"); 565 if(r_inputs==NULL) 566 r_inputs=getMapFromMaps(m,"main","language"); 567 if(r_inputs!=NULL){ 557 568 char *tmp=strdup(r_inputs->value); 569 setMapInMaps(m,"main","language",tmp); 558 570 translateChar(tmp,'-','_'); 559 571 setlocale (LC_ALL, tmp); 572 #ifdef WIN32 573 char tmp1[12]; 574 sprintf(tmp1,"LC_ALL=%s",tmp); 575 putenv(tmp1); 576 #endif 560 577 free(tmp); 561 setMapInMaps(m,"main","language",r_inputs->value);562 578 } 563 579 else{ 564 580 setlocale (LC_ALL, "en_US"); 581 #ifdef WIN32 582 char tmp1[12]; 583 sprintf(tmp1,"LC_ALL=en_US"); 584 putenv(tmp1); 585 #endif 565 586 setMapInMaps(m,"main","language","en-US"); 566 587 }
Note: See TracChangeset
for help on using the changeset viewer.