diff -r mbuffer-20010702/CHANGES mbuffer-20010703/CHANGES 0a1,7 > 20010703: > - update for debug messages > - update for experimental network code > (interface selection is now possible, > hostnames are resolved correctly and more; > seems like getting stable...) > diff -r mbuffer-20010702/README mbuffer-20010703/README 52,53c52 < on a trusted LAN, as there is no builtin security < up to now. --- > on a trusted LAN, as there is no builtin security. diff -r mbuffer-20010702/configure mbuffer-20010703/configure 646a647 > VERSION=20010703 648d648 < VERSION=20010702 1916,1918c1916,1918 < echo $ac_n "checking for library containing inet_pton""... $ac_c" 1>&6 < echo "configure:1918: checking for library containing inet_pton" >&5 < if eval "test \"`echo '$''{'ac_cv_search_inet_pton'+set}'`\" = set"; then --- > echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6 > echo "configure:1918: checking for library containing gethostbyname" >&5 > if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then 1922c1922 < ac_cv_search_inet_pton="no" --- > ac_cv_search_gethostbyname="no" 1929c1929 < char inet_pton(); --- > char gethostbyname(); 1932c1932 < inet_pton() --- > gethostbyname() 1937c1937 < ac_cv_search_inet_pton="none required" --- > ac_cv_search_gethostbyname="none required" 1943c1943 < test "$ac_cv_search_inet_pton" = "no" && for i in nsl; do --- > test "$ac_cv_search_gethostbyname" = "no" && for i in nsl; do 1951c1951 < char inet_pton(); --- > char gethostbyname(); 1954c1954 < inet_pton() --- > gethostbyname() 1959c1959 < ac_cv_search_inet_pton="-l$i" --- > ac_cv_search_gethostbyname="-l$i" 1970,1972c1970,1972 < echo "$ac_t""$ac_cv_search_inet_pton" 1>&6 < if test "$ac_cv_search_inet_pton" != "no"; then < test "$ac_cv_search_inet_pton" = "none required" || LIBS="$ac_cv_search_inet_pton $LIBS" --- > echo "$ac_t""$ac_cv_search_gethostbyname" 1>&6 > if test "$ac_cv_search_gethostbyname" != "no"; then > test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS" diff -r mbuffer-20010702/configure.in mbuffer-20010703/configure.in 10a11 > VERSION=20010703 12d12 < VERSION=20010702 77c77 < AC_SEARCH_LIBS(inet_pton,nsl,, --- > AC_SEARCH_LIBS(gethostbyname,nsl,, diff -r mbuffer-20010702/mbuffer.c mbuffer-20010703/mbuffer.c 9a10 > #include 20a22 > #include 137a140 > break; 140a144 > break; 222d225 < debugmsg("inputThread: read %i\n",num); 223a227 > debugmsg("inputThread: read(In, Buffer[%i] + %i, %Lu) = %i\n", at, num, Blocksize - num, err); 280c284,285 < fprintf(Terminal,"\nvolume full - insert new media and press return whe ready...\n"); --- > fprintf(Terminal,"\nWARNING: multivolume is known to be buggy in some situations...\n" > "volume full - insert new media and press return whe ready...\n"); 339c344 < debugmsg("outputThread: write(Out,Buffer[%i]+%i,%i) = %i\t(rest = %i)\n",at,Blocksize - rest,rest > Outsize ? Outsize : rest, err, rest); --- > debugmsg("outputThread: write(Out, Buffer[%i] + %i, %i) = %i\t(rest = %i)\n", at, Blocksize - rest, rest > Outsize ? Outsize : rest, err, rest); 376c381 < void openNetworkInput(unsigned short port) --- > void openNetworkInput(const char *host, unsigned short port) 378a384 > #ifdef socklen_t 379a386,389 > #else > size_t clen; > #endif > struct hostent *h = 0; 380a391 > debugmsg("openNetworkInput(%s,%hu)\n",host,port); 384,387c395,406 < fatal("could not crate socket for network input: %s\n",strerror(errno)); < bzero(&saddr, sizeof(saddr)); < saddr.sin_family = AF_INET; < saddr.sin_addr.s_addr = htonl(INADDR_ANY); --- > fatal("could not create socket for network input: %s\n",strerror(errno)); > bzero((void *) &saddr, sizeof(saddr)); > if (host) { > debugmsg("resolving client hostname...\n"); > if (0 == (h = gethostbyname(host))) > fatal("could not resolve server hostname!\n"); /* here should be a h_errno printout */ > saddr.sin_family = h->h_addrtype; > memcpy(&saddr.sin_addr,h->h_addr_list[0],h->h_length); > } else { > saddr.sin_family = AF_INET; > saddr.sin_addr.s_addr = htonl(INADDR_ANY); > } 403a423 > struct hostent *h = 0; 404a425 > debugmsg("openNetworkOutput(%s,%hu)\n",host,port); 408,410c429,430 < fatal("could not crate socket for network output: %s\n",strerror(errno)); < bzero(&saddr, sizeof(saddr)); < saddr.sin_family = AF_INET; --- > fatal("could not create socket for network output: %s\n",strerror(errno)); > bzero((void *) &saddr, sizeof(saddr)); 413,414c433,436 < if (0 > inet_pton(AF_INET, host, &saddr.sin_addr)) < fatal("could not resolve server hostname: %s\n",strerror(errno)); --- > if (0 == (h = gethostbyname(host))) > fatal("could not resolve server hostname!"); /* here should be a h_errno printout */ > saddr.sin_family = h->h_addrtype; > memcpy(&saddr.sin_addr,h->h_addr_list[0],h->h_length); 431a454,457 > if (0 != (*port = atoi(argv[*c]))) { > (*c)++; > return; > } 535c561 < const char *server = 0; --- > const char *server = 0, *client = 0; 576,577c602,603 < netPortIn = (atoi(argv[c])) ? (atoi(argv[c])): 0; < debugmsg("Network input set to port %hu\n",netPortIn); --- > getNetVars(argv,&c,&client,&netPortIn); > debugmsg("Network input set to %s:%hu\n",client,netPortIn); 632c658 < if ((totalmem / Blocksize) >= (1 << 31)) --- > if ((totalmem / Blocksize) >= (1LL << 31)) 634c660 < "Try a bigger blocksize!\n",1 << 31); --- > "Try a bigger blocksize!\n",1LL << 31); 643,644c669,674 < fatal("Setting both network input port and input file doesn't make sense!"); < if ((netPortOut == 0) ^ (server == 0)) --- > fatal("Setting both network input port and input file doesn't make sense!\n"); > if (Outfile && netPortOut) > fatal("Setting both network output and output file doesn't make sense!\n"); > if ((0 != client) && (0 == netPortIn)) > fatal("You need to set a network port for network input!\n"); > if ((0 == netPortOut) ^ (0 == server)) 705c735 < openNetworkInput(netPortIn); --- > openNetworkInput(client,netPortIn);