-rw-r--r-- | PumpKINDlg.cpp | 20 | ||||
-rw-r--r-- | pumpkin.rc | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp index fc24596..b6b8a36 100644 --- a/PumpKINDlg.cpp +++ b/PumpKINDlg.cpp | |||
@@ -752,467 +752,475 @@ CFileException e; | |||
752 | CRRQSocket::CRRQSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) | 752 | CRRQSocket::CRRQSocket(CPumpKINDlg *daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) |
753 | : CXferSocket(daddy,fileName,type,sin) | 753 | : CXferSocket(daddy,fileName,type,sin) |
754 | { | 754 | { |
755 | m_ACK=0; | 755 | m_ACK=0; |
756 | m_LastSlack=0; | 756 | m_LastSlack=0; |
757 | } | 757 | } |
758 | 758 | ||
759 | UINT tftp::tftpERROR::tftpSize(LPCTSTR msg) | 759 | UINT tftp::tftpERROR::tftpSize(LPCTSTR msg) |
760 | { | 760 | { |
761 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpERROR::tftpErrorCode)+strlen(msg)+1; | 761 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpERROR::tftpErrorCode)+strlen(msg)+1; |
762 | } | 762 | } |
763 | 763 | ||
764 | tftp* tftp::Allocate(UINT tftpSize) | 764 | tftp* tftp::Allocate(UINT tftpSize) |
765 | { | 765 | { |
766 | ASSERT(tftpSize); | 766 | ASSERT(tftpSize); |
767 | tftp* rv = (tftp*) new BYTE[tftpSlackSize+tftpSize]; | 767 | tftp* rv = (tftp*) new BYTE[tftpSlackSize+tftpSize]; |
768 | ASSERT(rv); | 768 | ASSERT(rv); |
769 | rv->length=tftpSize; | 769 | rv->length=tftpSize; |
770 | return rv; | 770 | return rv; |
771 | } | 771 | } |
772 | 772 | ||
773 | void tftp::errSet(UINT code,LPCTSTR msg) | 773 | void tftp::errSet(UINT code,LPCTSTR msg) |
774 | { | 774 | { |
775 | ASSERT(this); | 775 | ASSERT(this); |
776 | ASSERT(length>=data.m_ERROR.tftpSize(msg)); | 776 | ASSERT(length>=data.m_ERROR.tftpSize(msg)); |
777 | strcpy((char*)data.m_ERROR.data,msg); | 777 | strcpy((char*)data.m_ERROR.data,msg); |
778 | data.m_ERROR.SetCode(code); | 778 | data.m_ERROR.SetCode(code); |
779 | } | 779 | } |
780 | 780 | ||
781 | void CXferSocket::PostTFTP(tftp* p,BOOL retryable) | 781 | void CXferSocket::PostTFTP(tftp* p,BOOL retryable) |
782 | { | 782 | { |
783 | ASSERT(p); | 783 | ASSERT(p); |
784 | m_Queue.AddTail(p); | 784 | m_Queue.AddTail(p); |
785 | DoSelect(); | 785 | DoSelect(); |
786 | if(!m_bRetry){ | 786 | if(!m_bRetry){ |
787 | if(retryable) | 787 | if(retryable) |
788 | SetTry(p); | 788 | SetTry(p); |
789 | else | 789 | else |
790 | SetTry(); | 790 | SetTry(); |
791 | } | 791 | } |
792 | ResetTimeout(); | 792 | ResetTimeout(); |
793 | } | 793 | } |
794 | 794 | ||
795 | void CXferSocket::Deny(UINT errCode,UINT errID) | 795 | void CXferSocket::Deny(UINT errCode,UINT errID) |
796 | { | 796 | { |
797 | PostError(errCode,errID); | 797 | PostError(errCode,errID); |
798 | state=stateDeny; | 798 | state=stateDeny; |
799 | } | 799 | } |
800 | 800 | ||
801 | void CRRQSocket::DoXfer() | 801 | void CRRQSocket::DoXfer() |
802 | { | 802 | { |
803 | tftp *p = tftp::Allocate(tftp::tftpDATA::tftpSize(m_blkSize)); | 803 | tftp *p = tftp::Allocate(tftp::tftpDATA::tftpSize(m_blkSize)); |
804 | ASSERT(p); | 804 | ASSERT(p); |
805 | p->SetOpcode(tftp::opDATA); | 805 | p->SetOpcode(tftp::opDATA); |
806 | TRY{ | 806 | TRY{ |
807 | m_File.Seek(m_ACK*m_blkSize,CFile::begin); | 807 | m_File.Seek(m_ACK*m_blkSize,CFile::begin); |
808 | int bytes = m_File.Read(p->data.m_DATA.data,m_blkSize); | 808 | int bytes = m_File.Read(p->data.m_DATA.data,m_blkSize); |
809 | p->data.m_DATA.SetBlock(m_ACK+1); | 809 | p->data.m_DATA.SetBlock(m_ACK+1); |
810 | p->length=p->length-m_blkSize+bytes; | 810 | p->length=p->length-m_blkSize+bytes; |
811 | m_LastSlack = m_blkSize-bytes; | 811 | m_LastSlack = m_blkSize-bytes; |
812 | PostTFTP(p); | 812 | PostTFTP(p); |
813 | if(bytes<m_blkSize){ | 813 | if(bytes<m_blkSize){ |
814 | state=stateFinish; | 814 | state=stateFinish; |
815 | ASSERT(m_Daddy); | 815 | ASSERT(m_Daddy); |
816 | CString tmp; | 816 | CString tmp; |
817 | tmp.Format(IDS_LOG_XFERRRQFINISHED,(LPCTSTR)m_FileName); | 817 | tmp.Format(IDS_LOG_XFERRRQFINISHED,(LPCTSTR)m_FileName); |
818 | m_Daddy->LogLine(tmp); | 818 | m_Daddy->LogLine(tmp); |
819 | } | 819 | } |
820 | }CATCH(CFileException,e){ | 820 | }CATCH(CFileException,e){ |
821 | Deny(e); | 821 | Deny(e); |
822 | }END_CATCH | 822 | }END_CATCH |
823 | } | 823 | } |
824 | 824 | ||
825 | UINT tftp::tftpDATA::tftpSize(UINT blkSize) | 825 | UINT tftp::tftpDATA::tftpSize(UINT blkSize) |
826 | { | 826 | { |
827 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpDATA) | 827 | return tftpHdrSize-tftpSlackSize+sizeof(tftp::tftpDATA) |
828 | -sizeof(BYTE)+blkSize; | 828 | -sizeof(BYTE)+blkSize; |
829 | } | 829 | } |
830 | 830 | ||
831 | void CXferSocket::Deny(CFileException* e) | 831 | void CXferSocket::Deny(CFileException* e) |
832 | { | 832 | { |
833 | PostError(e); | 833 | PostError(e); |
834 | state=stateDeny; | 834 | state=stateDeny; |
835 | } | 835 | } |
836 | 836 | ||
837 | void CXferSocket::PostError(UINT errCode,UINT errID) | 837 | void CXferSocket::PostError(UINT errCode,UINT errID) |
838 | { | 838 | { |
839 | CString msg; | 839 | CString msg; |
840 | msg.LoadString(errID); | 840 | msg.LoadString(errID); |
841 | ASSERT(m_Daddy); | 841 | ASSERT(m_Daddy); |
842 | /*// *** | 842 | /*// *** |
843 | CString tmp; | 843 | CString tmp; |
844 | tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg); | 844 | tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg); |
845 | m_Daddy->LogLine(tmp); | 845 | m_Daddy->LogLine(tmp); |
846 | */ | 846 | */ |
847 | tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg)); | 847 | tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg)); |
848 | err->SetOpcode(tftp::opERROR); | 848 | err->SetOpcode(tftp::opERROR); |
849 | err->errSet(errCode,msg); | 849 | err->errSet(errCode,msg); |
850 | PostTFTP(err); | 850 | PostTFTP(err); |
851 | } | 851 | } |
852 | 852 | ||
853 | void CXferSocket::PostError(CFileException* e) | 853 | void CXferSocket::PostError(CFileException* e) |
854 | { | 854 | { |
855 | UINT eCode; | 855 | UINT eCode; |
856 | UINT eMsgID; | 856 | UINT eMsgID; |
857 | switch(e->m_cause){ | 857 | switch(e->m_cause){ |
858 | case CFileException::fileNotFound: | 858 | case CFileException::fileNotFound: |
859 | eCode=tftp::errNotFound; | 859 | eCode=tftp::errNotFound; |
860 | eMsgID=IDS_TFTP_ERROR_NOTFOUND; | 860 | eMsgID=IDS_TFTP_ERROR_NOTFOUND; |
861 | break; | 861 | break; |
862 | case CFileException::accessDenied: | 862 | case CFileException::accessDenied: |
863 | eCode=tftp::errAccessViolation; | 863 | eCode=tftp::errAccessViolation; |
864 | eMsgID=IDS_TFTP_ERROR_ACCESS; | 864 | eMsgID=IDS_TFTP_ERROR_ACCESS; |
865 | break; | 865 | break; |
866 | case CFileException::directoryFull: | 866 | case CFileException::directoryFull: |
867 | eCode=tftp::errDiskFull; | 867 | eCode=tftp::errDiskFull; |
868 | eMsgID=IDS_TFTP_ERROR_DIRFULL; | 868 | eMsgID=IDS_TFTP_ERROR_DIRFULL; |
869 | break; | 869 | break; |
870 | case CFileException::sharingViolation: | 870 | case CFileException::sharingViolation: |
871 | eCode=tftp::errAccessViolation; | 871 | eCode=tftp::errAccessViolation; |
872 | eMsgID=IDS_TFTP_ERROR_SHARING; | 872 | eMsgID=IDS_TFTP_ERROR_SHARING; |
873 | break; | 873 | break; |
874 | case CFileException::diskFull: | 874 | case CFileException::diskFull: |
875 | eCode=tftp::errDiskFull; | 875 | eCode=tftp::errDiskFull; |
876 | eMsgID=IDS_TFTP_ERROR_DISKFULL; | 876 | eMsgID=IDS_TFTP_ERROR_DISKFULL; |
877 | break; | 877 | break; |
878 | default: | 878 | default: |
879 | eCode=tftp::errUndefined; | 879 | eCode=tftp::errUndefined; |
880 | eMsgID=IDS_TFTP_ERROR_UNDEFINED; | 880 | eMsgID=IDS_TFTP_ERROR_UNDEFINED; |
881 | break; | 881 | break; |
882 | } | 882 | } |
883 | PostError(eCode,eMsgID); | 883 | PostError(eCode,eMsgID); |
884 | } | 884 | } |
885 | 885 | ||
886 | ULONG CRRQSocket::GetACK(void) | 886 | ULONG CRRQSocket::GetACK(void) |
887 | { | 887 | { |
888 | return (m_ACK*m_blkSize)-m_LastSlack; | 888 | return (m_ACK*m_blkSize)-m_LastSlack; |
889 | } | 889 | } |
890 | 890 | ||
891 | BOOL CRRQSocket::OnTFTP(tftp* p) | 891 | BOOL CRRQSocket::OnTFTP(tftp* p) |
892 | { | 892 | { |
893 | BOOL rv = TRUE; | 893 | BOOL rv = TRUE; |
894 | switch(p->Opcode()){ | 894 | switch(p->Opcode()){ |
895 | case tftp::opOACK: | 895 | case tftp::opOACK: |
896 | m_ACK=0; | 896 | m_ACK=0; |
897 | ASSERT(state!=stateFinish); | 897 | ASSERT(state!=stateFinish); |
898 | { | 898 | { |
899 | tftp::tftpOptions o; | 899 | tftp::tftpOptions o; |
900 | if(p->GetOptions(&o)){ | 900 | if(p->GetOptions(&o)){ |
901 | CString v; | 901 | CString v; |
902 | if(o.Lookup(tftpoBSize,v)){ | 902 | if(o.Lookup(tftpoBSize,v)){ |
903 | m_blkSize=atoi(v); | 903 | m_blkSize=atoi(v); |
904 | if(!m_blkSize){// *** More sanity checks | 904 | if(!m_blkSize){// *** More sanity checks |
905 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); | 905 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); |
906 | rv = TRUE; | 906 | rv = TRUE; |
907 | break; | 907 | break; |
908 | } | 908 | } |
909 | } | 909 | } |
910 | if(o.Lookup(tftpoTOut,v)){ | 910 | if(o.Lookup(tftpoTOut,v)){ |
911 | m_timeOut=atoi(v); | 911 | m_timeOut=atoi(v); |
912 | if(!m_timeOut){// *** More sanity checks | 912 | if(!m_timeOut){// *** More sanity checks |
913 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); | 913 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); |
914 | rv = TRUE; | 914 | rv = TRUE; |
915 | break; | 915 | break; |
916 | } | 916 | } |
917 | } | 917 | } |
918 | if(o.Lookup(tftpoXResume,v)){ | 918 | if(o.Lookup(tftpoXResume,v)){ |
919 | m_ACK=atoi(v); | 919 | m_ACK=atoi(v); |
920 | } | 920 | } |
921 | } | 921 | } |
922 | UpdateList(); | 922 | UpdateList(); |
923 | DoXfer(); | 923 | DoXfer(); |
924 | } | 924 | } |
925 | break; | 925 | break; |
926 | case tftp::opACK: | 926 | case tftp::opACK: |
927 | m_ACK=p->data.m_ACK.Block(); | 927 | m_ACK=p->data.m_ACK.Block(); |
928 | if(state!=stateFinish){ | 928 | if(state!=stateFinish){ |
929 | UpdateList(); | 929 | UpdateList(); |
930 | DoXfer(); | 930 | DoXfer(); |
931 | } | 931 | } |
932 | break; | 932 | break; |
933 | case tftp::opERROR: | 933 | case tftp::opERROR: |
934 | { | 934 | { |
935 | ASSERT(m_Daddy); | 935 | ASSERT(m_Daddy); |
936 | CString tmp; | 936 | CString tmp; |
937 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); | 937 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); |
938 | m_Daddy->LogLine(tmp); | 938 | m_Daddy->LogLine(tmp); |
939 | } | 939 | } |
940 | Destroy(FALSE); | 940 | Destroy(FALSE); |
941 | rv = FALSE; | 941 | rv = FALSE; |
942 | break; | 942 | break; |
943 | default: | 943 | default: |
944 | ASSERT(m_Daddy); | 944 | { |
945 | m_Daddy->LogLine(IDS_LOG_XFEROPCODE); | 945 | ASSERT(m_Daddy); |
946 | // *** Self destruct maybe?? | 946 | CString tmp; |
947 | tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); | ||
948 | m_Daddy->LogLine(tmp); | ||
949 | // *** Self destruct maybe?? | ||
950 | } | ||
947 | break; | 951 | break; |
948 | } | 952 | } |
949 | return rv; | 953 | return rv; |
950 | } | 954 | } |
951 | 955 | ||
952 | BOOL CWRQSocket::OnTFTP(tftp* p) | 956 | BOOL CWRQSocket::OnTFTP(tftp* p) |
953 | { | 957 | { |
954 | switch(p->Opcode()){ | 958 | switch(p->Opcode()){ |
955 | case tftp::opOACK: | 959 | case tftp::opOACK: |
956 | ASSERT(state!=stateFinish); | 960 | ASSERT(state!=stateFinish); |
957 | { | 961 | { |
958 | if(m_bResume) | 962 | if(m_bResume) |
959 | m_ACK=m_File.GetLength()/m_blkSize; | 963 | m_ACK=m_File.GetLength()/m_blkSize; |
960 | else | 964 | else |
961 | m_ACK=0; | 965 | m_ACK=0; |
962 | tftp::tftpOptions o; | 966 | tftp::tftpOptions o; |
963 | if(p->GetOptions(&o)){ | 967 | if(p->GetOptions(&o)){ |
964 | CString v; | 968 | CString v; |
965 | if(o.Lookup(tftpoBSize,v)){ | 969 | if(o.Lookup(tftpoBSize,v)){ |
966 | m_blkSize=atoi(v); | 970 | m_blkSize=atoi(v); |
967 | if(!m_blkSize){// *** More sanity checks | 971 | if(!m_blkSize){// *** More sanity checks |
968 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); | 972 | Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE); |
969 | return TRUE; | 973 | return TRUE; |
970 | } | 974 | } |
971 | } | 975 | } |
972 | if(o.Lookup(tftpoTOut,v)){ | 976 | if(o.Lookup(tftpoTOut,v)){ |
973 | m_timeOut=atoi(v); | 977 | m_timeOut=atoi(v); |
974 | if(!m_timeOut){// *** More sanity checks | 978 | if(!m_timeOut){// *** More sanity checks |
975 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); | 979 | Deny(tftp::errOption,IDS_TFTP_ERROR_TOUT); |
976 | return TRUE; | 980 | return TRUE; |
977 | } | 981 | } |
978 | } | 982 | } |
979 | if(o.Lookup(tftpoTSize,v)){ | 983 | if(o.Lookup(tftpoTSize,v)){ |
980 | m_xferSize=atoi(v); | 984 | m_xferSize=atoi(v); |
981 | } | 985 | } |
982 | } | 986 | } |
983 | UpdateList(); | 987 | UpdateList(); |
984 | DoXfer(); | 988 | DoXfer(); |
985 | } | 989 | } |
986 | break; | 990 | break; |
987 | case tftp::opDATA: | 991 | case tftp::opDATA: |
988 | { | 992 | { |
989 | UINTblock = p->data.m_DATA.Block(); | 993 | UINTblock = p->data.m_DATA.Block(); |
990 | TRY{ | 994 | TRY{ |
991 | m_File.Seek((block-1)*m_blkSize,CFile::begin); | 995 | m_File.Seek((block-1)*m_blkSize,CFile::begin); |
992 | int bytes = p->length-sizeof(p->data.m_DATA.block)-(tftpHdrSize-tftpSlackSize); | 996 | int bytes = p->length-sizeof(p->data.m_DATA.block)-(tftpHdrSize-tftpSlackSize); |
993 | if(bytes){ | 997 | if(bytes){ |
994 | m_File.Write(p->data.m_DATA.data,bytes); | 998 | m_File.Write(p->data.m_DATA.data,bytes); |
995 | // *** Move to the other place where we can do it not that often | 999 | // *** Move to the other place where we can do it not that often |
996 | m_File.SetLength(m_File.GetPosition()); | 1000 | m_File.SetLength(m_File.GetPosition()); |
997 | } | 1001 | } |
998 | if(bytes<m_blkSize){ | 1002 | if(bytes<m_blkSize){ |
999 | state=stateFinish; | 1003 | state=stateFinish; |
1000 | ASSERT(m_Daddy); | 1004 | ASSERT(m_Daddy); |
1001 | CString tmp; | 1005 | CString tmp; |
1002 | tmp.Format(IDS_LOG_XFERWRQFINISHED,(LPCTSTR)m_FileName); | 1006 | tmp.Format(IDS_LOG_XFERWRQFINISHED,(LPCTSTR)m_FileName); |
1003 | m_Daddy->LogLine(tmp); | 1007 | m_Daddy->LogLine(tmp); |
1004 | } | 1008 | } |
1005 | m_ACK=block; | 1009 | m_ACK=block; |
1006 | m_LastSlack=m_blkSize-bytes; | 1010 | m_LastSlack=m_blkSize-bytes; |
1007 | UpdateList(); | 1011 | UpdateList(); |
1008 | DoXfer(); | 1012 | DoXfer(); |
1009 | }CATCH(CFileException,e){ | 1013 | }CATCH(CFileException,e){ |
1010 | Deny(e); | 1014 | Deny(e); |
1011 | }END_CATCH | 1015 | }END_CATCH |
1012 | } | 1016 | } |
1013 | break; | 1017 | break; |
1014 | case tftp::opERROR: | 1018 | case tftp::opERROR: |
1015 | { | 1019 | { |
1016 | ASSERT(m_Daddy); | 1020 | ASSERT(m_Daddy); |
1017 | CString tmp; | 1021 | CString tmp; |
1018 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); | 1022 | tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage()); |
1019 | m_Daddy->LogLine(tmp); | 1023 | m_Daddy->LogLine(tmp); |
1020 | } | 1024 | } |
1021 | Destroy(FALSE); | 1025 | Destroy(FALSE); |
1022 | return FALSE; | 1026 | return FALSE; |
1023 | default: | 1027 | default: |
1024 | ASSERT(m_Daddy); | 1028 | { |
1025 | m_Daddy->LogLine(IDS_LOG_XFEROPCODE); | 1029 | ASSERT(m_Daddy); |
1026 | // *** Self destruct maybe?? | 1030 | CString tmp; |
1031 | tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode()); | ||
1032 | m_Daddy->LogLine(tmp); | ||
1033 | // *** Self destruct maybe?? | ||
1034 | } | ||
1027 | break; | 1035 | break; |
1028 | } | 1036 | } |
1029 | return TRUE; | 1037 | return TRUE; |
1030 | } | 1038 | } |
1031 | 1039 | ||
1032 | void tftp::SetOpcode(WORD op) | 1040 | void tftp::SetOpcode(WORD op) |
1033 | { | 1041 | { |
1034 | opcode = REVERSEBYTES(op); | 1042 | opcode = REVERSEBYTES(op); |
1035 | } | 1043 | } |
1036 | void tftp::tftpDATA::SetBlock(WORD b) | 1044 | void tftp::tftpDATA::SetBlock(WORD b) |
1037 | { | 1045 | { |
1038 | block=REVERSEBYTES(b); | 1046 | block=REVERSEBYTES(b); |
1039 | } | 1047 | } |
1040 | WORD tftp::tftpDATA::Block() | 1048 | WORD tftp::tftpDATA::Block() |
1041 | { | 1049 | { |
1042 | return REVERSEBYTES(block); | 1050 | return REVERSEBYTES(block); |
1043 | } | 1051 | } |
1044 | WORD tftp::tftpACK::Block() | 1052 | WORD tftp::tftpACK::Block() |
1045 | { | 1053 | { |
1046 | return REVERSEBYTES(block); | 1054 | return REVERSEBYTES(block); |
1047 | } | 1055 | } |
1048 | void tftp::tftpACK::SetBlock(WORD b) | 1056 | void tftp::tftpACK::SetBlock(WORD b) |
1049 | { | 1057 | { |
1050 | block = REVERSEBYTES(b); | 1058 | block = REVERSEBYTES(b); |
1051 | } | 1059 | } |
1052 | WORD tftp::tftpERROR::Code() | 1060 | WORD tftp::tftpERROR::Code() |
1053 | { | 1061 | { |
1054 | return REVERSEBYTES(code); | 1062 | return REVERSEBYTES(code); |
1055 | } | 1063 | } |
1056 | void tftp::tftpERROR::SetCode(WORD c) | 1064 | void tftp::tftpERROR::SetCode(WORD c) |
1057 | { | 1065 | { |
1058 | code = REVERSEBYTES(c); | 1066 | code = REVERSEBYTES(c); |
1059 | } | 1067 | } |
1060 | 1068 | ||
1061 | 1069 | ||
1062 | CString tftp::errMessage() | 1070 | CString tftp::errMessage() |
1063 | { | 1071 | { |
1064 | CString rv; | 1072 | CString rv; |
1065 | if(memchr(data.m_ERROR.data,0,length-(tftpHdrSize-tftpSlackSize)-sizeof(data.m_ERROR.code))) | 1073 | if(memchr(data.m_ERROR.data,0,length-(tftpHdrSize-tftpSlackSize)-sizeof(data.m_ERROR.code))) |
1066 | rv = (LPCTSTR)data.m_ERROR.data; | 1074 | rv = (LPCTSTR)data.m_ERROR.data; |
1067 | return rv; | 1075 | return rv; |
1068 | } | 1076 | } |
1069 | 1077 | ||
1070 | void CXferSocket::Destroy(BOOL success) | 1078 | void CXferSocket::Destroy(BOOL success) |
1071 | { | 1079 | { |
1072 | if(m_wndResolver){ | 1080 | if(m_wndResolver){ |
1073 | delete m_wndResolver; | 1081 | delete m_wndResolver; |
1074 | m_wndResolver=NULL; | 1082 | m_wndResolver=NULL; |
1075 | } | 1083 | } |
1076 | SetTry(); | 1084 | SetTry(); |
1077 | m_Daddy->m_bnw.StartSound( | 1085 | m_Daddy->m_bnw.StartSound( |
1078 | success | 1086 | success |
1079 | ? m_Daddy->m_bnwSuccess | 1087 | ? m_Daddy->m_bnwSuccess |
1080 | : m_Daddy->m_bnwAbort | 1088 | : m_Daddy->m_bnwAbort |
1081 | ); | 1089 | ); |
1082 | if(m_File.m_hFile!=CFile::hFileNull){ | 1090 | if(m_File.m_hFile!=CFile::hFileNull){ |
1083 | TRY{ | 1091 | TRY{ |
1084 | m_File.Close(); | 1092 | m_File.Close(); |
1085 | }CATCH(CFileException,e){ | 1093 | }CATCH(CFileException,e){ |
1086 | TRACE0("Error closing file\n"); | 1094 | TRACE0("Error closing file\n"); |
1087 | }END_CATCH | 1095 | }END_CATCH |
1088 | } | 1096 | } |
1089 | ASSERT(m_Daddy); | 1097 | ASSERT(m_Daddy); |
1090 | m_Daddy->KillTimer(m_hSocket); | 1098 | m_Daddy->KillTimer(m_hSocket); |
1091 | m_Daddy->m_Xfers.RemoveKey(m_hSocket); | 1099 | m_Daddy->m_Xfers.RemoveKey(m_hSocket); |
1092 | LV_FINDINFO lvf; | 1100 | LV_FINDINFO lvf; |
1093 | memset(&lvf,0,sizeof(lvf)); | 1101 | memset(&lvf,0,sizeof(lvf)); |
1094 | lvf.flags=LVFI_PARAM; | 1102 | lvf.flags=LVFI_PARAM; |
1095 | lvf.lParam=(LPARAM)this; | 1103 | lvf.lParam=(LPARAM)this; |
1096 | int i = m_Daddy->m_List.FindItem(&lvf); | 1104 | int i = m_Daddy->m_List.FindItem(&lvf); |
1097 | if(i>=0) | 1105 | if(i>=0) |
1098 | m_Daddy->m_List.DeleteItem(i); | 1106 | m_Daddy->m_List.DeleteItem(i); |
1099 | delete this; | 1107 | delete this; |
1100 | } | 1108 | } |
1101 | 1109 | ||
1102 | void CPumpKINDlg::LogLine(LPCTSTR str) | 1110 | void CPumpKINDlg::LogLine(LPCTSTR str) |
1103 | { | 1111 | { |
1104 | ASSERT(m_LogLength); | 1112 | ASSERT(m_LogLength); |
1105 | while(m_Log.GetCount()>m_LogLength && m_Log.GetCount()!=LB_ERR){ | 1113 | while(m_Log.GetCount()>m_LogLength && m_Log.GetCount()!=LB_ERR){ |
1106 | CTime *t = (CTime*)m_Log.GetItemData(0); | 1114 | CTime *t = (CTime*)m_Log.GetItemData(0); |
1107 | if(((DWORD)t)!=LB_ERR){ | 1115 | if(((DWORD)t)!=LB_ERR){ |
1108 | ASSERT(t); | 1116 | ASSERT(t); |
1109 | m_LogTimes.RemoveKey(t); | 1117 | m_LogTimes.RemoveKey(t); |
1110 | delete t; | 1118 | delete t; |
1111 | } | 1119 | } |
1112 | m_Log.DeleteString(0); | 1120 | m_Log.DeleteString(0); |
1113 | } | 1121 | } |
1114 | int i = m_Log.AddString(str); | 1122 | int i = m_Log.AddString(str); |
1115 | ASSERT(i!=LB_ERR); | 1123 | ASSERT(i!=LB_ERR); |
1116 | CTime *t = new CTime(CTime::GetCurrentTime()); | 1124 | CTime *t = new CTime(CTime::GetCurrentTime()); |
1117 | m_Log.SetItemData(i,(DWORD)(m_LogTimes[t]=t)); | 1125 | m_Log.SetItemData(i,(DWORD)(m_LogTimes[t]=t)); |
1118 | m_Log.SetCurSel(i); | 1126 | m_Log.SetCurSel(i); |
1119 | } | 1127 | } |
1120 | 1128 | ||
1121 | void CPumpKINDlg::LogLine(UINT msgID) | 1129 | void CPumpKINDlg::LogLine(UINT msgID) |
1122 | { | 1130 | { |
1123 | CString tmp; | 1131 | CString tmp; |
1124 | tmp.Format(msgID); | 1132 | tmp.Format(msgID); |
1125 | LogLine(tmp); | 1133 | LogLine(tmp); |
1126 | } | 1134 | } |
1127 | 1135 | ||
1128 | void CXferSocket::TurnSlashes(CString& fn,BOOL bBack) | 1136 | void CXferSocket::TurnSlashes(CString& fn,BOOL bBack) |
1129 | { | 1137 | { |
1130 | ints = fn.Find(bBack?'/':'\\'); | 1138 | ints = fn.Find(bBack?'/':'\\'); |
1131 | while(s>=0){ | 1139 | while(s>=0){ |
1132 | fn.SetAt(s,bBack?'\\':'/'); | 1140 | fn.SetAt(s,bBack?'\\':'/'); |
1133 | s = fn.Find(bBack?'/':'\\'); | 1141 | s = fn.Find(bBack?'/':'\\'); |
1134 | } | 1142 | } |
1135 | } | 1143 | } |
1136 | 1144 | ||
1137 | CString CXferSocket::ApplyRoot(LPCTSTR fileName) | 1145 | CString CXferSocket::ApplyRoot(LPCTSTR fileName) |
1138 | { | 1146 | { |
1139 | ASSERT(m_Daddy); | 1147 | ASSERT(m_Daddy); |
1140 | CString fn = fileName; | 1148 | CString fn = fileName; |
1141 | CString rv = m_Daddy->m_TFTPRoot; | 1149 | CString rv = m_Daddy->m_TFTPRoot; |
1142 | if(rv.IsEmpty()) | 1150 | if(rv.IsEmpty()) |
1143 | rv = "."; | 1151 | rv = "."; |
1144 | if(rv[rv.GetLength()-1]!='\\') | 1152 | if(rv[rv.GetLength()-1]!='\\') |
1145 | rv+="\\"; | 1153 | rv+="\\"; |
1146 | while((!fn.IsEmpty()) && fn[0]=='\\') | 1154 | while((!fn.IsEmpty()) && fn[0]=='\\') |
1147 | fn=fn.Mid(1); | 1155 | fn=fn.Mid(1); |
1148 | rv+=fn; | 1156 | rv+=fn; |
1149 | return rv; | 1157 | return rv; |
1150 | } | 1158 | } |
1151 | 1159 | ||
1152 | void CPumpKINDlg::OnOptions() | 1160 | void CPumpKINDlg::OnOptions() |
1153 | { | 1161 | { |
1154 | CPropertySheet cps(IDS_TITLE_OPTIONS,this); | 1162 | CPropertySheet cps(IDS_TITLE_OPTIONS,this); |
1155 | CPropsServer server; | 1163 | CPropsServer server; |
1156 | CPropsNetwork network; | 1164 | CPropsNetwork network; |
1157 | CPropsSounds sounds; | 1165 | CPropsSounds sounds; |
1158 | 1166 | ||
1159 | server.m_RRQMode=m_RRQMode; | 1167 | server.m_RRQMode=m_RRQMode; |
1160 | server.m_TFTPRoot=m_TFTPRoot; | 1168 | server.m_TFTPRoot=m_TFTPRoot; |
1161 | server.m_TFTPSubdirs=m_bTFTPSubdirs; | 1169 | server.m_TFTPSubdirs=m_bTFTPSubdirs; |
1162 | server.m_WRQMode=m_WRQMode; | 1170 | server.m_WRQMode=m_WRQMode; |
1163 | server.m_PromptTimeOut=m_PromptTimeOut; | 1171 | server.m_PromptTimeOut=m_PromptTimeOut; |
1164 | 1172 | ||
1165 | network.m_ListenPort=m_ListenPort; | 1173 | network.m_ListenPort=m_ListenPort; |
1166 | network.m_SpeakPort=m_SpeakPort; | 1174 | network.m_SpeakPort=m_SpeakPort; |
1167 | network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); | 1175 | network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); |
1168 | network.m_BlockSize=m_BlockSize; | 1176 | network.m_BlockSize=m_BlockSize; |
1169 | 1177 | ||
1170 | sounds.m_Request = m_bnwRequest; | 1178 | sounds.m_Request = m_bnwRequest; |
1171 | sounds.m_Success = m_bnwSuccess; | 1179 | sounds.m_Success = m_bnwSuccess; |
1172 | sounds.m_Abort = m_bnwAbort; | 1180 | sounds.m_Abort = m_bnwAbort; |
1173 | 1181 | ||
1174 | cps.AddPage(&server); | 1182 | cps.AddPage(&server); |
1175 | cps.AddPage(&network); | 1183 | cps.AddPage(&network); |
1176 | cps.AddPage(&sounds); | 1184 | cps.AddPage(&sounds); |
1177 | if(cps.DoModal()==IDOK){ | 1185 | if(cps.DoModal()==IDOK){ |
1178 | m_RRQMode=server.m_RRQMode; | 1186 | m_RRQMode=server.m_RRQMode; |
1179 | m_TFTPRoot=server.m_TFTPRoot; | 1187 | m_TFTPRoot=server.m_TFTPRoot; |
1180 | m_bTFTPSubdirs=server.m_TFTPSubdirs; | 1188 | m_bTFTPSubdirs=server.m_TFTPSubdirs; |
1181 | m_WRQMode=server.m_WRQMode; | 1189 | m_WRQMode=server.m_WRQMode; |
1182 | m_PromptTimeOut=server.m_PromptTimeOut; | 1190 | m_PromptTimeOut=server.m_PromptTimeOut; |
1183 | 1191 | ||
1184 | m_ListenPort=network.m_ListenPort; | 1192 | m_ListenPort=network.m_ListenPort; |
1185 | m_SpeakPort=network.m_SpeakPort; | 1193 | m_SpeakPort=network.m_SpeakPort; |
1186 | m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); | 1194 | m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); |
1187 | m_BlockSize=network.m_BlockSize; | 1195 | m_BlockSize=network.m_BlockSize; |
1188 | 1196 | ||
1189 | m_bnwRequest = sounds.m_Request; | 1197 | m_bnwRequest = sounds.m_Request; |
1190 | m_bnwSuccess = sounds.m_Success; | 1198 | m_bnwSuccess = sounds.m_Success; |
1191 | m_bnwAbort = sounds.m_Abort; | 1199 | m_bnwAbort = sounds.m_Abort; |
1192 | } | 1200 | } |
1193 | } | 1201 | } |
1194 | 1202 | ||
1195 | BOOL CRRQSocket::ConfirmRequest() | 1203 | BOOL CRRQSocket::ConfirmRequest() |
1196 | { | 1204 | { |
1197 | CConfirmRRQDlg cd(NULL); | 1205 | CConfirmRRQDlg cd(NULL); |
1198 | cd.m_Daddy=this; | 1206 | cd.m_Daddy=this; |
1199 | cd.m_File=m_FileName; | 1207 | cd.m_File=m_FileName; |
1200 | cd.m_Host=inet_ntoa(m_Peer.sin_addr); | 1208 | cd.m_Host=inet_ntoa(m_Peer.sin_addr); |
1201 | if(cd.DoModal()==IDOK) | 1209 | if(cd.DoModal()==IDOK) |
1202 | return TRUE; | 1210 | return TRUE; |
1203 | return FALSE; | 1211 | return FALSE; |
1204 | } | 1212 | } |
1205 | 1213 | ||
1206 | CWRQSocket::CWRQSocket(CPumpKINDlg* daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) | 1214 | CWRQSocket::CWRQSocket(CPumpKINDlg* daddy,LPCTSTR fileName,LPCTSTR type,SOCKADDR_IN *sin) |
1207 | : CXferSocket(daddy,fileName,type,sin) | 1215 | : CXferSocket(daddy,fileName,type,sin) |
1208 | { | 1216 | { |
1209 | state=stateNone; | 1217 | state=stateNone; |
1210 | m_ACK=0; | 1218 | m_ACK=0; |
1211 | m_LastSlack=0; | 1219 | m_LastSlack=0; |
1212 | m_bResume=FALSE; | 1220 | m_bResume=FALSE; |
1213 | } | 1221 | } |
1214 | 1222 | ||
1215 | BOOL CWRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) | 1223 | BOOL CWRQSocket::Create(LPCTSTR localFile,LPCTSTR hostName) |
1216 | { | 1224 | { |
1217 | if(!CAsyncSocket::Create(0,SOCK_DGRAM)) | 1225 | if(!CAsyncSocket::Create(0,SOCK_DGRAM)) |
1218 | return FALSE; | 1226 | return FALSE; |
@@ -306,302 +306,302 @@ BEGIN | |||
306 | VALUE "CompanyName", "Klever Group (http://www.klever.net/)\0" | 306 | VALUE "CompanyName", "Klever Group (http://www.klever.net/)\0" |
307 | VALUE "FileDescription", "PumpKIN, tftp client/daemon\0" | 307 | VALUE "FileDescription", "PumpKIN, tftp client/daemon\0" |
308 | VALUE "FileVersion", "2, 5, 1, 0\0" | 308 | VALUE "FileVersion", "2, 5, 1, 0\0" |
309 | VALUE "InternalName", "PUMPKIN\0" | 309 | VALUE "InternalName", "PUMPKIN\0" |
310 | VALUE "LegalCopyright", "Copyright © 1997-2004 Klever Group (http://www.klever.net)\0" | 310 | VALUE "LegalCopyright", "Copyright © 1997-2004 Klever Group (http://www.klever.net)\0" |
311 | VALUE "LegalTrademarks", "Klever Group (http://www.klever.net/)\0" | 311 | VALUE "LegalTrademarks", "Klever Group (http://www.klever.net/)\0" |
312 | VALUE "OriginalFilename", "PUMPKIN.EXE\0" | 312 | VALUE "OriginalFilename", "PUMPKIN.EXE\0" |
313 | VALUE "ProductName", "PumpKIN\0" | 313 | VALUE "ProductName", "PumpKIN\0" |
314 | VALUE "ProductVersion", "2, 5, 1, 0\0" | 314 | VALUE "ProductVersion", "2, 5, 1, 0\0" |
315 | END | 315 | END |
316 | END | 316 | END |
317 | BLOCK "VarFileInfo" | 317 | BLOCK "VarFileInfo" |
318 | BEGIN | 318 | BEGIN |
319 | VALUE "Translation", 0x409, 1200 | 319 | VALUE "Translation", 0x409, 1200 |
320 | END | 320 | END |
321 | END | 321 | END |
322 | 322 | ||
323 | #endif // !_MAC | 323 | #endif // !_MAC |
324 | 324 | ||
325 | 325 | ||
326 | ///////////////////////////////////////////////////////////////////////////// | 326 | ///////////////////////////////////////////////////////////////////////////// |
327 | // | 327 | // |
328 | // DESIGNINFO | 328 | // DESIGNINFO |
329 | // | 329 | // |
330 | 330 | ||
331 | #ifdef APSTUDIO_INVOKED | 331 | #ifdef APSTUDIO_INVOKED |
332 | GUIDELINES DESIGNINFO DISCARDABLE | 332 | GUIDELINES DESIGNINFO DISCARDABLE |
333 | BEGIN | 333 | BEGIN |
334 | IDD_ABOUTBOX, DIALOG | 334 | IDD_ABOUTBOX, DIALOG |
335 | BEGIN | 335 | BEGIN |
336 | LEFTMARGIN, 7 | 336 | LEFTMARGIN, 7 |
337 | RIGHTMARGIN, 210 | 337 | RIGHTMARGIN, 210 |
338 | TOPMARGIN, 7 | 338 | TOPMARGIN, 7 |
339 | BOTTOMMARGIN, 67 | 339 | BOTTOMMARGIN, 67 |
340 | END | 340 | END |
341 | 341 | ||
342 | IDD_PUMPKIN_DIALOG, DIALOG | 342 | IDD_PUMPKIN_DIALOG, DIALOG |
343 | BEGIN | 343 | BEGIN |
344 | LEFTMARGIN, 7 | 344 | LEFTMARGIN, 7 |
345 | RIGHTMARGIN, 355 | 345 | RIGHTMARGIN, 355 |
346 | TOPMARGIN, 7 | 346 | TOPMARGIN, 7 |
347 | BOTTOMMARGIN, 184 | 347 | BOTTOMMARGIN, 184 |
348 | HORZGUIDE, 115 | 348 | HORZGUIDE, 115 |
349 | END | 349 | END |
350 | 350 | ||
351 | IDD_PROPS_SERVER, DIALOG | 351 | IDD_PROPS_SERVER, DIALOG |
352 | BEGIN | 352 | BEGIN |
353 | LEFTMARGIN, 7 | 353 | LEFTMARGIN, 7 |
354 | RIGHTMARGIN, 203 | 354 | RIGHTMARGIN, 203 |
355 | TOPMARGIN, 7 | 355 | TOPMARGIN, 7 |
356 | BOTTOMMARGIN, 147 | 356 | BOTTOMMARGIN, 147 |
357 | END | 357 | END |
358 | 358 | ||
359 | IDD_PROPS_NETWORK, DIALOG | 359 | IDD_PROPS_NETWORK, DIALOG |
360 | BEGIN | 360 | BEGIN |
361 | LEFTMARGIN, 7 | 361 | LEFTMARGIN, 7 |
362 | RIGHTMARGIN, 203 | 362 | RIGHTMARGIN, 203 |
363 | TOPMARGIN, 7 | 363 | TOPMARGIN, 7 |
364 | BOTTOMMARGIN, 147 | 364 | BOTTOMMARGIN, 147 |
365 | END | 365 | END |
366 | 366 | ||
367 | IDD_CONFIRM_RRQ, DIALOG | 367 | IDD_CONFIRM_RRQ, DIALOG |
368 | BEGIN | 368 | BEGIN |
369 | LEFTMARGIN, 7 | 369 | LEFTMARGIN, 7 |
370 | RIGHTMARGIN, 174 | 370 | RIGHTMARGIN, 174 |
371 | TOPMARGIN, 7 | 371 | TOPMARGIN, 7 |
372 | BOTTOMMARGIN, 72 | 372 | BOTTOMMARGIN, 72 |
373 | END | 373 | END |
374 | 374 | ||
375 | IDD_CONFIRM_WRQ, DIALOG | 375 | IDD_CONFIRM_WRQ, DIALOG |
376 | BEGIN | 376 | BEGIN |
377 | LEFTMARGIN, 7 | 377 | LEFTMARGIN, 7 |
378 | RIGHTMARGIN, 194 | 378 | RIGHTMARGIN, 194 |
379 | TOPMARGIN, 7 | 379 | TOPMARGIN, 7 |
380 | BOTTOMMARGIN, 88 | 380 | BOTTOMMARGIN, 88 |
381 | END | 381 | END |
382 | 382 | ||
383 | IDD_REQUEST, DIALOG | 383 | IDD_REQUEST, DIALOG |
384 | BEGIN | 384 | BEGIN |
385 | LEFTMARGIN, 7 | 385 | LEFTMARGIN, 7 |
386 | RIGHTMARGIN, 184 | 386 | RIGHTMARGIN, 184 |
387 | TOPMARGIN, 7 | 387 | TOPMARGIN, 7 |
388 | BOTTOMMARGIN, 154 | 388 | BOTTOMMARGIN, 154 |
389 | END | 389 | END |
390 | 390 | ||
391 | IDD_PROPS_SOUNDS, DIALOG | 391 | IDD_PROPS_SOUNDS, DIALOG |
392 | BEGIN | 392 | BEGIN |
393 | LEFTMARGIN, 7 | 393 | LEFTMARGIN, 7 |
394 | RIGHTMARGIN, 203 | 394 | RIGHTMARGIN, 203 |
395 | TOPMARGIN, 7 | 395 | TOPMARGIN, 7 |
396 | BOTTOMMARGIN, 147 | 396 | BOTTOMMARGIN, 147 |
397 | END | 397 | END |
398 | END | 398 | END |
399 | #endif // APSTUDIO_INVOKED | 399 | #endif // APSTUDIO_INVOKED |
400 | 400 | ||
401 | 401 | ||
402 | ///////////////////////////////////////////////////////////////////////////// | 402 | ///////////////////////////////////////////////////////////////////////////// |
403 | // | 403 | // |
404 | // Bitmap | 404 | // Bitmap |
405 | // | 405 | // |
406 | 406 | ||
407 | IDB_BACKGROUND BITMAP DISCARDABLE "shared-data/klever-background.bmp" | 407 | IDB_BACKGROUND BITMAP DISCARDABLE "shared-data/klever-background.bmp" |
408 | 408 | ||
409 | ///////////////////////////////////////////////////////////////////////////// | 409 | ///////////////////////////////////////////////////////////////////////////// |
410 | // | 410 | // |
411 | // WAVE | 411 | // WAVE |
412 | // | 412 | // |
413 | 413 | ||
414 | IDR_WAVE_RING WAVE DISCARDABLE "res\\ring.wav" | 414 | IDR_WAVE_RING WAVE DISCARDABLE "res\\ring.wav" |
415 | IDR_WAVE_FINISHED WAVE DISCARDABLE "res\\finished.wav" | 415 | IDR_WAVE_FINISHED WAVE DISCARDABLE "res\\finished.wav" |
416 | IDR_WAVE_ABORTED WAVE DISCARDABLE "res\\failed.wav" | 416 | IDR_WAVE_ABORTED WAVE DISCARDABLE "res\\failed.wav" |
417 | 417 | ||
418 | ///////////////////////////////////////////////////////////////////////////// | 418 | ///////////////////////////////////////////////////////////////////////////// |
419 | // | 419 | // |
420 | // Dialog Info | 420 | // Dialog Info |
421 | // | 421 | // |
422 | 422 | ||
423 | IDD_REQUEST DLGINIT | 423 | IDD_REQUEST DLGINIT |
424 | BEGIN | 424 | BEGIN |
425 | IDC_TYPE, 0x403, 6, 0 | 425 | IDC_TYPE, 0x403, 6, 0 |
426 | 0x636f, 0x6574, 0x0074, | 426 | 0x636f, 0x6574, 0x0074, |
427 | IDC_TYPE, 0x403, 9, 0 | 427 | IDC_TYPE, 0x403, 9, 0 |
428 | 0x656e, 0x6174, 0x6373, 0x6969, "\000" | 428 | 0x656e, 0x6174, 0x6373, 0x6969, "\000" |
429 | IDC_BSIZE, 0x403, 4, 0 | 429 | IDC_BSIZE, 0x403, 4, 0 |
430 | 0x3135, 0x0032, | 430 | 0x3135, 0x0032, |
431 | IDC_BSIZE, 0x403, 5, 0 | 431 | IDC_BSIZE, 0x403, 5, 0 |
432 | 0x3031, 0x3432, "\000" | 432 | 0x3031, 0x3432, "\000" |
433 | IDC_BSIZE, 0x403, 5, 0 | 433 | IDC_BSIZE, 0x403, 5, 0 |
434 | 0x3032, 0x3834, "\000" | 434 | 0x3032, 0x3834, "\000" |
435 | IDC_BSIZE, 0x403, 5, 0 | 435 | IDC_BSIZE, 0x403, 5, 0 |
436 | 0x3034, 0x3639, "\000" | 436 | 0x3034, 0x3639, "\000" |
437 | IDC_BSIZE, 0x403, 5, 0 | 437 | IDC_BSIZE, 0x403, 5, 0 |
438 | 0x3138, 0x3239, "\000" | 438 | 0x3138, 0x3239, "\000" |
439 | 0 | 439 | 0 |
440 | END | 440 | END |
441 | 441 | ||
442 | 442 | ||
443 | ///////////////////////////////////////////////////////////////////////////// | 443 | ///////////////////////////////////////////////////////////////////////////// |
444 | // | 444 | // |
445 | // Menu | 445 | // Menu |
446 | // | 446 | // |
447 | 447 | ||
448 | IDM_POPUPS MENU DISCARDABLE | 448 | IDM_POPUPS MENU DISCARDABLE |
449 | BEGIN | 449 | BEGIN |
450 | POPUP "&Tray" | 450 | POPUP "&Tray" |
451 | BEGIN | 451 | BEGIN |
452 | MENUITEM "&Send File", ID_TRAY_SENDFILE | 452 | MENUITEM "&Send File", ID_TRAY_SENDFILE |
453 | MENUITEM "F&etch file", ID_TRAY_FETCHFILE | 453 | MENUITEM "F&etch file", ID_TRAY_FETCHFILE |
454 | MENUITEM "&Options", ID_TRAY_OPTIONS | 454 | MENUITEM "&Options", ID_TRAY_OPTIONS |
455 | MENUITEM "Show &PumpKIN Window", ID_TRAY_SHOWPUMPKINWINDOW | 455 | MENUITEM "Show &PumpKIN Window", ID_TRAY_SHOWPUMPKINWINDOW |
456 | MENUITEM "Open &Files Folder", ID_TRAY_OPENFILESFOLDER | 456 | MENUITEM "Open &Files Folder", ID_TRAY_OPENFILESFOLDER |
457 | MENUITEM SEPARATOR | 457 | MENUITEM SEPARATOR |
458 | MENUITEM "&Help Topics", ID_TRAY_HELP | 458 | MENUITEM "&Help Topics", ID_TRAY_HELP |
459 | MENUITEM "&About PumpKIN", ID_TRAY_ABOUTPUMPKIN | 459 | MENUITEM "&About PumpKIN", ID_TRAY_ABOUTPUMPKIN |
460 | MENUITEM SEPARATOR | 460 | MENUITEM SEPARATOR |
461 | MENUITEM "E&xit", ID_TRAY_EXIT | 461 | MENUITEM "E&xit", ID_TRAY_EXIT |
462 | END | 462 | END |
463 | END | 463 | END |
464 | 464 | ||
465 | 465 | ||
466 | ///////////////////////////////////////////////////////////////////////////// | 466 | ///////////////////////////////////////////////////////////////////////////// |
467 | // | 467 | // |
468 | // String Table | 468 | // String Table |
469 | // | 469 | // |
470 | 470 | ||
471 | STRINGTABLE DISCARDABLE | 471 | STRINGTABLE DISCARDABLE |
472 | BEGIN | 472 | BEGIN |
473 | IDS_ABOUTBOX "&About PumpKIN..." | 473 | IDS_ABOUTBOX "&About PumpKIN..." |
474 | IDS_FMT_BYTES "%lu" | 474 | IDS_FMT_BYTES "%lu" |
475 | IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." | 475 | IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed." |
476 | IDS_TFTP_ERROR_ACCESS "Access violation" | 476 | IDS_TFTP_ERROR_ACCESS "Access violation" |
477 | IDS_TFTP_ERROR_NOTFOUND "File not found" | 477 | IDS_TFTP_ERROR_NOTFOUND "File not found" |
478 | IDS_TFTP_ERROR_DIRFULL "Directory is full" | 478 | IDS_TFTP_ERROR_DIRFULL "Directory is full" |
479 | IDS_TFTP_ERROR_SHARING "Sharing violation" | 479 | IDS_TFTP_ERROR_SHARING "Sharing violation" |
480 | IDS_TFTP_ERROR_DISKFULL "Disk full" | 480 | IDS_TFTP_ERROR_DISKFULL "Disk full" |
481 | IDS_TFTP_ERROR_UNDEFINED "Undefined error" | 481 | IDS_TFTP_ERROR_UNDEFINED "Undefined error" |
482 | IDS_LOG_START "PumpKIN started" | 482 | IDS_LOG_START "PumpKIN started" |
483 | IDS_LOG_LISTENRECEIVEERROR "Error listening for incoming connections" | 483 | IDS_LOG_LISTENRECEIVEERROR "Error listening for incoming connections" |
484 | END | 484 | END |
485 | 485 | ||
486 | STRINGTABLE DISCARDABLE | 486 | STRINGTABLE DISCARDABLE |
487 | BEGIN | 487 | BEGIN |
488 | IDS_LOG_LISTENACCEPTERROR "Error accepting incoming connection" | 488 | IDS_LOG_LISTENACCEPTERROR "Error accepting incoming connection" |
489 | IDS_LOG_RRQSERVE "'%s' of type '%s' is requested from %s" | 489 | IDS_LOG_RRQSERVE "'%s' of type '%s' is requested from %s" |
490 | IDS_LOG_LISTENOPCODE "Invalid opcode in initial connection request" | 490 | IDS_LOG_LISTENOPCODE "Invalid opcode in initial connection request" |
491 | IDS_LOG_XFERUDPSEND "UDP packet send failed" | 491 | IDS_LOG_XFERUDPSEND "UDP packet send failed" |
492 | IDS_LOG_XFERRECEIVE "Error on xfer socket" | 492 | IDS_LOG_XFERRECEIVE "Error on xfer socket" |
493 | IDS_LOG_XFERSEND "Error on xfer socket" | 493 | IDS_LOG_XFERSEND "Error on xfer socket" |
494 | IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed" | 494 | IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed" |
495 | IDS_LOG_XFERSOURCETID "Packet from unexpected source" | 495 | IDS_LOG_XFERSOURCETID "Packet from unexpected source" |
496 | IDS_LOG_SENTTFTPERROR ":%u: %s" | 496 | IDS_LOG_SENTTFTPERROR ":%u: %s" |
497 | IDS_LOG_GOTTFTPERROR "TFTP:%u: %s" | 497 | IDS_LOG_GOTTFTPERROR "TFTP:%u: %s" |
498 | IDS_LOG_XFEROPCODE "Invalid opcode during transfer received" | 498 | IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received" |
499 | IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed" | 499 | IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed" |
500 | IDS_TITLE_OPTIONS "Options" | 500 | IDS_TITLE_OPTIONS "Options" |
501 | IDS_LOG_WRQSERVE "Writing of '%s' of type '%s' is requested by %s" | 501 | IDS_LOG_WRQSERVE "Writing of '%s' of type '%s' is requested by %s" |
502 | IDS_TFTP_ERROR_FAILEDTORENAME "Too many clones of the file" | 502 | IDS_TFTP_ERROR_FAILEDTORENAME "Too many clones of the file" |
503 | IDS_RENAME_TITLE "Save As" | 503 | IDS_RENAME_TITLE "Save As" |
504 | END | 504 | END |
505 | 505 | ||
506 | STRINGTABLE DISCARDABLE | 506 | STRINGTABLE DISCARDABLE |
507 | BEGIN | 507 | BEGIN |
508 | IDS_LOG_TIMEDOUT "Transmission of '%s' is timed out" | 508 | IDS_LOG_TIMEDOUT "Transmission of '%s' is timed out" |
509 | IDS_CONFIRMEXIT_TITLE "Exit" | 509 | IDS_CONFIRMEXIT_TITLE "Exit" |
510 | IDS_CONFIRMEXIT_TEXT "File transmission is currently in progress. Are you sure you want to exit?" | 510 | IDS_CONFIRMEXIT_TEXT "File transmission is currently in progress. Are you sure you want to exit?" |
511 | IDS_LOG_XFERWRQFINISHED "Transfer of '%s' has successfully completed" | 511 | IDS_LOG_XFERWRQFINISHED "Transfer of '%s' has successfully completed" |
512 | IDS_LOG_XFERABORTED "Transfer of '%s' was aborted" | 512 | IDS_LOG_XFERABORTED "Transfer of '%s' was aborted" |
513 | IDS_TITLE_PUTREQUEST "Send file" | 513 | IDS_TITLE_PUTREQUEST "Send file" |
514 | IDS_TITLE_GETREQUEST "Fetch file" | 514 | IDS_TITLE_GETREQUEST "Fetch file" |
515 | IDS_WTALKHEADING "Talk with " | 515 | IDS_WTALKHEADING "Talk with " |
516 | IDS_TITLE_BROWSEFILE "Browse" | 516 | IDS_TITLE_BROWSEFILE "Browse" |
517 | IDS_LOG_RESOLVEFAILED "Failed to resolve host address for '%s'" | 517 | IDS_LOG_RESOLVEFAILED "Failed to resolve host address for '%s'" |
518 | IDS_LOG_FAILEDLOCALFILE "Failed to open local file '%s'" | 518 | IDS_LOG_FAILEDLOCALFILE "Failed to open local file '%s'" |
519 | IDS_LOG_FAILEDTOOPEN "Failed to open '%s'" | 519 | IDS_LOG_FAILEDTOOPEN "Failed to open '%s'" |
520 | IDS_OTALXHEADING "Open Talks: talking to " | 520 | IDS_OTALXHEADING "Open Talks: talking to " |
521 | IDS_REGISTRYKEY "Klever Group" | 521 | IDS_REGISTRYKEY "Klever Group" |
522 | IDS_KLEVERNET_URL "http://www.klever.net/" | 522 | IDS_KLEVERNET_URL "http://www.klever.net/" |
523 | IDS_LOGTIMEFORMAT "%H:%M:%S %B %d" | 523 | IDS_LOGTIMEFORMAT "%H:%M:%S %B %d" |
524 | END | 524 | END |
525 | 525 | ||
526 | STRINGTABLE DISCARDABLE | 526 | STRINGTABLE DISCARDABLE |
527 | BEGIN | 527 | BEGIN |
528 | ID_TRAY_HELP "Read the help on PumpKIN" | 528 | ID_TRAY_HELP "Read the help on PumpKIN" |
529 | ID_TRAY_ABOUTPUMPKIN "Learn about PumpKIN and it's creator" | 529 | ID_TRAY_ABOUTPUMPKIN "Learn about PumpKIN and it's creator" |
530 | ID_TRAY_EXIT "Close PumpKIN" | 530 | ID_TRAY_EXIT "Close PumpKIN" |
531 | ID_TRAY_SENDFILE "Send file over the network to your tete-a-tete" | 531 | ID_TRAY_SENDFILE "Send file over the network to your tete-a-tete" |
532 | ID_TRAY_FETCHFILE "Fetch file from remote computer" | 532 | ID_TRAY_FETCHFILE "Fetch file from remote computer" |
533 | ID_TRAY_OPTIONS "Set PumpKIN options" | 533 | ID_TRAY_OPTIONS "Set PumpKIN options" |
534 | ID_TRAY_SHOWPUMPKINWINDOW "Show main window" | 534 | ID_TRAY_SHOWPUMPKINWINDOW "Show main window" |
535 | ID_TRAY_OPENFILESFOLDER "Explore TFTP root folder" | 535 | ID_TRAY_OPENFILESFOLDER "Explore TFTP root folder" |
536 | END | 536 | END |
537 | 537 | ||
538 | STRINGTABLE DISCARDABLE | 538 | STRINGTABLE DISCARDABLE |
539 | BEGIN | 539 | BEGIN |
540 | IDC_CONNECTIONS "Active transfers" | 540 | IDC_CONNECTIONS "Active transfers" |
541 | IDC_LOG "PumpKIN Activity Log" | 541 | IDC_LOG "PumpKIN Activity Log" |
542 | IDC_GET "Fetch file from remote server" | 542 | IDC_GET "Fetch file from remote server" |
543 | IDC_PUT "Send file over the net" | 543 | IDC_PUT "Send file over the net" |
544 | IDC_ABORT "Abort transfer currently in progress" | 544 | IDC_ABORT "Abort transfer currently in progress" |
545 | IDC_EXIT "Close PumpKIN" | 545 | IDC_EXIT "Close PumpKIN" |
546 | END | 546 | END |
547 | 547 | ||
548 | STRINGTABLE DISCARDABLE | 548 | STRINGTABLE DISCARDABLE |
549 | BEGIN | 549 | BEGIN |
550 | IDC_OPTIONS "Set PumpKIN options" | 550 | IDC_OPTIONS "Set PumpKIN options" |
551 | IDC_REFRESH "Refresh talks list" | 551 | IDC_REFRESH "Refresh talks list" |
552 | IDC_BROWSE "Browse" | 552 | IDC_BROWSE "Browse" |
553 | END | 553 | END |
554 | 554 | ||
555 | STRINGTABLE DISCARDABLE | 555 | STRINGTABLE DISCARDABLE |
556 | BEGIN | 556 | BEGIN |
557 | ID_HELP "Read help on PumpKIN" | 557 | ID_HELP "Read help on PumpKIN" |
558 | END | 558 | END |
559 | 559 | ||
560 | STRINGTABLE DISCARDABLE | 560 | STRINGTABLE DISCARDABLE |
561 | BEGIN | 561 | BEGIN |
562 | IDS_DROPFILES_TITLE "Drop Files" | 562 | IDS_DROPFILES_TITLE "Drop Files" |
563 | IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" | 563 | IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" |
564 | IDS_LOG_REQUESTING "Requesting '%s' from '%s'" | 564 | IDS_LOG_REQUESTING "Requesting '%s' from '%s'" |
565 | IDS_LOG_SENDING "Sending '%s' to '%s'" | 565 | IDS_LOG_SENDING "Sending '%s' to '%s'" |
566 | IDS_WTALKAT "@" | 566 | IDS_WTALKAT "@" |
567 | IDS_OTALXAT " at " | 567 | IDS_OTALXAT " at " |
568 | IDS_TFTP_ERROR_TSIZE "Invalid transfer size" | 568 | IDS_TFTP_ERROR_TSIZE "Invalid transfer size" |
569 | IDS_TFTP_ERROR_BSIZE "Invalid block size" | 569 | IDS_TFTP_ERROR_BSIZE "Invalid block size" |
570 | IDS_TFTP_ERROR_TOUT "Invalid timeout" | 570 | IDS_TFTP_ERROR_TOUT "Invalid timeout" |
571 | IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." | 571 | IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." |
572 | IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" | 572 | IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" |
573 | IDS_TITLE_WAV "Select sound.." | 573 | IDS_TITLE_WAV "Select sound.." |
574 | IDS_BOX_CANTBIND "Failed to create listening socket. The port may be in use by another application." | 574 | IDS_BOX_CANTBIND "Failed to create listening socket. The port may be in use by another application." |
575 | END | 575 | END |
576 | 576 | ||
577 | STRINGTABLE DISCARDABLE | 577 | STRINGTABLE DISCARDABLE |
578 | BEGIN | 578 | BEGIN |
579 | AFX_IDS_APP_TITLE "PUMPKIN" | 579 | AFX_IDS_APP_TITLE "PUMPKIN" |
580 | END | 580 | END |
581 | 581 | ||
582 | #endif // English (U.S.) resources | 582 | #endif // English (U.S.) resources |
583 | ///////////////////////////////////////////////////////////////////////////// | 583 | ///////////////////////////////////////////////////////////////////////////// |
584 | 584 | ||
585 | 585 | ||
586 | 586 | ||
587 | #ifndef APSTUDIO_INVOKED | 587 | #ifndef APSTUDIO_INVOKED |
588 | ///////////////////////////////////////////////////////////////////////////// | 588 | ///////////////////////////////////////////////////////////////////////////// |
589 | // | 589 | // |
590 | // Generated from the TEXTINCLUDE 3 resource. | 590 | // Generated from the TEXTINCLUDE 3 resource. |
591 | // | 591 | // |
592 | #define _AFX_NO_SPLITTER_RESOURCES | 592 | #define _AFX_NO_SPLITTER_RESOURCES |
593 | #define _AFX_NO_OLE_RESOURCES | 593 | #define _AFX_NO_OLE_RESOURCES |
594 | #define _AFX_NO_TRACKER_RESOURCES | 594 | #define _AFX_NO_TRACKER_RESOURCES |
595 | #define _AFX_NO_PROPERTY_RESOURCES | 595 | #define _AFX_NO_PROPERTY_RESOURCES |
596 | 596 | ||
597 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) | 597 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
598 | #ifdef _WIN32 | 598 | #ifdef _WIN32 |
599 | LANGUAGE 9, 1 | 599 | LANGUAGE 9, 1 |
600 | #pragma code_page(1252) | 600 | #pragma code_page(1252) |
601 | #endif | 601 | #endif |
602 | #include "res\PumpKIN.rc2" // non-Microsoft Visual C++ edited resources | 602 | #include "res\PumpKIN.rc2" // non-Microsoft Visual C++ edited resources |
603 | #include "afxres.rc" // Standard components | 603 | #include "afxres.rc" // Standard components |
604 | #endif | 604 | #endif |
605 | ///////////////////////////////////////////////////////////////////////////// | 605 | ///////////////////////////////////////////////////////////////////////////// |
606 | #endif // not APSTUDIO_INVOKED | 606 | #endif // not APSTUDIO_INVOKED |
607 | 607 | ||