Esempio n. 1
0
/**
 * Converts a PBS job status struct to a jobcard struct
 *
 * @param jobInfo struct with the information about the job
 * @param soap is used to allocate memory deallocatable by the gSOAP library
*/ 
void convertJobInfo(struct soap* soap,
		 struct jobcard* jobInfo, 
		 struct batch_status* status)
{	
   struct attrl* attrList = status->attribs;
   //default value
   jobInfo->tcpu= 1;

   while (attrList != NULL)
   {
      if(!strcmp(attrList->name, ATTR_v))
         getRequestInfo(soap, attrList->value, jobInfo);
      attrList = attrList->next;
   }
}
Esempio n. 2
0
void getRequest(int & cli){
    std::string currLine;
    char buffer [REQUESTSIZE];
    char tempBuff[REQUESTSIZE];
    int i = 0;
    while(true){
        bzero(tempBuff, REQUESTSIZE);
        read(cli, tempBuff, REQUESTSIZE);
        std::cout << tempBuff << std::endl;
        if(i == 0){
            strcpy(buffer, tempBuff);
        } else {
            strcat(buffer, tempBuff);
        }
        currLine = buffer;
        if(currLine.find("\r\n\r\n") != std::string::npos){
            break;
        }
        i++;
    }
    printf("Received - %s",buffer);
    getRequestInfo(buffer);
}