Ignore:
Timestamp:
Dec 12, 2017, 4:09:47 PM (6 years ago)
Author:
djay
Message:

Add status_code key to the lenv section to support returning a specific HTTP error code from the service code. Fix callback invocation to support inputs arrays at step 1 and 2. Fix issue with cpu usage. Fix issue with mapserver publication when an input is optional. Fix callback invocation at step 7 in case the service has failed on the HPC side.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/sshapi.c

    r854 r860  
    283283    }
    284284  }while(!sftp_handle);
     285#ifdef SSH_DEBUG
    285286  fprintf(stderr, "libssh2_sftp_open() is done, get file information\n");
     287#endif
    286288  do {
    287289  rc = libssh2_sftp_stat_ex(sessions[cnt]->sftp_session, targetPath, strlen(targetPath),
     
    295297  else
    296298    {
     299#ifdef SSH_DEBUG
    297300      fprintf(stderr, "Stat Data: RetCode=%d\n", rc);
    298301      fprintf(stderr, "Stat Data: Size=%llu\n", attrs.filesize);
    299302      fprintf(stderr, "Stat Data: Perm=%lx\n",  attrs.permissions);
    300303      fprintf(stderr, "Stat Data: mtime=%lu\n",  attrs.mtime);
     304#endif
    301305      if(rc==0)
    302306        break;
     
    348352      return false;
    349353    }
     354    if(!sessions[cnt]->sftp_session)
     355      zSleep(10);
    350356  } while (!sessions[cnt]->sftp_session);
    351357
     
    363369      return false;
    364370    }
     371    if(!sftp_handle)
     372      zSleep(10);
    365373  } while (!sftp_handle);
    366374  start = time(NULL);
     
    432440      return -1;
    433441    }
     442    if(!sessions[cnt]->sftp_session)
     443      zSleep(10);
    434444  } while (!sessions[cnt]->sftp_session);
    435445  do {
     
    482492      return -1;
    483493    }
    484  
     494    
    485495  } while (1);
    486496  duration = (int)(time(NULL)-start);
     
    503513  int exitcode;
    504514  char *exitsignal=(char *)"none";
    505   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    506   fflush(stderr);
    507515  while( (channel = libssh2_channel_open_session(sessions[cnt]->session)) == NULL &&
    508516         libssh2_session_last_error(sessions[cnt]->session,NULL,NULL,0) == LIBSSH2_ERROR_EAGAIN ) {
    509     fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    510     fflush(stderr);
    511       waitsocket(sessions[cnt]->sock_id, sessions[cnt]->session);
    512   }
    513   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    514   fflush(stderr);
     517    waitsocket(sessions[cnt]->sock_id, sessions[cnt]->session);
     518  }
    515519  if( channel == NULL ){
    516520    fprintf(stderr,"Error\n");
    517521    return -1;
    518522  }
    519   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    520   fflush(stderr);
    521523  while( (rc = libssh2_channel_exec(channel, command)) == LIBSSH2_ERROR_EAGAIN ) {
    522     fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    523     fflush(stderr);
    524524    waitsocket(sessions[cnt]->sock_id, sessions[cnt]->session);
    525525  }
    526   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    527   fflush(stderr);
    528526  if( rc != 0 ) {
    529527    fprintf(stderr,"Error\n");
    530528    return -1;
    531529  }
    532   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    533   fflush(stderr);
    534530
    535531  map* tmpPath=getMapFromMaps(conf,"main","tmpPath");
     
    539535  FILE* logFile=fopen(logPath,"wb");
    540536  free(logPath);
    541   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    542   fflush(stderr);
    543537  while(true){
    544538    int rc;
     
    563557      break;
    564558  }
    565   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    566   fflush(stderr);
    567559  fclose(logFile);
    568   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    569   fflush(stderr);
    570560  exitcode = 127;
    571   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    572   fflush(stderr);
    573561  while( (rc = libssh2_channel_close(channel)) == LIBSSH2_ERROR_EAGAIN )
    574562    waitsocket(sessions[cnt]->sock_id, sessions[cnt]->session);
    575   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    576   fflush(stderr);
    577563 
    578564  if( rc == 0 ) {
     
    581567                                    NULL, NULL, NULL, NULL, NULL);
    582568  }
    583   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    584   fflush(stderr);
    585569 
    586570  if (exitsignal)
     
    588572  else
    589573    fprintf(stderr, "\nEXIT: %d bytecount: %d\n", exitcode, bytecount);
    590   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    591   fflush(stderr);
    592574 
    593575  libssh2_channel_free(channel);
     
    664646    }
    665647  }
    666 #ifdef DEBUG 
     648#ifdef SSH_DEBUG 
    667649  fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    668650  fflush(stderr);
     
    682664    return false;
    683665  }
    684 #ifdef DEBUG
     666#ifdef SSH_DEBUG
    685667  fprintf(stderr,"*** %s %d\n",__FILE__,__LINE__);
    686668  fflush(stderr);
     
    700682        getMapArray(queueMaps->content,"targetPath",i)
    701683      };
     684#ifdef SSH_DEBUG     
    702685      fprintf(stderr,"*** %s %d %s %s\n",__FILE__,__LINE__,argv[1]->value,argv[2]->value);
     686#endif     
    703687      /**/zooLock* lck;
    704688      if((lck=lockFile(*conf,argv[1]->value,'w'))!=NULL){/**/
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png