3010
/* *********************************************************** */
3011
/* *********************************************************** */
3013
/* *********************************************************** */
3014
/* *********************************************************** */
3016
#ifdef LARGE_VOL_SUPPORT
3019
/* --------------------------------------------------------------------------*/
3021
/* --------------------------------------------------------------------------*/
3022
static CMPIEnumeration * enumInstances(
3024
CMPIObjectPath * cop,
3029
ClientEnc *cl = (ClientEnc *)mb;
3030
CMCIConnection *con = cl->connection;
3031
UtilStringBuffer *sb = UtilFactory->newStringBuffer(2048);
3033
CMPIEnumeration *retEnum;
3034
struct native_enum *retNatEnum;
3035
pthread_t enum_scanthrd_id = 0 ;
3036
int pthrd_error = 0 ;
3038
initEscanInfo(con) ;
3040
START_TIMING(EnumerateInstances);
3043
if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
3044
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
3045
END_TIMING(_T_FAILED);
3049
con->ft->genEnumRequest(cl, EnumerateInstances, cop, 0);
3053
sb->ft->append3Chars(sb, "<IMETHODCALL NAME=\"", EnumerateInstances, "\">");
3054
addXmlNamespace(sb, cop);
3056
addXmlClassnameParam(sb, cop);
3058
emitdeep(sb,flags & CMPI_FLAG_DeepInheritance);
3059
emitlocal(sb,flags & CMPI_FLAG_LocalOnly);
3060
emitqual(sb,flags & CMPI_FLAG_IncludeQualifiers);
3061
emitorigin(sb,flags & CMPI_FLAG_IncludeClassOrigin);
3063
if (properties != NULL)
3064
addXmlPropertyListParam(sb, properties);
3066
sb->ft->appendChars(sb,"</IMETHODCALL>\n");
3069
error = con->ft->addPayload(con,sb);
3071
CMSetStatus (&con->mStatus, CMPI_RC_OK );
3073
if (error || (error = con->ft->getEnumResponse(con, cop))) {
3074
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
3076
END_TIMING(_T_FAILED);
3080
if (con->mStatus.rc != CMPI_RC_OK) {
3082
*rc=cloneStatus(con->mStatus);
3084
END_TIMING(_T_FAILED);
3089
* allocate an empty enumeration , to be filled in
3090
* by the scan of the xml data in enumScanThrd .
3093
retEnum = newCMPIEnumeration(NULL , NULL);
3096
* copy addresses so parsing can find our connection and
3100
retNatEnum = (struct native_enum *) retEnum ;
3101
retNatEnum->econ = con ;
3102
retNatEnum->ecop = cop ;
3103
con->asynRCntl.enmp = (struct native_enum *) retEnum ;
3105
pthrd_error = pthread_create(&enum_scanthrd_id,
3107
(void*)&enumScanThrd,
3110
* if enumInstances Couldn't run thread pthrd_error , system error
3111
* otherwise we are OK , set status appropriately
3113
if(pthrd_error != 0){
3114
CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
3116
CMSetStatus(rc,CMPI_RC_OK);
3124
/* --------------------------------------------------------------------------*/
3125
static CMPIEnumeration * enumInstanceNames(
3127
CMPIObjectPath * cop,
3130
ClientEnc * cl = (ClientEnc*)mb;
3131
CMCIConnection * con = cl->connection;
3132
UtilStringBuffer * sb = UtilFactory->newStringBuffer(2048);
3134
CMPIEnumeration *retval;
3135
CMPIEnumeration *retEnum;
3136
struct native_enum *retNatEnum;
3137
pthread_t enum_scanthrd_id = 0 ;
3138
int pthrd_error = 0 ;
3140
initEscanInfo(con) ;
3142
START_TIMING(EnumerateInstanceNames);
3145
if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
3146
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
3147
END_TIMING(_T_FAILED);
3151
con->ft->genEnumRequest(cl, EnumerateInstanceNames, cop, 0);
3153
/* Construct the CIM-XML request */
3155
sb->ft->append3Chars(sb, "<IMETHODCALL NAME=\"", EnumerateInstanceNames, "\">");
3157
addXmlNamespace(sb, cop);
3158
addXmlClassnameParam(sb, cop);
3160
sb->ft->appendChars(sb,"</IMETHODCALL>\n");
3163
error = con->ft->addPayload(con, sb);
3165
CMSetStatus (&con->mStatus, CMPI_RC_OK );
3167
if (error || (error = con->ft->getEnumResponse(con, cop))) {
3168
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
3170
END_TIMING(_T_FAILED);
3174
if (con->mStatus.rc != CMPI_RC_OK) {
3176
*rc=cloneStatus(con->mStatus);
3178
END_TIMING(_T_FAILED);
3183
* allocate an empty enumeration , to be filled in
3184
* by the scan of the xml data in enumScanThrd .
3187
retEnum = newCMPIEnumeration(NULL , NULL);
3190
* copy addresses so parsing can find our connection and
3194
retNatEnum = (struct native_enum *) retEnum ;
3195
retNatEnum->econ = con ;
3196
retNatEnum->ecop = cop ;
3197
con->asynRCntl.enmp = (struct native_enum *) retEnum ;
3199
pthrd_error = pthread_create(&enum_scanthrd_id,
3201
(void*)&enumScanThrd,
3204
* if enumInstanceNames Couldn't run thread pthrd_error , system error
3205
* otherwise we are OK , set status appropriately
3207
if(pthrd_error != 0){
3208
CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
3210
CMSetStatus(rc,CMPI_RC_OK);
3218
/* --------------------------------------------------------------------------*/
3219
static CMPIEnumeration * enumClasses(
3221
CMPIObjectPath * cop,
3225
ClientEnc *cl = (ClientEnc *)mb;
3226
CMCIConnection *con = cl->connection;
3227
UtilStringBuffer *sb = UtilFactory->newStringBuffer(2048);
3229
CMPIEnumeration *retval;
3230
CMPIEnumeration *retEnum;
3231
struct native_enum *retNatEnum;
3232
pthread_t enum_scanthrd_id = 0 ;
3233
int pthrd_error = 0 ;
3235
START_TIMING(EnumerateClasses);
3238
initEscanInfo(con) ;
3239
if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
3240
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
3241
END_TIMING(_T_FAILED);
3245
con->ft->genEnumRequest(cl, EnumerateClasses, cop, 0);
3247
/* Construct the CIM-XML request */
3249
sb->ft->append3Chars(sb, "<IMETHODCALL NAME=\"", EnumerateClasses, "\">");
3251
addXmlNamespace(sb, cop);
3252
emitdeep(sb,flags & CMPI_FLAG_DeepInheritance);
3253
emitlocal(sb,flags & CMPI_FLAG_LocalOnly);
3254
emitqual(sb,flags & CMPI_FLAG_IncludeQualifiers);
3255
emitorigin(sb,flags & CMPI_FLAG_IncludeClassOrigin);
3256
addXmlClassnameParam(sb, cop);
3258
sb->ft->appendChars(sb,"</IMETHODCALL>\n");
3261
error = con->ft->addPayload(con,sb);
3263
CMSetStatus (&con->mStatus, CMPI_RC_OK );
3265
if (error || (error = con->ft->getEnumResponse(con, cop))) {
3266
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
3268
END_TIMING(_T_FAILED);
3272
if (con->mStatus.rc != CMPI_RC_OK) {
3274
*rc=cloneStatus(con->mStatus);
3276
END_TIMING(_T_FAILED);
3281
* allocate an empty enumeration , to be filled in
3282
* by the scan of the xml data in enumScanThrd .
3285
retEnum = newCMPIEnumeration(NULL , NULL);
3288
* copy addresses so parsing can find our connection and
3292
retNatEnum = (struct native_enum *) retEnum ;
3293
retNatEnum->econ = con ;
3294
retNatEnum->ecop = cop ;
3295
con->asynRCntl.enmp = (struct native_enum *) retEnum ;
3297
pthrd_error = pthread_create(&enum_scanthrd_id,
3299
(void*)&enumScanThrd,
3302
* if enumClasses Couldn't run thread pthrd_error , system error
3303
* otherwise we are OK , set status appropriately
3305
if(pthrd_error != 0){
3306
CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
3308
CMSetStatus(rc,CMPI_RC_OK);
3316
/* --------------------------------------------------------------------------*/
3317
/* finished & working */
3318
static CMPIEnumeration* enumClassNames(
3320
CMPIObjectPath * cop,
3324
ClientEnc *cl=(ClientEnc*)mb;
3325
CMCIConnection *con=cl->connection;
3326
UtilStringBuffer *sb=UtilFactory->newStringBuffer(2048);
3328
CMPIEnumeration *retEnum;
3329
struct native_enum *retNatEnum;
3330
pthread_t enum_scanthrd_id = 0 ;
3331
int pthrd_error = 0 ;
3333
START_TIMING(EnumerateClassNames);
3337
// con->asynRCntl.enmp = (struct native_enum *)retNatEnum ;
3339
initEscanInfo(con) ;
3340
if(pthrd_error = pthread_mutex_init(&(con->asynRCntl.escanlock),NULL) != 0){
3341
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED," Failed pthread mutex init");
3342
END_TIMING(_T_FAILED);
3346
con->ft->genEnumRequest(cl, EnumerateClassNames, cop, 0);
3348
/* Construct the CIM-XML request */
3350
sb->ft->append3Chars(sb,"<IMETHODCALL NAME=\"", EnumerateClassNames, "\">");
3352
addXmlNamespace(sb, cop);
3353
emitdeep(sb,flags & CMPI_FLAG_DeepInheritance);
3354
addXmlClassnameParam(sb, cop);
3356
sb->ft->appendChars(sb,"</IMETHODCALL>\n");
3359
error = con->ft->addPayload(con,sb);
3361
CMSetStatus (&con->mStatus, CMPI_RC_OK );
3363
if (error || (error = con->ft->getEnumResponse(con, cop))) {
3364
CMSetStatusWithChars(rc,CMPI_RC_ERR_FAILED,error);
3366
END_TIMING(_T_FAILED);
3370
if (con->mStatus.rc != CMPI_RC_OK) {
3372
*rc=cloneStatus(con->mStatus);
3374
END_TIMING(_T_FAILED);
3378
* allocate an empty enumeration , to be filled in
3379
* by the scan of the xml data in enumScanThrd .
3382
retEnum = newCMPIEnumeration(NULL , NULL);
3385
* copy addresses so parsing can find our connection and
3389
retNatEnum = (struct native_enum *) retEnum ;
3390
retNatEnum->econ = con ;
3391
retNatEnum->ecop = cop ;
3392
con->asynRCntl.enmp = (struct native_enum *) retEnum ;
3394
pthrd_error = pthread_create(&enum_scanthrd_id,
3396
(void*)&enumScanThrd,
3399
* if enumClassNames Couldn't run thread pthrd_error , system error
3400
* otherwise we are OK , set status appropriately
3402
if(pthrd_error != 0){
3403
CMSetStatus(rc,CMPI_RC_ERROR_SYSTEM);
3405
CMSetStatus(rc,CMPI_RC_OK);
3414
/* --------------------------------------------------------------------------*/
3415
static char* genEnumRequest(ClientEnc *cle, const char *op,
3416
CMPIObjectPath *cop, int classWithKeys)
3418
CMCIConnection *con = cle->connection;
3419
CMCIClientData *cld = &cle->data;
3421
char method[256] = "CIMMethod: ";
3422
char CimObject[512] = "CIMObject: ";
3425
int chunkedTransfer = 0 ;
3427
if (!con->mHandle) return "Unable to initialize curl interface.";
3429
// if (!supportsSSL() && url.scheme == "https")
3430
// throw HttpException("this curl library does not support https urls.");
3433
* check to see if this is an enumeration
3435
if((strcmp(op , EnumerateInstances )) == 0) {
3436
chunkedTransfer = 1 ;
3438
con->asynRCntl.eMethodType = ENUMERATEINSTANCES ;
3440
if((strcmp(op , EnumerateInstanceNames )) == 0) {
3441
chunkedTransfer = 1 ;
3443
con->asynRCntl.eMethodType = ENUMERATEINSTANCENAMES ;
3445
if((strcmp(op , EnumerateClasses )) == 0) {
3446
chunkedTransfer = 1 ;
3448
con->asynRCntl.eMethodType = ENUMERATECLASSES ;
3450
if((strcmp(op , EnumerateClassNames )) == 0) {
3451
chunkedTransfer = 1 ;
3453
con->asynRCntl.eMethodType = ENUMERATECLASSNAMES ;
3455
isEnumOp = 0 ; /* some other operation */
3458
con->mResponse->ft->reset(con->mResponse);
3460
con->mUri->ft->reset(con->mUri);
3461
con->mUri->ft->append6Chars(con->mUri, cld->scheme, "://", cld->hostName,
3462
":", cld->port, "/cimom");
3464
/* Initialize curl with the url */
3465
curl_easy_setopt(con->mHandle, CURLOPT_URL,
3466
con->mUri->ft->getCharPtr(con->mUri));
3468
/* Enable progress checking */
3469
curl_easy_setopt(con->mHandle, CURLOPT_NOPROGRESS, 0);
3471
/* Reset timeout control */
3472
con->mTimeout.mTimestampStart = 0;
3473
con->mTimeout.mTimestampLast = 0;
3474
con->mTimeout.mFixups = 0;
3476
/* This will be a HTTP post */
3477
curl_easy_setopt(con->mHandle, CURLOPT_POST, 1);
3479
/* Disable SSL Host verification */
3480
curl_easy_setopt(con->mHandle, CURLOPT_SSL_VERIFYHOST, 0);
3482
/* Setup authentication */
3483
curl_easy_setopt(con->mHandle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
3485
/* Set username and password */
3486
if (cld->user != NULL) {
3487
UtilStringBuffer *UserPass = con->mUserPass;
3489
UserPass->ft->reset(UserPass);
3490
UserPass->ft->appendChars(UserPass, cld->user);
3492
UserPass->ft->append3Chars(UserPass, ":", cld->pwd, NULL);
3493
/* Setup "<userid>:<password>" */
3494
curl_easy_setopt(con->mHandle, CURLOPT_USERPWD,
3495
UserPass->ft->getCharPtr(UserPass));
3498
/* initialize status */
3499
CMSetStatus(&con->mStatus,CMPI_RC_OK);
3501
/* Setup connect timeouts for cimserver operations */
3502
curl_easy_setopt(con->mHandle, CURLOPT_NOSIGNAL, 1);
3503
curl_easy_setopt(con->mHandle, CURLOPT_CONNECTTIMEOUT, CIMSERVER_TIMEOUT);
3505
/* setup callback for client timeout calculations */
3506
curl_easy_setopt(con->mHandle, CURLOPT_PROGRESSFUNCTION, enumCheckProgress);
3507
curl_easy_setopt(con->mHandle, CURLOPT_PROGRESSDATA, con);
3509
// Initialize default headers
3510
con->ft->initializeHeaders(con);
3513
* check for chunk transfer or no chunk
3516
if(chunkedTransfer == 1){
3518
* only use http chunk if these enumeration requests come in
3521
con->mHeaders = curl_slist_append(con->mHeaders, "TE: trailers ");
3525
// Add CIMMethod header
3527
con->mHeaders = curl_slist_append(con->mHeaders, method);
3529
// Add CIMObject header with cop's namespace, class, keys
3531
pathToChars(cop, NULL, &CimObject[11], 1);
3533
nsc = getNameSpaceComponents(cop);
3534
nsp = nsc->ft->getFirst(nsc);
3535
while (nsp != NULL) {
3536
strcat(CimObject, nsp);
3537
free(nsp); /* VM: freeing strdup'ed memory - should be part of release */
3538
if ((nsp = nsc->ft->getNext(nsc)) != NULL)
3539
strcat(CimObject, "%2F");
3543
con->mHeaders = curl_slist_append(con->mHeaders, CimObject);
3545
// Set all of the headers for the request
3546
curl_easy_setopt(con->mHandle, CURLOPT_HTTPHEADER, con->mHeaders);
3548
// Set up the callbacks to store the response
3550
curl_easy_setopt(con->mHandle, CURLOPT_WRITEFUNCTION, enumWriteCb);
3551
//Use CURLOPT_FILE instead of CURLOPT_WRITEDATA - more portable
3552
curl_easy_setopt(con->mHandle, CURLOPT_FILE, con);
3553
// SAVE ME curl_easy_setopt(con->mHandle, CURLOPT_FILE, con->mResponse);
3554
// Header processing:
3555
curl_easy_setopt(con->mHandle, CURLOPT_WRITEHEADER, con);
3556
curl_easy_setopt(con->mHandle, CURLOPT_HEADERFUNCTION, enumWriteHeaders);
3558
curl_easy_setopt(con->mHandle, CURLOPT_WRITEFUNCTION, writeCb);
3560
// Use CURLOPT_FILE instead of CURLOPT_WRITEDATA - more portable
3561
curl_easy_setopt(con->mHandle, CURLOPT_FILE, con->mResponse);
3563
// Header processing:
3564
curl_easy_setopt(con->mHandle, CURLOPT_WRITEHEADER, &con->mStatus);
3565
curl_easy_setopt(con->mHandle, CURLOPT_HEADERFUNCTION, writeHeaders);
3568
// Fail if we receive an error (HTTP response code >= 300)
3569
curl_easy_setopt(con->mHandle, CURLOPT_FAILONERROR, 1);
3574
/* --------------------------------------------------------------------------*/
3576
static size_t enumWriteHeaders(void *ptr, size_t size,
3577
size_t nmemb, void *stream)
3579
CMCIConnection *con = stream ;
3580
CMPIStatus *status=(CMPIStatus*)&con->mStatus ;
3585
if (str[nmemb-1] != 0) {
3586
/* make sure the string is zero-terminated */
3587
str = malloc(nmemb + 1);
3588
memcpy(str,ptr,nmemb);
3593
colonidx=strchr(str,':');
3597
if (strcasecmp(str,"cimstatuscode") == 0) {
3598
/* set status code */
3599
status->rc = atoi(colonidx+1);
3600
con->asynRCntl.xfer_state = XFER_COMPLETE ;
3602
else if (strcasecmp(str, "cimstatuscodedescription") == 0) {
3603
status->msg=newCMPIString(colonidx+1,NULL);
3605
else if (strcasecmp(str, "content-length") == 0) {
3606
length = atoi(colonidx+1);
3608
* even though we sent for chunk response and expect a trailer
3609
* we can get all the data back without getting a trailer !
3610
* keep track of this for checkProgress function.
3611
* in both cases signal enumResponseThrd.
3613
con->asynRCntl.xfer_state = XFER_RESP_CL ;
3614
pthread_mutex_lock( &con->asynRCntl.xfer_cond_mutex );
3615
pthread_cond_signal( &con->asynRCntl.xfer_cond );
3616
pthread_mutex_unlock( &con->asynRCntl.xfer_cond_mutex );
3618
else if (strncasecmp(str, "Transfer-encoding" , 17) == 0) {
3619
if (strncasecmp(colonidx+2, "chunked" , 7) == 0){
3620
con->asynRCntl.xfer_state = XFER_RESP_TEC ;
3621
pthread_mutex_lock( &con->asynRCntl.xfer_cond_mutex );
3622
pthread_cond_signal( &con->asynRCntl.xfer_cond );
3623
pthread_mutex_unlock( &con->asynRCntl.xfer_cond_mutex );
3629
if (strncasecmp(str, "Transfer-encoding" , 17) == 0) {
3630
// printf(" enumWriteHeaders we see Transfer-encoding: 2nd one \n") ;
3637
/* --------------------------------------------------------------------------*/
3639
static size_t enumWriteCb(void *ptr, size_t size,
3640
size_t nmemb, void *stream)
3642
CMCIConnection *con = stream ;
3645
UtilStringBuffer *sb=(UtilStringBuffer*)con->mResponse ;
3648
* lock connection structure here
3650
if((retcode = pthread_mutex_lock(&(con->asynRCntl.escanlock))) != 0){
3651
// printf(" enumWriteCb pthread lock return code %d\n",retcode) ;
3654
unsigned int length = size * nmemb;
3655
sb->ft->appendBlock(sb, ptr, length);
3658
* maintain escanInfo base pointer and end of data offset
3660
con->asynRCntl.escanInfo.base = sb->hdl ;
3661
con->asynRCntl.escanInfo.eodoff = con->asynRCntl.escanInfo.eodoff + length ;
3662
con->asynRCntl.escanInfo.recdtotl = con->asynRCntl.escanInfo.recdtotl + length ;
3665
* unlock connection structure here
3667
if((retcode = pthread_mutex_unlock(&(con->asynRCntl.escanlock))) != 0){
3668
//printf(" enumWriteCb ptread lock return code %d\n",retcode) ;
3672
con->asynRCntl.xfer_state = XFER_DATA_RECVD ;
3677
/* --------------------------------------------------------------------------*/
3679
void *enumResponseThrd(CMCIConnection *con)
3681
CURLcode rv ; /* CURL error code */
3683
if(con->asynRCntl.xfer_state == XFER_NOT_STARTED){
3684
con->asynRCntl.xfer_state = XFER_GENRQST ;
3686
// printf(" enumResponseThrd xfer_state = %d is out of sequence !!!!!!!!!!! \n",
3687
// con->asynRCntl.xfer_state) ;
3690
rv = curl_easy_perform(con->mHandle);
3692
/* indicate timeout error for aborted by progess handler */
3693
if (rv == CURLE_ABORTED_BY_CALLBACK) {
3694
rv = CURLE_OPERATION_TIMEOUTED;
3698
CMSetStatus(&con->mStatus,CMPI_RC_ERROR_SYSTEM);
3703
/* --------------------------------------------------------------------------*/
3705
char *getEnumResponse(CMCIConnection *con, CMPIObjectPath *cop)
3708
pthread_t enum_rthd_id = 0 ;
3709
int pthrd_error = 0 ;
3710
struct timespec tp ;
3714
pthrd_error = pthread_create(&enum_rthd_id,
3716
(void*)&enumResponseThrd,
3719
* if we cannot create the thread return error
3721
if(pthrd_error != 0){
3722
// fprintf(stderr, "getEnumResponse Couldn't run enumResponseThrd errno %d\n", pthrd_error);
3723
return strdup("Error from pthread_create of enumResponseThrd");
3726
pthread_mutex_lock( &con->asynRCntl.xfer_cond_mutex );
3727
clock_gettime(CLOCK_REALTIME, &tp);
3728
tp.tv_sec += TIMEDELAY;
3729
rc = pthread_cond_timedwait(&con->asynRCntl.xfer_cond, &con->asynRCntl.xfer_cond_mutex , &tp);
3730
pthread_mutex_unlock( &con->asynRCntl.xfer_cond_mutex);
3732
* if we didn't get something back from server in TIMEDELAY seconds
3733
* we are calling it an error and cancel the thread.
3736
// printf(" - DEBUG getEnumResponse pthread_cond_timedwait - TIMEDOUT !!!! rc = %d!!!\n",rc) ;
3737
pthread_cancel(enum_rthd_id);
3738
return strdup("No data received from server");
3741
if(con->mStatus.rc != CMPI_RC_OK)
3743
pthread_cancel(enum_rthd_id);
3744
return strdup("failed curl_easy_perform call");
3749
static int enumCheckProgress(void *data,
3755
CMCIConnection *con = (CMCIConnection *) data ;
3756
struct _TimeoutControl * timeout;
3758
timeout = &con->mTimeout ;
3759
time_t timestampNow = time(NULL);
3762
if (total == actual){
3763
con->asynRCntl.xfer_state = XFER_COMPLETE ;
3766
/* we received everything and don't care about timeouts */
3767
if (total == actual) {
3770
if (timeout->mFixups > MAX_PROGRESS_FIXUPS) {
3771
/* to many fixups occured -> fail */
3774
if (timeout->mTimestampStart == 0 ||
3775
timeout->mTimestampLast > timestampNow ||
3776
timestampNow - timeout->mTimestampLast > MAX_PLAUSIBLE_PROGRESS ) {
3777
/* need to fix up - either first call or system time changed */
3778
timeout->mFixups += 1;
3779
timeout->mTimestampStart = timestampNow;
3780
timeout->mTimestampLast = timestampNow;
3783
if (timestampNow - timeout->mTimestampStart < CIMSERVER_TIMEOUT) {
3784
timeout->mTimestampLast = timestampNow;
3791
/* --------------------------------------------------------------------------*/
3792
void initEscanInfo(CMCIConnection * con) {
3793
con->asynRCntl.escanInfo.base = 0;
3794
con->asynRCntl.escanInfo.eodoff = 1;
3795
con->asynRCntl.escanInfo.ssecoff = 0;
3796
con->asynRCntl.escanInfo.curoff = 0;
3797
con->asynRCntl.escanInfo.section = 0;
3798
con->asynRCntl.escanInfo.sectlen = 0;
3799
con->asynRCntl.escanInfo.prevtotl= 0;
3800
con->asynRCntl.escanInfo.recdtotl= 0;
3801
con->asynRCntl.escanInfo.getnew = 1; /* set so we getnext section right away */
3802
con->asynRCntl.escanInfo.parsestate = PARSTATE_INIT;
3803
con->asynRCntl.escanlock = init_mutex;
3804
con->asynRCntl.xfer_cond_mutex = init_mutex;
3805
con->asynRCntl.xfer_cond = init_cond;
3807
/* --------------------------------------------------------------------------*/