~ubuntu-branches/ubuntu/trusty/rsync/trusty

« back to all changes in this revision

Viewing changes to socket.c

  • Committer: Package Import Robot
  • Author(s): Paul Slootman
  • Date: 2013-10-27 12:01:10 UTC
  • mfrom: (1.1.13) (2.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20131027120110-mpr03n5scqmf40mi
Tags: 3.1.0-2
fix build failure if zlib1g-dev package is not installed;
solved by building without the included zlib source and adding a
build-depends on zlib1g-dev >= 1:1.2.8
closes:32379

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Copyright (C) 1992-2001 Andrew Tridgell <tridge@samba.org>
5
5
 * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
6
 
 * Copyright (C) 2003-2009 Wayne Davison
 
6
 * Copyright (C) 2003-2013 Wayne Davison
7
7
 *
8
8
 * This program is free software; you can redistribute it and/or modify
9
9
 * it under the terms of the GNU General Public License as published by
25
25
 * emulate it using the KAME implementation. */
26
26
 
27
27
#include "rsync.h"
28
 
#include "ifuncs.h"
 
28
#include "itypes.h"
29
29
#ifdef HAVE_NETINET_IN_SYSTM_H
30
30
#include <netinet/in_systm.h>
31
31
#endif
229
229
                }
230
230
                *cp++ = '\0';
231
231
                strlcpy(portbuf, cp, sizeof portbuf);
232
 
                if (verbose >= 2) {
 
232
                if (DEBUG_GTE(CONNECT, 1)) {
233
233
                        rprintf(FINFO, "connection via http proxy %s port %s\n",
234
234
                                h, portbuf);
235
235
                }
301
301
                        s = -1;
302
302
                        continue;
303
303
                }
304
 
                if (verbose >= 3) {
 
304
                if (DEBUG_GTE(CONNECT, 2)) {
305
305
                        char buf[2048];
306
306
                        if ((error = getnameinfo(res->ai_addr, res->ai_addrlen, buf, sizeof buf, NULL, 0, NI_NUMERICHOST)) != 0)
307
307
                                snprintf(buf, sizeof buf, "*getnameinfo failure: %s*", gai_strerror(error));
310
310
                break;
311
311
        }
312
312
 
313
 
        if (s < 0 || verbose >= 3) {
 
313
        if (s < 0 || DEBUG_GTE(CONNECT, 2)) {
314
314
                char buf[2048];
315
315
                for (res = res0, j = 0; res; res = res->ai_next, j++) {
316
316
                        if (errnos[j] == 0)
381
381
                *t = '\0';
382
382
        }
383
383
 
384
 
        if (verbose >= 2) {
 
384
        if (DEBUG_GTE(CONNECT, 1)) {
385
385
                rprintf(FINFO, "%sopening tcp connection to %s port %d\n",
386
386
                        prog ? "Using RSYNC_CONNECT_PROG instead of " : "",
387
387
                        host, port);
489
489
        /* Only output the socket()/bind() messages if we were totally
490
490
         * unsuccessful, or if the daemon is being run with -vv. */
491
491
        for (s = 0; s < ecnt; s++) {
492
 
                if (!i || verbose > 1)
 
492
                if (!i || DEBUG_GTE(BIND, 1))
493
493
                        rwrite(FLOG, errmsgs[s], strlen(errmsgs[s]), 0);
494
494
                free(errmsgs[s]);
495
495
        }
557
557
        /* ready to listen */
558
558
        FD_ZERO(&deffds);
559
559
        for (i = 0, maxfd = -1; sp[i] >= 0; i++) {
560
 
                if (listen(sp[i], 5) < 0) {
 
560
                if (listen(sp[i], lp_listen_backlog()) < 0) {
561
561
                        rsyserr(FERROR, errno, "listen() on socket failed");
562
562
#ifdef INET6
563
563
                        if (errno == EADDRINUSE && i > 0) {
831
831
                rsyserr(FERROR, errno, "socketpair_tcp failed");
832
832
                return -1;
833
833
        }
834
 
        if (verbose >= 2)
 
834
        if (DEBUG_GTE(CMD, 1))
835
835
                rprintf(FINFO, "Running socket program: \"%s\"\n", prog);
836
836
 
837
837
        pid = fork();