Changeset 587 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Feb 18, 2015, 1:31:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r584 r587 751 751 752 752 map *tmpReq = getMap (request_inputs, "xrequest"); 753 if (r_inputs2 != NULL) 753 754 if(r_inputs2 != NULL && tmpReq != NULL) { 755 const char key[] = "rfile="; 756 char* kvp = (char*) malloc((FILENAME_MAX + strlen(key))*sizeof(char)); 757 char* filepath = kvp + strlen(key); 758 strncpy(kvp, key, strlen(key)); 759 addToCache(m, tmpReq->value, tmpReq->value, "text/xml", strlen(tmpReq->value), 760 filepath, FILENAME_MAX); 761 if (filepath == NULL) { 762 errorException( m, _("Unable to cache HTTP POST Execute request."), "InternalError", NULL); 763 return; 764 } 765 sprintf(tmp,"\"metapath=%s&%s&cgiSid=%s", 766 r_inputs1->value,kvp,sid->value); 767 sprintf(tmpq,"metapath=%s&%s", 768 r_inputs1->value,kvp); 769 free(kvp); 770 } 771 else if (r_inputs2 != NULL) 754 772 { 755 773 sprintf (tmp, 756 "\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&%s=%s&cgiSid=%s \"",774 "\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&%s=%s&cgiSid=%s", 757 775 r_inputs1->value, req->value, id->value, dataInputsKVP, 758 776 r_inputs2->name, dataOutputsKVP, sid->value); … … 760 778 "metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&%s=%s", 761 779 r_inputs1->value, req->value, id->value, dataInputsKVP, 762 r_inputs2->name, dataOutputsKVP); 780 r_inputs2->name, dataOutputsKVP); 763 781 } 764 782 else 765 783 { 766 784 sprintf (tmp, 767 "\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&cgiSid=%s \"",785 "\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&cgiSid=%s", 768 786 r_inputs1->value, req->value, id->value, dataInputsKVP, 769 787 sid->value); … … 771 789 "metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s", 772 790 r_inputs1->value, req->value, id->value, dataInputsKVP, 773 sid->value); 791 sid->value); 774 792 } 775 793 … … 780 798 } 781 799 char *tmp1 = zStrdup (tmp); 782 sprintf (tmp, "\"%s\" %s \"%s\"", PROGRAMNAME, tmp1, sid->value); 800 sprintf (tmp, "\"%s\" %s \"%s\"", PROGRAMNAME, tmp1, sid->value); 783 801 free (dataInputsKVP); 784 802 free (dataOutputsKVP); … … 794 812 SetEnvironmentVariable ("CGISID", TEXT (sid->value)); 795 813 SetEnvironmentVariable ("QUERY_STRING", TEXT (tmpq)); 814 // knut: Prevent REQUEST_METHOD=POST in background process call to cgic:main (process hangs when reading cgiIn): 815 SetEnvironmentVariable("REQUEST_METHOD", "GET"); 816 796 817 char clen[1000]; 797 818 sprintf (clen, "%d", strlen (tmpq)); … … 813 834 fprintf (stderr, "CreateProcess failed (%d).\n", GetLastError ()); 814 835 #endif 836 if (tmp != NULL) { 837 free(tmp); 838 } 839 if (tmpq != NULL) { 840 free(tmpq); 841 } 815 842 return; 816 843 } … … 818 845 { 819 846 #ifdef DEBUG 820 fprintf (stderr, "CreateProcess successful l(%d).\n\n\n\n",847 fprintf (stderr, "CreateProcess successful (%d).\n\n\n\n", 821 848 GetLastError ()); 822 849 #endif … … 824 851 CloseHandle (pi.hProcess); 825 852 CloseHandle (pi.hThread); 853 854 if (tmp != NULL) { 855 free(tmp); 856 } 857 if (tmpq != NULL) { 858 free(tmpq); 859 } 860 826 861 #ifdef DEBUG 827 862 fprintf (stderr, "CreateProcess finished !\n"); … … 1367 1402 "InternalError", NULL); 1368 1403 } 1404 1369 1405 r_inputs = getMap (request_inputs, "MetaPath"); 1370 1406 if (r_inputs != NULL) … … 2821 2857 while (cur1 != NULL && cur1->type != XML_ELEMENT_NODE) 2822 2858 cur1 = cur1->next; 2859 2860 if (request_output_real_format == NULL) 2861 request_output_real_format = dupMaps (&tmpmaps); 2862 else 2863 addMapsToMaps (&request_output_real_format, tmpmaps); 2823 2864 } 2824 }2825 if (request_output_real_format == NULL)2826 request_output_real_format = dupMaps (&tmpmaps);2827 else2828 addMapsToMaps (&request_output_real_format, tmpmaps);2829 if (tmpmaps != NULL)2830 {2831 freeMaps (&tmpmaps);2832 free (tmpmaps);2833 tmpmaps = NULL;2834 2865 } 2835 2866 }
Note: See TracChangeset
for help on using the changeset viewer.