diff options
Diffstat (limited to 'net/ttcp/patches/patch-ab')
-rw-r--r-- | net/ttcp/patches/patch-ab | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/net/ttcp/patches/patch-ab b/net/ttcp/patches/patch-ab new file mode 100644 index 00000000000..cdc653984dc --- /dev/null +++ b/net/ttcp/patches/patch-ab @@ -0,0 +1,95 @@ +*** ttcp.c.orig Sun Dec 14 18:24:05 1997 +--- ttcp.c Sun Dec 14 18:25:43 1997 +*************** +*** 285,291 **** + err("socket"); + mes("socket"); + +! if (bind(fd, &sinme, sizeof(sinme)) < 0) + err("bind"); + + #if defined(SO_SNDBUF) || defined(SO_RCVBUF) +--- 285,291 ---- + err("socket"); + mes("socket"); + +! if (bind(fd, (struct sockaddr *)&sinme, sizeof(sinme)) < 0) + err("bind"); + + #if defined(SO_SNDBUF) || defined(SO_RCVBUF) +*************** +*** 326,332 **** + mes("nodelay"); + } + #endif +! if(connect(fd, &sinhim, sizeof(sinhim) ) < 0) + err("connect"); + mes("connect"); + } else { +--- 326,332 ---- + mes("nodelay"); + } + #endif +! if(connect(fd, (struct sockaddr *)&sinhim, sizeof(sinhim) ) < 0) + err("connect"); + mes("connect"); + } else { +*************** +*** 348,358 **** + } + fromlen = sizeof(frominet); + domain = AF_INET; +! if((fd=accept(fd, &frominet, &fromlen) ) < 0) + err("accept"); + { struct sockaddr_in peer; + int peerlen = sizeof(peer); +! if (getpeername(fd, (struct sockaddr_in *) &peer, + &peerlen) < 0) { + err("getpeername"); + } +--- 348,358 ---- + } + fromlen = sizeof(frominet); + domain = AF_INET; +! if((fd=accept(fd, (struct sockaddr *)&frominet, &fromlen) ) < 0) + err("accept"); + { struct sockaddr_in peer; + int peerlen = sizeof(peer); +! if (getpeername(fd, (struct sockaddr *) &peer, + &peerlen) < 0) { + err("getpeername"); + } +*************** +*** 752,758 **** + int len = sizeof(from); + register int cnt; + if( udp ) { +! cnt = recvfrom( fd, buf, count, 0, &from, &len ); + numCalls++; + } else { + if( b_flag ) +--- 752,758 ---- + int len = sizeof(from); + register int cnt; + if( udp ) { +! cnt = recvfrom( fd, buf, count, 0, (struct sockaddr *)&from, &len ); + numCalls++; + } else { + if( b_flag ) +*************** +*** 782,788 **** + register int cnt; + if( udp ) { + again: +! cnt = sendto( fd, buf, count, 0, &sinhim, sizeof(sinhim) ); + numCalls++; + if( cnt<0 && errno == ENOBUFS ) { + delay(18000); +--- 782,788 ---- + register int cnt; + if( udp ) { + again: +! cnt = sendto( fd, buf, count, 0, (struct sockaddr *)&sinhim, sizeof(sinhim) ); + numCalls++; + if( cnt<0 && errno == ENOBUFS ) { + delay(18000); |