示例#1
0
void
run_static(metaresultfile *result, genotype_matrix_ptr genotypes, method_data_ptr data, const correction_options &options, const std::string &output_path)
{
    resultfile *last_stage = do_common_stages( result, genotypes->get_snp_names( ), options, output_path );
    if( last_stage == NULL )
    {
        return;
    }

    do_last_stage( last_stage, options, genotypes, data, output_path );

    delete last_stage;
}
示例#2
0
文件: 15932_0.c 项目: B-Rich/osf_db
int                 check_for_clear_sector(char *hostname,unsigned short port,char *logbook,int flag)
 {
   struct        sockaddr_in rem_addr;
   char          sendbuf[SENDBUFSIZE];
   char          *sendbufp;
   char          getbuf[GETBUFSIZE];
   char          *reqbuf;
   char          notfound[100];
   int           yes;
   int           total;
   int sock;
   int          flagchoice;
   struct timeval w_t;
   fd_set          read_fd;
   int            total_fd;

           PRINTINFO(MSGSECTOR,debug);
           LOGBOOKNOTFOUND(notfound,logbook);             

HEAD:   
          bzero(&w_t,sizeof(w_t));

          w_t.tv_sec     = TIMEOUT;
          w_t.tv_usec    = 0;

             if(flag == 0)
             flagchoice = NOTUPLOADME;
             else 
             flagchoice = UPLOADME;
   
         sock      = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
          if(sock < 0)
           {
            perror("socket");
            exit(1);
           }
         if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(char *)&yes,sizeof(int)))
           { perror("setsockopt");
           close(sock);
           exit(1);
           }
  

          memset(&(rem_addr.sin_zero),'\0',8);
          rem_addr.sin_family = AF_INET;
          rem_addr.sin_port   = htons(port);
          rem_addr.sin_addr.s_addr = get_host_ip(hostname);

            if(connect(sock,(const struct sockaddr*)&rem_addr,sizeof(rem_addr)))
             {  
             fprintf(stderr,"[-] Can not Connect to server!\n");
             exit(1);
             }
        
          sendbufp = make_http_content(flagchoice,logbook);
          reqbuf = make_request_header(logbook,boundary,0);
          strcpy(sendbuf,reqbuf);
          strcat(sendbuf,sendbufp);

           if( (send(sock,sendbuf,sizeof(sendbuf),0)) < 0 )
            {
            perror("send");
            exit(-1);
            close(sock);
            }

               FD_ZERO(&read_fd);
               FD_SET(sock,&read_fd);
      
               if( (total_fd = select(sock + 1,&read_fd,(fd_set *)NULL,(fd_set *)NULL,&w_t)) < 0)
                {
                perror("select");
                close(sock);
                exit(-1);
                }

           
               if(FD_ISSET(sock,&read_fd))
                {
                 if( (total = recv(sock,getbuf,sizeof(getbuf),0)) < 1) {
                    if(errno == EWOULDBLOCK ){
                       NPRINTINFO(REMDOWN);
                       PRINTINFO(REMCRASHED,1);
                       close(sock); 
                       exit(-1);
                       }
                    close(sock);
                    exit(1);
                    }
                 if(strstr(getbuf,INVALIDURL)) {
                     fprintf(stderr,"[-] Invalid URL Bitch, Type the Correct Path\n");
                     close(sock);
                     exit(-1);
                     }              

                 if(strstr(getbuf,AUTHORIZED_DENY)) {
                    fprintf(stderr,"[-] Type User name and Password for login Bitch\n");
                    close(sock);
                    exit(-1);
                     }

                 if(strstr(getbuf,notfound)) {
                   fprintf(stderr,"[-] NO %s LOGBOOK DEFINED BITCH\n",logbook);
                   close(sock);
                   exit(-1);
                     }   
                
                 if(strstr(getbuf,ASKEDPASS)) {
                   NPRINTINFO(PASSALERT);
                   crack_the_code(hostname,port,logbook);
                   close(sock);
                   bzero(getbuf,sizeof(getbuf));
                   goto HEAD;
                     }
                
                 if(strstr(getbuf,ATTOPTERR)) {
                   PRINTINFO(READOPTION,1);
                   close(sock);
                   bzero(getbuf,sizeof(getbuf));
                   spy_attr_options(hostname,port,logbook);
                   goto HEAD;
                     }
                 if(strstr(getbuf,ATTERR)) {
                   get_missing_attributes(getbuf,ATTERR,MISSED[globcount].addr);                       
                   ATTNOTFOUND(MISSED[globcount].addr);
                   MAKINGATT (MISSED[globcount].addr);
                   globcount++;
                   bzero(getbuf,sizeof(getbuf));                   
                   re_check_sector(hostname,port,logbook,flag);                  
                     }

                 if(strstr(getbuf,SECTOR_CLEAR)) {
                    PRINTINFO(CLEARAREA,1);
                    close(sock);
                    do_last_stage(hostname,port,logbook);
                    we_r_coming(hostname);
                    }
           }    
 return(1);
}