<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-2022-jp">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=4>file app/httpserv.c </FONT><FONT face=Arial
size=4>function ShowSockets:</FONT></DIV>
<DIV><FONT face=Arial size=4>
fprintf_P(stream,
tfmt, <BR> ts, <BR>
inet_ntoa(ts->so_local_addr),</FONT></DIV>
<DIV><FONT face=Arial
size=4>
ntohs(ts->so_local_port),
<BR>
inet_ntoa(ts->so_remote_addr),
<BR>
ntohs(ts->so_remote_port));</FONT></DIV>
<DIV><FONT face=Arial size=4></FONT> </DIV>
<DIV><FONT face=Arial size=4>not works well...</FONT><FONT face=Arial
size=4>change it like this:</FONT></DIV>
<DIV><FONT face=Arial size=4></FONT> </DIV>
<DIV><FONT face=Arial size=4>
{<BR> char
ip_str[16];<BR>
strcpy(ip_str,
(char*)inet_ntoa(ts->so_local_addr));<BR>
<BR>
fprintf_P(stream,
tfmt, <BR>
ts,
<BR>
ip_str,<BR>
ntohs(ts->so_local_port),
<BR>
inet_ntoa(ts->so_remote_addr),
<BR>
ntohs(ts->so_remote_port));<BR>
}</FONT></DIV>
<DIV><FONT face=Arial size=4></FONT> </DIV>
<DIV><FONT face=Arial size=4>or change function inet_ntoa</FONT></DIV>
<DIV><FONT face=Arial size=4></FONT> </DIV>
<DIV><FONT face=Arial size=4>u_char *inet_ntoa(u_long
addr)<BR>{<BR> static u_char str[4][16];<BR>
static u_char rnd = 0;<BR> u_char
inv[3];<BR> u_char *rp;<BR> u_char
*ap;<BR> u_char rem;<BR> u_char
n;<BR> u_char i;</FONT></DIV>
<DIV><FONT face=Arial size=4></FONT> </DIV>
<DIV><FONT face=Arial size=4><BR> if (++rnd ==
4)<BR> rnd =
0; <BR> rp = str[rnd];
<BR> ap = (u_char *) & addr;<BR> for (n
= 0; n < 4; n++) {<BR> i =
0;<BR> do
{<BR> rem =
*ap % (u_char)
10;<BR> *ap /=
(u_char)
10;<BR>
inv[i++] = '0' + rem;<BR> } while
(*ap);<BR> while
(i--)<BR>
*rp++ = inv[i];<BR> *rp++ =
'.';<BR> ap++;<BR>
}<BR> *--rp = 0;
<BR> return str[rnd];<BR>}</FONT></DIV></BODY></HTML>