=======================================  =======================================
   From: Andy Elkin                        2:5030/15       02 Oct 1998  23:17:56
     To: John Gladkih                      2:5051/16       02 Oct 1998  23:17:56
   Subj: Re: hydra                                                              
================================================================================
 * Reply to message from area 'Andy's'

Hello John!

  Quoting message from John Gladkih to Andy Elkin
  [02 Oct 98 at 13:28]

JG> 蠩,    ⪮ ᪠   ⥡  FINFO?   ⥡  
JG> 䠩 ।,  ... 2604 ।  , 2606 㦥 ... 
JG> 祣         娤  t-m ࠡ⠫ ଠ쭮?
JG>  ਬ    㤥.

    H 㢥७    祭.  ᮪ ନ騩 FINFO:
  ࠣ 騩 FINFO.
( -  ० '/').

        case HTX_FINFO:
            if (txfd >= 0)
            {
//                if (!txretries) strlwr (txfname1);
                sprintf ((char *) txbufin, "%08lx%08lx%08lx%08lx%08lx",
                    txftime, Tx_len, 0L, 0L, 0L);
#ifdef __32__
                MakeShortName(txalias ? txalias : txfname1,
                              (char *) &txbufin[strlen((char *) txbufin)]);
                strlwr(txbufin);
                strcpy((char *) &txbufin[strlen((char *) txbufin)+1],
                       txalias ? txalias : txfname1);
                       /* TJW 960924 long filename support */
#else
                strcat((char *) txbufin, txalias ? txalias : txfname1);
                strlwr((char *)txbufin);
#endif
            }
            else
            {
                if (!txretries)
                {
#ifdef DEBUG
                    if (z_debug) xallsay(-1,"+HSEND: End of batch");
#endif
                }
                strcpy ((char *) txbufin, txfname1);
            }

            {
            int len = strlen ((char *) txbufin) + 1;
#ifdef __32__
            /* TJW 960924 short + long filename support */
            if(len>1) len += strlen((char *) txbufin + len) + 1;
#endif
            if (txoptions & HOPT_SAFESKIP)
                    {
                    *((long *)&txbufin[len])=txfileno;
                    len+=sizeof(long);
                    }

            txpkt ((word) len, HPKT_FINFO);
            }

            txtimer = h_timer_set (txretries ? timeout / 2 : timeout);
            txstate = HTX_FINFOACK;
            break;

/////////////////////////////////////////////////////////////////

 ⥭:

        case HPKT_FINFO:
            if (rxstate == HRX_FINFO)
            {

                timerxinoneway=timerxinoneway1=0;
                braindead = h_timer_set (H_BRAINDEAD);
                if (!rxbuf[0])
                {
#ifdef DEBUG
                    if (z_debug) xallsay(-1,"*HRECV: End of batch");
#endif
                    Rx_pos = 0L;
                    rxstate = HRX_DONE;
                    batchesdone++;
                    ||rf_expect=0L;
                    do_anyfile(1);   || process online
                    if (batchesdone>1) set_sent_freq();
                }
                else
                {
#ifdef __32__
             long slen, plen = rxpktlen - ((rxoptions &
HOPT_SAFESKIP)?2:1)*sizeof(long);
#endif
             long dummy;

            if (rxoptions & HOPT_SAFESKIP)
                {
                dummy=*((long *) &rxbuf[rxpktlen-sizeof(long)]);
#ifdef DEBUG
                    if (z_debug) xallsay(-1,"NFI: FINFO for %ld",dummy);
#endif

                if ((we_answer && dummy>0) || (!we_answer && dummy <0))
                   {
                    || this is fucking echo!
               txstate = HTX_DONE;
               res = XFER_ABORT;
               break;
                   }

                if (rxfilenokept==dummy)
                    {
                    || we had received this before, can ignore.
#ifdef DEBUG
                    if (z_debug) xallsay(-1,"_RS: Ignored duplicate FINFO");
#endif
                    goto sendfinfoack;
                    }
                rxfilenokept=dummy;
                }

                   sprintf(buff,"(H%s)",(rxoptions & HOPT_CRC32)?"32":"16");
                   show_prot_name(1,buff);

                    Rx_len = rxftime = 0L;
                    skip_this_file=0;
                    refuse_this_file=0;

                    rxfname1[0] = '\0';
                    sscanf ((char *) rxbuf, "%08lx%08lx%08lx%08lx%08lx%s",
                        &rxftime, &Rx_len, &dummy, &dummy, &dummy, rxfname1);
                    strlwr (rxfname1);

#ifdef __32__
                    slen = strlen((char *) rxbuf) + 1; |* TJW 960924 long
filename support *|
                    if(plen > slen) |* is there anything MORE ? *|
                      if(strlen(((char *) rxbuf) + slen) > strlen(rxfname1))
                         strcpy(rxfname1,((char *) rxbuf) + slen);
#endif
if
(process_rx_filename(current_dir_files,uniq_dir,rxfname1,Rx_len,rxftime,&f_date
&f_time,&Rx_pos,&final_attrib,Rxfname))
                                 Rx_pos = -2L;

                     t_size=Rx_len-(Rx_pos>0?Rx_pos:0);
                     rxsttime=time(NULL);
                     show_next_file(1,rxfname1,Rx_len);

                     if (Rx_pos==-2L) {   |* Refuse it *|
               if (is_log_fullpath || NULL==(ptr=strrchr(Rxfname,'\\')))
ptr=Rxfname;
                         else ptr++;

                         sprintf(buffer,tmess[560]|*"HR-%s %s
refused"*|,(rxoptions & HOPT_CRC32)?"32":"16",ptr);
             (*log_say)(buffer);

             color=LOG_ZMOD;
             lsay("%s",buffer);

             show_file_result(1,tmess[562]|*"(* Refused *)"*|);

                         if (rf_expect >= Rx_len) rf_expect-=Rx_len;
                                             else rf_expect=0L;

                         hydra_status(0,0);
                         ||_dos_setfileattr((const char *)Rxfname,FA_ARCH);

                                      } else || refuse
                                if (Rx_len==Rx_pos)
                                      {   |* Already have file *|

               if (is_log_fullpath || NULL==(ptr=strrchr(Rxfname,'\\')))
ptr=Rxfname;
                         else ptr++;

             sprintf(buffer,tmess[572]|*"HR-%s %s %ld skipped"*|,(rxoptions &
HOPT_CRC32)?"32":"16",ptr,Rx_len);
             (*log_say)(buffer);

             color=LOG_ZMOD;
             lsay("%s",buffer);

             show_file_result(1,tmess[496]|*"(* Skipped *)"*|);
                         Rx_pos = -1L;

                         if (rf_expect >= Rx_len) rf_expect-=Rx_len;
                                             else rf_expect=0L;

                         hydra_status(0,0);
                         _dos_setfileattr((const char *)Rxfname,FA_ARCH);

                                      } || already have
                                   else {
                                      rxfd=open_rx_file(Rxfname);
                                      if (rxfd<0) Rx_pos = -2L;

                                      if (rxfd >= 0) {
#ifdef DEBUG
if (z_debug)                                     xallsay(-1,"+HRECV: %s (%ldb),
%d min.",
                                                 rxfname1, Rx_len,
                                                 (int) (Rx_len * 10L | speed +
27L) | 54L);
#endif

                                            chsize(rxfd,Rx_pos);
                                            rxstpos = Rx_pos;
                                            rxtimer = h_timer_reset();
                                            rxretries = 0;
                                            rxlastsync = 0L;
                                            rxsyncid = 0L;

                                            hydra_status(0,0);

#ifdef __32__
             if (is_log_fullpath || NULL==(ptr=strrchr(Rxfname,'\\')))
ptr=Rxfname;
                              else ptr++;
             sprintf(buffer,"HR-%s %s",(rxoptions & HOPT_CRC32)?"32":"16",ptr);
                 log_pipe_write(buffer);
#endif


                                               if (Rx_pos > 0L) {
            if (is_log_fullpath || NULL==(ptr=strrchr(Rxfname,'\\')))
ptr=Rxfname;
                              else ptr++;
            sprintf(buffer,tmess[573]|*"HR: Resuming %s from
%ld"*|,ptr,Rx_pos);
            color=LOG_AUX;
                        xlsay("%s",buffer);
#ifdef __32__
                log_pipe_write(buffer);
#endif
                                                               }
                                           rxstate = HRX_DATA;
                                                     } || opened ok
                                         }  ||opened
                                               }  || filename[0]
                             }
                             else if (rxstate == HRX_DONE)
                                Rx_pos = (!rxbuf[0]) ? 0L : -2L;

                          sendfinfoack:
                             h_long1(txbufin) = intell(Rx_pos);
                             if (rxoptions & HOPT_SAFESKIP) h_long2(txbufin) =
intell(rxfilenokept); |*ELK 2602a17*|
                             txpkt((int) ((rxoptions &
HOPT_SAFESKIP)?2:1)*sizeof (long),HPKT_FINFOACK); |*ELK2602a17*|
                             break;

            |*---------------------------------------------------*|




andy\elk
--- TM-Ed 1.14b+

================================================================================
