- JulCho now reads data in tow bunches, speeds and rest for optimization
This commit is contained in:
13
sinqhttp.c
13
sinqhttp.c
@@ -46,6 +46,7 @@ static char subsample[] = {"/admin/processhmdata.egi"};
|
||||
#define BADSTATUS -707
|
||||
#define BADAUTH -708
|
||||
#define HMNOMEMORY -709
|
||||
#define BADSUBSAMPLE -710
|
||||
/*=====================================================================
|
||||
our driver private data structure
|
||||
======================================================================*/
|
||||
@@ -94,6 +95,9 @@ static int sinqHttpCheckResponse(pSinqHttp self){
|
||||
|
||||
self->failCount = 0;
|
||||
pPtr = ghttp_get_body(self->syncRequest);
|
||||
if(pPtr == NULL){
|
||||
return 1;
|
||||
}
|
||||
len = ghttp_get_body_len(self->syncRequest);
|
||||
if(len > 511){
|
||||
len = 510;
|
||||
@@ -232,12 +236,12 @@ static int SinqHttpConfigure(pHistDriver self, SConnection *pCon,
|
||||
httpStatus = ghttp_process(pPriv->syncRequest);
|
||||
confData = (char *)ghttp_get_body(pPriv->syncRequest);
|
||||
if(httpStatus != ghttp_done){
|
||||
confData = (char *)ghttp_get_error(pPriv->syncRequest);
|
||||
confData = (char *)ghttp_get_error(pPriv->syncRequest);
|
||||
snprintf(confCommand,511,"ERROR: http error %s occurred",
|
||||
confData);
|
||||
SCWrite(pCon,confCommand,eError);
|
||||
return 0;
|
||||
} else {
|
||||
} else if(confData != NULL){
|
||||
if(strstr(confData,"ERROR") != NULL){
|
||||
snprintf(confCommand,511,"%s",confData);
|
||||
SCWrite(pCon,confCommand,eError);
|
||||
@@ -511,6 +515,11 @@ static HistInt *SinqHttpSubSample(pHistDriver self, SConnection *pCon,
|
||||
}
|
||||
|
||||
len = ghttp_get_body_len(pPriv->syncRequest);
|
||||
if(len <= 0){
|
||||
strncpy(pPriv->hmError,"ERROR: no data returned from subsampling", 511);
|
||||
pPriv->errorCode = BADSUBSAMPLE;
|
||||
return NULL;
|
||||
}
|
||||
resultdata = malloc(len+4);
|
||||
if(resultdata == NULL){
|
||||
strncpy(pPriv->hmError,
|
||||
|
||||
Reference in New Issue
Block a user