svc_vc.c (156090) | svc_vc.c (162196) |
---|---|
1/* $NetBSD: svc_vc.c,v 1.7 2000/08/03 00:01:53 fvdl Exp $ */ 2 3/* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or --- 20 unchanged lines hidden (view full) --- 29 * Mountain View, California 94043 30 */ 31 32#if defined(LIBC_SCCS) && !defined(lint) 33static char *sccsid2 = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; 34static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC"; 35#endif 36#include <sys/cdefs.h> | 1/* $NetBSD: svc_vc.c,v 1.7 2000/08/03 00:01:53 fvdl Exp $ */ 2 3/* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or --- 20 unchanged lines hidden (view full) --- 29 * Mountain View, California 94043 30 */ 31 32#if defined(LIBC_SCCS) && !defined(lint) 33static char *sccsid2 = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; 34static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC"; 35#endif 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/lib/libc/rpc/svc_vc.c 156090 2006-02-27 22:10:59Z deischen $"); | 37__FBSDID("$FreeBSD: head/lib/libc/rpc/svc_vc.c 162196 2006-09-09 22:33:21Z mbr $"); |
38 39/* 40 * svc_vc.c, Server side for Connection Oriented based RPC. 41 * 42 * Actually implements two flavors of transporter - 43 * a tcp rendezvouser (a listner and connection establisher) 44 * and a record/tcp stream. 45 */ --- 84 unchanged lines hidden (view full) --- 130 u_int recvsize; 131{ 132 SVCXPRT *xprt; 133 struct cf_rendezvous *r = NULL; 134 struct __rpc_sockinfo si; 135 struct sockaddr_storage sslocal; 136 socklen_t slen; 137 | 38 39/* 40 * svc_vc.c, Server side for Connection Oriented based RPC. 41 * 42 * Actually implements two flavors of transporter - 43 * a tcp rendezvouser (a listner and connection establisher) 44 * and a record/tcp stream. 45 */ --- 84 unchanged lines hidden (view full) --- 130 u_int recvsize; 131{ 132 SVCXPRT *xprt; 133 struct cf_rendezvous *r = NULL; 134 struct __rpc_sockinfo si; 135 struct sockaddr_storage sslocal; 136 socklen_t slen; 137 |
138 if (!__rpc_fd2sockinfo(fd, &si)) 139 return NULL; 140 |
|
138 r = mem_alloc(sizeof(*r)); 139 if (r == NULL) { 140 warnx("svc_vc_create: out of memory"); 141 goto cleanup_svc_vc_create; 142 } | 141 r = mem_alloc(sizeof(*r)); 142 if (r == NULL) { 143 warnx("svc_vc_create: out of memory"); 144 goto cleanup_svc_vc_create; 145 } |
143 if (!__rpc_fd2sockinfo(fd, &si)) 144 return NULL; | |
145 r->sendsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsize); 146 r->recvsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsize); 147 r->maxrec = __svc_maxrec; 148 xprt = mem_alloc(sizeof(SVCXPRT)); 149 if (xprt == NULL) { 150 warnx("svc_vc_create: out of memory"); 151 goto cleanup_svc_vc_create; 152 } --- 19 unchanged lines hidden (view full) --- 172 goto cleanup_svc_vc_create; 173 } 174 memcpy(xprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len); 175 176 xprt->xp_rtaddr.maxlen = sizeof (struct sockaddr_storage); 177 xprt_register(xprt); 178 return (xprt); 179cleanup_svc_vc_create: | 146 r->sendsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsize); 147 r->recvsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsize); 148 r->maxrec = __svc_maxrec; 149 xprt = mem_alloc(sizeof(SVCXPRT)); 150 if (xprt == NULL) { 151 warnx("svc_vc_create: out of memory"); 152 goto cleanup_svc_vc_create; 153 } --- 19 unchanged lines hidden (view full) --- 173 goto cleanup_svc_vc_create; 174 } 175 memcpy(xprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len); 176 177 xprt->xp_rtaddr.maxlen = sizeof (struct sockaddr_storage); 178 xprt_register(xprt); 179 return (xprt); 180cleanup_svc_vc_create: |
181 if (xprt) 182 mem_free(xprt, sizeof(*xprt)); |
|
180 if (r != NULL) 181 mem_free(r, sizeof(*r)); 182 return (NULL); 183} 184 185/* 186 * Like svtcp_create(), except the routine takes any *open* UNIX file 187 * descriptor as its first input. --- 600 unchanged lines hidden --- | 183 if (r != NULL) 184 mem_free(r, sizeof(*r)); 185 return (NULL); 186} 187 188/* 189 * Like svtcp_create(), except the routine takes any *open* UNIX file 190 * descriptor as its first input. --- 600 unchanged lines hidden --- |