*** misc.c.old Tue Jan 28 22:23:18 1997 --- misc.c Tue Jan 28 22:22:59 1997 *************** *** 317,322 **** --- 317,324 ---- */ int freecmdarr( char ** arr, const int * argcount ) { + char ** parr = arr; + #ifdef DEBUG xdebuglog("freecmdarr"); #endif *************** *** 328,334 **** free(*arr); arr++; } ! free(arr); return 1; } --- 330,336 ---- free(*arr); arr++; } ! free(parr); return 1; } *** csaczech.c.old Tue Jan 28 22:24:34 1997 --- csaczech.c Tue Jan 28 22:29:13 1997 *************** *** 2088,2093 **** --- 2088,2095 ---- printf( "If-Modified-Since header is handled correctly.
\n"); printf("Whichcode link in BAR is written correctly.
\n"); printf("Animated GIFs are handled correctly.
\n"); + printf("Dealocating command parts is done rigth.
\n"); + printf("Mapping hostname to IP address is done correctly.
\n"); } /* csacek_report */ #endif *** unix.h.old Tue Jan 28 22:27:50 1997 --- unix.h Tue Jan 28 22:27:57 1997 *************** *** 54,58 **** #include #include ! int connect_server( const char * server, const int port ); #endif --- 54,58 ---- #include #include ! int connect_server( char *, const int); #endif *** unix.c.old Tue Jan 28 22:26:58 1997 --- unix.c Tue Jan 28 22:27:15 1997 *************** *** 53,61 **** #define DUMMY_PORT 12567 /* vytvori socket a spojeni se serverem */ ! int connect_server( const char *address, const int port ) { int s1,e, isnumber = 0, dummy_port = DUMMY_PORT; struct sockaddr_in a,a1; struct hostent * hp = NULL; --- 53,62 ---- #define DUMMY_PORT 12567 /* vytvori socket a spojeni se serverem */ ! int connect_server( char *serveraddr, const int port ) { int s1,e, isnumber = 0, dummy_port = DUMMY_PORT; + char * address = serveraddr; struct sockaddr_in a,a1; struct hostent * hp = NULL; *************** *** 93,100 **** isnumber = atoi(address); if (!isnumber) hp = gethostbyname(address); ! if (hp) address = hp->h_addr; #ifdef DEBUG --- 94,115 ---- isnumber = atoi(address); if (!isnumber) + { hp = gethostbyname(address); ! if (hp) ! { ! if ( hp->h_addrtype != AF_INET ) return -1; ! address = (char *) alloca(sizeof(char) * (3+1+3+1+3+1+3+1 + 1)); ! if (!address) { malloc_fail(); return -1; } ! ! /* prekonvertuje hp->h_addr na IP adresu */ ! sprintf( address, "%ud.%ud.%ud.%ud", ! (unsigned short int) hp->h_addr[0], ! (unsigned short int) hp->h_addr[1], ! (unsigned short int) hp->h_addr[2], ! (unsigned short int) hp->h_addr[3] ); ! } ! } #ifdef DEBUG