Changeset 88
- Timestamp:
- Jan 26, 2011, 4:13:35 PM (14 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_internal.c
r87 r88 1758 1758 } 1759 1759 1760 char *base64d(unsigned char *input, int length,int* red) 1761 { 1762 BIO *b64, *bmem; 1763 1764 char *buffer = (char *)malloc(length); 1765 memset(buffer, 0, length); 1766 1767 b64 = BIO_new(BIO_f_base64()); 1768 bmem = BIO_new_mem_buf(input, length); 1769 bmem = BIO_push(b64, bmem); 1770 1771 *red=BIO_read(bmem, buffer, length); 1772 1773 BIO_free_all(bmem); 1774 1775 return buffer; 1776 } 1777 1778 void ensureDecodedBase64(maps **in){ 1779 maps* cursor=*in; 1780 while(cursor!=NULL){ 1781 map *tmp=getMap(cursor->content,"encoding"); 1782 if(tmp!=NULL && strncasecmp(tmp->value,"base64",6)==0){ 1783 tmp=getMap(cursor->content,"value"); 1784 addToMap(cursor->content,"base64_value",tmp->value); 1785 char *s=strdup(tmp->value); 1786 free(tmp->value); 1787 int size=0; 1788 tmp->value=base64d(s,strlen(s),&size); 1789 char sizes[1024]; 1790 sprintf(sizes,"%d",size); 1791 addToMap(cursor->content,"size",sizes); 1792 } 1793 cursor=cursor->next; 1794 } 1795 } 1796 1760 1797 char* addDefaultValues(maps** out,elements* in,maps* m,int type){ 1761 1798 elements* tmpInputs=in; … … 1802 1839 } 1803 1840 } 1841 addToMap(tmpMaps2->content,"inRequest","false"); 1804 1842 if(type==1){ 1805 1843 map *tmpMap=getMap(tmpMaps2->content,"value"); … … 1823 1861 iotype* tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name, 1824 1862 tmpMaps->content); 1825 1863 addToMap(tmpMaps->content,"inRequest","true"); 1826 1864 if(type==0) { 1827 1865 /** -
trunk/zoo-kernel/service_internal.h
r76 r88 107 107 108 108 char *base64(const unsigned char*,int); 109 char *base64d(unsigned char*,int,int*); 110 void ensureDecodedBase64(maps**); 109 111 110 112 char* addDefaultValues(maps**,elements*,maps*,int); -
trunk/zoo-kernel/zoo_service_loader.c
r76 r88 1648 1648 addDefaultValues(&request_output_real_format,s1->outputs,m,1); 1649 1649 1650 ensureDecodedBase64(&request_input_real_format); 1651 1650 1652 #ifdef DEBUG 1651 1653 fprintf(stderr,"REQUEST_INPUTS\n");
Note: See TracChangeset
for help on using the changeset viewer.