Ignore:
Timestamp:
Feb 1, 2018, 11:27:28 AM (6 years ago)
Author:
djay
Message:

Add the capability to publish heatmap or any templated mapfile using the epecific msInclude and msLayer keys for an output. For MapServer? published output, define 4096 as the default maxsize and use pixel width or height for raster files. use the correct MapServer? imagemode depending on GDALGetRasterDataType (MS_IMAGEMODE_BYTE for GDT_Byte, MS_IMAGEMODE_INT16 for GDT_Int16 and MS_IMAGEMODE_FLOAT32 for GDT_Float32). Create a text file (.maps) listing every mapfiles created for a MapServer? published output (or inputs) using saveMapNames function. Fixes in ulinet, use uuid for naming temporary files. Add dialect input to the ogr2ogr service. Use the .maps file for removing a file from the DeleteData? service

File:
1 edited

Legend:

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

    r860 r862  
    205205    return NULL;
    206206
    207   libssh2_session_set_blocking(result->session, 0);
     207  libssh2_session_set_blocking(result->session, 1);
    208208
    209209  while ((rc = libssh2_session_handshake(result->session, result->sock_id))
     
    418418 */
    419419int ssh_fetch(maps* conf,const char* localPath,const char* targetPath,int cnt){
    420   char mem[1024];
    421420  size_t nread;
    422421  size_t memuse=0;
     
    436435    if (!sessions[cnt]->sftp_session &&
    437436        (libssh2_session_last_errno(sessions[cnt]->session) != LIBSSH2_ERROR_EAGAIN)) {
    438      
    439437      fprintf(stderr, "Unable to init SFTP session\n");
    440438      return -1;
     
    452450      }
    453451      else {
    454         //non-blocking open
    455452        waitsocket(sessions[cnt]->sock_id, sessions[cnt]->session);
    456453      }
    457454    }
     455    if(!sftp_handle)
     456      zSleep(100);
    458457  } while (!sftp_handle);
    459458 
     
    461460  do {
    462461    do {
    463       rc = libssh2_sftp_read(sftp_handle, mem, sizeof(mem));
    464       /*fprintf(stderr, "libssh2_sftp_read returned %d\n",
    465         rc);*/
     462      char* mem=(char*)malloc(16*1024*1024);
     463      rc = libssh2_sftp_read(sftp_handle, mem,16*1024*1024);
    466464      if(rc > 0) {
    467         //write(2, mem, rc);
    468465        fwrite(mem, rc, 1, local);
    469466      }
     467      free(mem);
    470468    } while (rc > 0);
    471469   
     
    585583 */
    586584bool ssh_close_session(maps* conf,SSHCON* con){
     585  if(con==NULL)
     586    return true;
    587587  while (libssh2_session_disconnect(con->session, "Normal Shutdown, Thank you for using the ZOO-Project sshapi")
    588588         == LIBSSH2_ERROR_EAGAIN);
     
    593593#endif
    594594  libssh2_session_free(con->session);
     595  con=NULL;
    595596  return true;
    596597}
     
    639640                     getMapArray(input->content,"targetPath",i)};
    640641
    641         setMapArray(queueMaps->content,"input",queueIndex,input->name);
    642         setMapArray(queueMaps->content,"localPath",queueIndex,tmp[0]->value);
    643         setMapArray(queueMaps->content,"targetPath",queueIndex,tmp[1]->value);
    644         queueIndex+=1;
     642        setMapArray(queueMaps->content,"input",queueIndex+i,input->name);
     643        setMapArray(queueMaps->content,"localPath",queueIndex+i,tmp[0]->value);
     644        setMapArray(queueMaps->content,"targetPath",queueIndex+i,tmp[1]->value);
     645
    645646      }
    646647    }
    647648  }
    648 #ifdef SSH_DEBUG 
    649   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    650   fflush(stderr);
    651   dumpMaps(queueMaps);
    652   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    653   fflush(stderr);
    654   dumpMaps(*conf);
    655   fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    656   fflush(stderr);
    657 #endif
    658649  return true;
    659650}
     
    664655    return false;
    665656  }
    666 #ifdef SSH_DEBUG
    667   fprintf(stderr,"*** %s %d\n",__FILE__,__LINE__);
    668   fflush(stderr);
    669   dumpMaps(getMaps(*conf,"uploadQueue"));
    670   fprintf(stderr,"*** %s %d\n",__FILE__,__LINE__);
    671   fflush(stderr);
    672 #endif
    673657  map* queueLengthMap=getMapFromMaps(*conf,"uploadQueue","length");
    674658  maps* queueMaps=getMaps(*conf,"uploadQueue");
     
    682666        getMapArray(queueMaps->content,"targetPath",i)
    683667      };
    684 #ifdef SSH_DEBUG     
    685       fprintf(stderr,"*** %s %d %s %s\n",__FILE__,__LINE__,argv[1]->value,argv[2]->value);
    686 #endif     
    687668      /**/zooLock* lck;
    688669      if((lck=lockFile(*conf,argv[1]->value,'w'))!=NULL){/**/
     
    703684    }   
    704685  }
     686  while (libssh2_session_disconnect(test->session, "Normal Shutdown, Thank you for using the ZOO-Project sshapi")
     687         == LIBSSH2_ERROR_EAGAIN);
     688#ifdef WIN32
     689  closesocket(test->sock_id);
     690#else
     691  close(test->sock_id);
     692#endif
     693  libssh2_session_free(test->session);
     694  free(test);
     695  test=NULL;
     696  sessions[ssh_get_cnt(*conf)-1]=NULL;
     697  maps* tmp=getMaps(*conf,"lenv");
     698  addIntToMap(tmp->content,"nb_sessions",ssh_get_cnt(*conf)-1); 
     699
    705700  return true;
    706701}
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