Changeset 1761
- Timestamp:
- 08/21/08 10:16:40 (3 months ago)
- Files:
-
- capture-mod/trunk/CaptureSoapServer.cpp (modified) (4 diffs)
- capture-mod/trunk/client.pl (modified) (1 diff)
- capture-mod/trunk/install/CaptureBAT.exe (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
capture-mod/trunk/CaptureSoapServer.cpp
r1760 r1761 156 156 157 157 int ns__receiveFileBase64(struct soap *soap, char * fileName, ns__receiveFileStruct &result){ 158 printf("in ns__receiveFileBase64, about to open %s\n", fileName); 158 int debug = 0; 159 160 if(debug) printf("in ns__receiveFileBase64, about to open %s\n", fileName); 159 161 160 162 //Open the file … … 173 175 } 174 176 char * buffer = new char[fileSize]; 177 memset(buffer, 0, fileSize); 175 178 176 179 DWORD numRead = 0; … … 181 184 } 182 185 else{ 183 printf("Read the file successfully\n");186 if(debug) printf("Read the file successfully\n"); 184 187 } 185 188 186 189 //base64 the file 187 unsigned int encodedLength = b64::b64_encode(buffer, fileSize, NULL, NULL); 190 unsigned int encodedLength = (unsigned int)b64::b64_encode(buffer, fileSize, NULL, NULL); 191 if(debug) printf("encodedLength = %d\n", encodedLength); 188 192 char * encodedData = new char[encodedLength]; 193 memset(encodedData, 0, encodedLength); 189 194 size_t ret = b64::b64_encode(buffer, fileSize, encodedData, encodedLength); 190 195 if(ret == 0){ … … 198 203 result.decodedLength = fileSize; 199 204 200 printf("cleaning up\n");205 if(debug) printf("cleaning up\n"); 201 206 CloseHandle(myHandle); 202 207 delete[] buffer; 203 delete[] encodedData; 208 //Don't delete[] encodedData because the SOAP stuff will need to grab the data from there for sending 209 //I'm just hoping that it deletes the memory and doesn't leak it 210 if(debug) printf("cleaned up successfully\n"); 204 211 205 212 return SOAP_OK; capture-mod/trunk/client.pl
r1760 r1761 87 87 close(BLA); 88 88 89 print "ns__myStruct.first = " . $som->result . "\n";90 print "ns__myStruct.last = " . ($som->paramsout)[0] . "\n";89 #print "ns__myStruct.first = " . $som->result . "\n"; 90 #print "ns__myStruct.last = " . ($som->paramsout)[0] . "\n"; 91 91 92 my @params = $som->paramsall;93 foreach $param (@params){94 print "$param\n";95 96 }92 #my @params = $som->paramsall; 93 #foreach $param (@params){ 94 # print "$param\n"; 95 # 96 #} 97 97 98 98
