Deleted Added
full compact
common.c (106040) common.c (106044)
1/*-
2 * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libfetch/common.c 106040 2002-10-27 15:08:21Z des $");
30__FBSDID("$FreeBSD: head/lib/libfetch/common.c 106044 2002-10-27 15:43:40Z des $");
31
32#include <sys/param.h>
33#include <sys/socket.h>
34#include <sys/time.h>
35#include <sys/uio.h>
36#include <netinet/in.h>
37
38#include <errno.h>

--- 421 unchanged lines hidden (view full) ---

460 int r;
461
462 if (fetchTimeout) {
463 FD_ZERO(&writefds);
464 gettimeofday(&timeout, NULL);
465 timeout.tv_sec += fetchTimeout;
466 }
467
31
32#include <sys/param.h>
33#include <sys/socket.h>
34#include <sys/time.h>
35#include <sys/uio.h>
36#include <netinet/in.h>
37
38#include <errno.h>

--- 421 unchanged lines hidden (view full) ---

460 int r;
461
462 if (fetchTimeout) {
463 FD_ZERO(&writefds);
464 gettimeofday(&timeout, NULL);
465 timeout.tv_sec += fetchTimeout;
466 }
467
468 total = 0;
468 while (len > 0) {
469 while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) {
470 FD_SET(conn->sd, &writefds);
471 gettimeofday(&now, NULL);
472 wait.tv_sec = timeout.tv_sec - now.tv_sec;
473 wait.tv_usec = timeout.tv_usec - now.tv_usec;
474 if (wait.tv_usec < 0) {
475 wait.tv_usec += 1000000;

--- 105 unchanged lines hidden ---
469 while (len > 0) {
470 while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) {
471 FD_SET(conn->sd, &writefds);
472 gettimeofday(&now, NULL);
473 wait.tv_sec = timeout.tv_sec - now.tv_sec;
474 wait.tv_usec = timeout.tv_usec - now.tv_usec;
475 if (wait.tv_usec < 0) {
476 wait.tv_usec += 1000000;

--- 105 unchanged lines hidden ---