From 77ad9f0ac2db65f704cefb1c9c3318129ca86287 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 3 Nov 2005 21:20:55 +0000 Subject: [PATCH] no more htons, since we use getaddrinfo svn: r1226 --- collects/openssl/mzssl.c | 2 +- src/mzscheme/src/network.c | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/collects/openssl/mzssl.c b/collects/openssl/mzssl.c index 828fa1cbbc..ecf66927f0 100644 --- a/collects/openssl/mzssl.c +++ b/collects/openssl/mzssl.c @@ -815,7 +815,7 @@ unsigned short check_port_and_convert(const char *name, int argc, Scheme_Object if(SCHEME_INTP(argv[pos])) if(SCHEME_INT_VAL(argv[pos]) >= 1) if(SCHEME_INT_VAL(argv[pos]) <= 65535) - return htons(SCHEME_INT_VAL(argv[pos])); + return SCHEME_INT_VAL(argv[pos]); scheme_wrong_type(name, "exact integer in [1, 65535]", pos, argc,argv); return 0; /* unnessary and wrong, but it makes GCC happy */ } diff --git a/src/mzscheme/src/network.c b/src/mzscheme/src/network.c index 51d0c339b6..f228c25fac 100644 --- a/src/mzscheme/src/network.c +++ b/src/mzscheme/src/network.c @@ -1564,9 +1564,8 @@ static Scheme_Object *tcp_connect(int argc, Scheme_Object *argv[]) scheme_custodian_check_available(NULL, "tcp-connect", "network"); #ifdef USE_TCP - /* Set id in network order: */ - id = htons(origid); - src_id = htons(src_origid); + id = origid; + src_id = src_origid; #endif #ifdef USE_SOCKETS_TCP @@ -1615,10 +1614,10 @@ static Scheme_Object *tcp_connect(int argc, Scheme_Object *argv[]) scheme_file_open_count++; if (tcp_connect_src) { - freeaddrinfo(tcp_connect_src); + // freeaddrinfo(tcp_connect_src); tcp_connect_src = NULL; } - freeaddrinfo(tcp_connect_dest); + // freeaddrinfo(tcp_connect_dest); tcp_connect_dest = NULL; if (inprogress) { @@ -1755,8 +1754,7 @@ tcp_listen(int argc, Scheme_Object *argv[]) scheme_custodian_check_available(NULL, "tcp-listen", "network"); #ifdef USE_TCP - /* Set id in network order: */ - id = htons(origid); + id = origid; #endif { @@ -2282,7 +2280,7 @@ static Scheme_Object *make_udp(int argc, Scheme_Object *argv[]) GC_CAN_IGNORE struct addrinfo *udp_bind_addr = NULL; if (!origid) origid = 1025; - id = htons(origid); + id = origid; udp_bind_addr = scheme_get_host_address(address, id, &err, -1, 1, 0); if (!udp_bind_addr) { scheme_raise_exn(MZEXN_FAIL_NETWORK, @@ -2454,8 +2452,7 @@ static Scheme_Object *udp_bind_or_connect(const char *name, int argc, Scheme_Obj return NULL; } - /* Set id in network order: */ - id = htons(origid); + id = origid; udp_bind_addr = scheme_get_host_address(address, id, &err, -1, do_bind, 0); if (udp_bind_addr) { @@ -2685,8 +2682,7 @@ static Scheme_Object *udp_send_it(const char *name, int argc, Scheme_Object *arg scheme_security_check_network(name, address, origid, 1); - /* Set id in network order: */ - id = htons(origid); + id = origid; } else { address = NULL; id = origid = 0;