Changeset 9afeefa
- Timestamp:
- 2008-07-22T12:36:56Z (16 years ago)
- Branches:
- master
- Children:
- 8a90001
- Parents:
- 3355a82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dcc.c
r3355a82 r9afeefa 628 628 { 629 629 char *pattern = "SEND" 630 " (([^\"][^ ]*)|\"( [^\"]|\\\")*\")"630 " (([^\"][^ ]*)|\"(([^\"]|\\\")*)\")" 631 631 " (([0-9]*)|([^ ]*))" 632 632 " ([0-9]*)" 633 633 " ([0-9]*)\001"; 634 regmatch_t pmatch[ 9];634 regmatch_t pmatch[10]; 635 635 regex_t re; 636 636 file_transfer_t *ft; … … 640 640 641 641 if( ( regerrcode = regcomp( &re, pattern, REG_EXTENDED ) ) || 642 ( regerrcode = regexec( &re, line, 9, pmatch, 0 ) ) ) {642 ( regerrcode = regexec( &re, line, 10, pmatch, 0 ) ) ) { 643 643 regerror( regerrcode,&re,errbuf,sizeof( errbuf ) ); 644 644 imcb_log( ic, … … 649 649 650 650 if( ( pmatch[1].rm_so > 0 ) && 651 ( pmatch[ 4].rm_so > 0 ) &&652 ( pmatch[ 7].rm_so > 0 ) &&653 ( pmatch[ 8].rm_so > 0 ) )651 ( pmatch[5].rm_so > 0 ) && 652 ( pmatch[8].rm_so > 0 ) && 653 ( pmatch[9].rm_so > 0 ) ) 654 654 { 655 655 char *input = g_strdup( line ); … … 669 669 } 670 670 671 input[pmatch[ 4].rm_eo] = '\0';671 input[pmatch[5].rm_eo] = '\0'; 672 672 673 673 /* number means ipv4, something else means ipv6 */ 674 if ( pmatch[ 5].rm_so > 0 )674 if ( pmatch[6].rm_so > 0 ) 675 675 { 676 676 struct in_addr ipaddr = { .s_addr = htonl( atoi( input + pmatch[5].rm_so ) ) }; … … 679 679 { 680 680 /* Contains non-numbers, hopefully an IPV6 address */ 681 host = input + pmatch[ 6].rm_so;681 host = input + pmatch[7].rm_so; 682 682 } 683 683 684 input[pmatch[7].rm_eo] = '\0';685 684 input[pmatch[8].rm_eo] = '\0'; 686 687 port = input + pmatch[7].rm_so; 688 filesize = atoll( input + pmatch[8].rm_so ); 685 input[pmatch[9].rm_eo] = '\0'; 686 687 port = input + pmatch[8].rm_so; 688 filesize = atoll( input + pmatch[9].rm_so ); 689 689 690 690 memset( &hints, 0, sizeof ( struct addrinfo ) );
Note: See TracChangeset
for help on using the changeset viewer.