Revision 59e008ed chunker_player/chunker_player.c

View differences:

chunker_player/chunker_player.c
48 48
    return -1;
49 49
}
50 50

  
51
void CheckForRepoAddress(char* Param)
51
int CheckForRepoAddress(char* Param)
52 52
{
53
	int result = 0;
54
/*
53 55
    char* pch;
54 56
    if(strncasecmp(Param,"repo_address=",13)==0)
55 57
    {
56 58
        pch=strtok(Param+13,",");
57 59
        strncpy(RepoAddress,pch,2048);
58 60
    }
61
*/
62
//strcpy(RepoAddress,"repo-wut.napa-wine.eu:9832");
63
strcpy(RepoAddress,"repository.disi.unitn.it:9832");
64
result = 1;
65

  
66
	return result;
59 67
}
60 68

  
61 69
void sigproc()
......
94 102
	repoclient=NULL;
95 103
	LastTimeRepoPublish.tv_sec=0;
96 104
	LastTimeRepoPublish.tv_usec=0;
105
	eventbase = event_base_new();
97 106
	napaInitLog(LOG_DEBUG, NULL, NULL);
98 107
	repInit("");
99 108
#endif
......
397 406
	if(ScheduledChunkLosses)
398 407
		free(ScheduledChunkLosses);
399 408
#endif
409

  
410
#ifdef PSNR_PUBLICATION
411
	repClose(repoclient);
412
	event_base_free(eventbase);
413
#endif
400 414
	return 0;
401 415
}
402 416

  
......
591 605
		// printf ("\tpch=%s\n",pch);
592 606
		parameters_vector[par_count] = (char*) malloc(sizeof(char)*(strlen(pch)+1));
593 607
		strcpy(parameters_vector[par_count], pch);
594
		// Find repo_address
595
		CheckForRepoAddress(parameters_vector[par_count]);
596 608
		pch = strtok (NULL, " ");
597 609
		par_count++;
598 610
	}
......
678 690
	}
679 691
#endif
680 692

  
681
	for(i=1; i<par_count; i++)
682
		free(parameters_vector[i]);
683

  
684 693
#ifdef PSNR_PUBLICATION
694
	// Find repo_address
695
	if(CheckForRepoAddress(parameters_vector[par_count])) {
696

  
685 697
	// Open Repository
686 698
	if(repoclient)
687 699
		repClose(repoclient);
......
689 701

  
690 702
	repoclient = repOpen(RepoAddress,0);
691 703
	if (repoclient == NULL)
692
		fatal("Unable to initialize PSNR publication in repoclient %s", RepoAddress);
704
		printf("Unable to initialize PSNR publication in repoclient %s\n", RepoAddress);
705
	}
706
	else {
707
		printf("Repository address not present in streames launch string. Publication disabled\n");
708
	}
693 709
#endif
694 710

  
711
	for(i=1; i<par_count; i++)
712
		free(parameters_vector[i]);
713

  
695 714
	// Read the Network ID
696 715
	int Error=true;
697 716
	char Line1[255], Line2[255];

Also available in: Unified diff