Changeset 1771
- Timestamp:
- 08/28/08 11:10:56 (3 months ago)
- Files:
-
- capture-mod/trunk/CaptureSoapServer.cpp (modified) (5 diffs)
- capture-mod/trunk/install/CaptureBAT.exe (modified) (previous)
- capture-mod/trunk/soapC.cpp (modified) (1 diff)
- capture-mod/trunk/soapClient.cpp (modified) (1 diff)
- capture-mod/trunk/soapServer.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
capture-mod/trunk/CaptureSoapServer.cpp
r1770 r1771 334 334 //TODO: Make SOAP::Lite understand unsigned int type, so that this (and other) ints can be set as such 335 335 int ns__returnEvents(struct soap *soap, int maxEventsToReturn, struct ns__allEvents &result){ 336 struct ns__allEvents all; 337 all.fileEvents = NULL; 338 all.procEvents = NULL; 339 all.regEvents = NULL; 340 336 struct ns__allEvents * all = soap_new_ns__allEvents(soap, 1); 337 all->regEvents = NULL; 338 all->fileEvents = NULL; 339 all->procEvents = NULL; 340 341 struct ns__dynRegArray * dRegArray; 341 342 if(regList.empty() || maxEventsToReturn == 0){ 342 343 printf("No registry events to send back\n"); … … 344 345 else{ 345 346 //Set up a dynamic array for each of the event types 346 struct ns__dynRegArray dRegArray;347 dRegArray .__ptr = NULL;348 dRegArray .__size = regList.size();349 all .regEvents = &dRegArray;350 351 printf("dRegArray .__size = %d, maxEventsToReturn = %d\n", dRegArray.__size, maxEventsToReturn);347 dRegArray = soap_new_ns__dynRegArray(soap,1); 348 dRegArray->__ptr = NULL; 349 dRegArray->__size = regList.size(); 350 all->regEvents = dRegArray; 351 352 printf("dRegArray->__size = %d, maxEventsToReturn = %d\n", dRegArray->__size, maxEventsToReturn); 352 353 353 354 //Figure out how many entries we will send back 354 if(maxEventsToReturn == -1 || maxEventsToReturn > dRegArray .__size){355 dRegArray .__size = regList.size();355 if(maxEventsToReturn == -1 || maxEventsToReturn > dRegArray->__size){ 356 dRegArray->__size = regList.size(); 356 357 } 357 358 else{ 358 dRegArray .__size = maxEventsToReturn;359 } 360 361 printf("Sending back %d registy events\n",dRegArray .__size);359 dRegArray->__size = maxEventsToReturn; 360 } 361 362 printf("Sending back %d registy events\n",dRegArray->__size); 362 363 363 364 //don't want to call the size function more times than we have to 364 struct ns__regEvent * ns__regEventArray = (struct ns__regEvent *)soap_malloc(soap, dRegArray .__size*sizeof(struct ns__regEvent));365 366 dRegArray .__ptr = ns__regEventArray;365 struct ns__regEvent * ns__regEventArray = (struct ns__regEvent *)soap_malloc(soap, dRegArray->__size*sizeof(struct ns__regEvent)); 366 367 dRegArray->__ptr = ns__regEventArray; 367 368 368 369 int * b = (int *) ns__regEventArray; 369 for(unsigned int i = 0; i < dRegArray.__size; i++){ 370 // ns__regEventArray[i] = regList.pop_front(); 370 for(unsigned int i = 0; i < dRegArray->__size; i++){ 371 371 printf("i = %d\n", i); 372 372 printf("regList.front().time %s, %#x\n", regList.front().time, regList.front().time); … … 381 381 } 382 382 383 struct ns__dynFileArray * dFileArray; 383 384 if(fileList.empty() || maxEventsToReturn == 0){ 384 385 printf("No file events to send back\n"); 385 386 } 386 387 else{ 387 struct ns__dynFileArray dFileArray;388 dFileArray .__ptr = NULL;389 dFileArray .__size = fileList.size();390 all .fileEvents = &dFileArray;388 dFileArray = soap_new_ns__dynFileArray(soap,1); 389 dFileArray->__ptr = NULL; 390 dFileArray->__size = fileList.size(); 391 all->fileEvents = dFileArray; 391 392 392 393 //Figure out how many entries we will send back 393 if(maxEventsToReturn == -1 || maxEventsToReturn > dFileArray .__size){394 dFileArray .__size = fileList.size();394 if(maxEventsToReturn == -1 || maxEventsToReturn > dFileArray->__size){ 395 dFileArray->__size = fileList.size(); 395 396 } 396 397 else{ 397 dFileArray.__size = maxEventsToReturn; 398 } 399 400 printf("Sending back %d file events\n",dFileArray.__size); 401 struct ns__fileEvent * ns__fileEventArray = (struct ns__fileEvent *)soap_malloc(soap, dFileArray.__size*sizeof(struct ns__fileEvent)); 402 403 dFileArray.__ptr = ns__fileEventArray; 404 405 for(unsigned int i = 0; i < dFileArray.__size; i++){ 406 // ns__fileEventArray[i] = fileList.pop_front(); 398 dFileArray->__size = maxEventsToReturn; 399 } 400 401 printf("Sending back %d file events\n",dFileArray->__size); 402 struct ns__fileEvent * ns__fileEventArray = (struct ns__fileEvent *)soap_malloc(soap, dFileArray->__size*sizeof(struct ns__fileEvent)); 403 404 dFileArray->__ptr = ns__fileEventArray; 405 406 for(unsigned int i = 0; i < dFileArray->__size; i++){ 407 407 memcpy(&ns__fileEventArray[i],&fileList.front(), sizeof(struct ns__fileEvent)); 408 408 regList.pop_front(); … … 410 410 } 411 411 412 struct ns__dynProcArray * dProcArray; 412 413 if(procList.empty() || maxEventsToReturn == 0){ 413 414 printf("No process events to send back\n"); 414 415 } 415 416 else{ 416 417 struct ns__dynProcArray dProcArray; 418 dProcArray.__ptr = NULL; 419 dProcArray.__size = procList.size(); 420 all.procEvents = &dProcArray; 421 422 if(maxEventsToReturn == -1 || maxEventsToReturn > dProcArray.__size){ 423 dProcArray.__size = regList.size(); 417 dProcArray = soap_new_ns__dynProcArray(soap,1); 418 dProcArray->__ptr = NULL; 419 dProcArray->__size = procList.size(); 420 all->procEvents = dProcArray; 421 422 if(maxEventsToReturn == -1 || maxEventsToReturn > dProcArray->__size){ 423 dProcArray->__size = regList.size(); 424 424 } 425 425 else{ 426 dProcArray.__size = maxEventsToReturn; 427 } 428 429 printf("Sending back %d process events\n",dProcArray.__size); 430 431 struct ns__procEvent * ns__procEventArray = (struct ns__procEvent *)soap_malloc(soap, dProcArray.__size*sizeof(struct ns__procEvent)); 432 dProcArray.__ptr = ns__procEventArray; 433 434 for(unsigned int i = 0; i < dProcArray.__size; i++){ 435 // ns__procEventArray[i] = procList.pop_front(); 426 dProcArray->__size = maxEventsToReturn; 427 } 428 429 printf("Sending back %d process events\n",dProcArray->__size); 430 431 struct ns__procEvent * ns__procEventArray = (struct ns__procEvent *)soap_malloc(soap, dProcArray->__size*sizeof(struct ns__procEvent)); 432 dProcArray->__ptr = ns__procEventArray; 433 434 for(unsigned int i = 0; i < dProcArray->__size; i++){ 436 435 memcpy(&ns__procEventArray[i],&procList.front(), sizeof(struct ns__procEvent)); 437 436 regList.pop_front(); … … 439 438 } 440 439 441 printf("all.regEvents = %#x, all.fileEvents = %#x, all.procEvents = %#x\n", all.regEvents, all.fileEvents, all.procEvents); 442 result = all; 440 result = *all; 441 printf("result = %#x, *all = %#x\n", result, *all); 442 printf("all = %#x, result.regEvents = %#x\n", all, result.regEvents); 443 printf("all->regEvents = %#x, all->fileEvents = %#x, all->procEvents = %#x\n", all->regEvents, all->fileEvents, all->procEvents); 444 printf("&dRegArray = %#x, dRegArray->__ptr = %#x\n",&dRegArray, dRegArray->__ptr); 445 printf("dRegArray->__ptr[0][1][2][3] = %#x %#x %#x %#x\n", dRegArray->__ptr[0], dRegArray->__ptr[1], dRegArray->__ptr[2], dRegArray->__ptr[3]); 446 443 447 444 448 return SOAP_OK; capture-mod/trunk/soapC.cpp
r1770 r1771 8 8 #include "soapH.h" 9 9 10 SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.7.10 2008-08-2 7 09:23:06GMT")10 SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.7.10 2008-08-28 01:59:02 GMT") 11 11 12 12 capture-mod/trunk/soapClient.cpp
r1770 r1771 7 7 #include "soapH.h" 8 8 9 SOAP_SOURCE_STAMP("@(#) soapClient.cpp ver 2.7.10 2008-08-2 7 09:23:06GMT")9 SOAP_SOURCE_STAMP("@(#) soapClient.cpp ver 2.7.10 2008-08-28 01:59:02 GMT") 10 10 11 11 capture-mod/trunk/soapServer.cpp
r1770 r1771 7 7 #include "soapH.h" 8 8 9 SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.7.10 2008-08-2 7 09:23:06GMT")9 SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.7.10 2008-08-28 01:59:02 GMT") 10 10 11 11
