~ubuntu-branches/ubuntu/oneiric/squid3/oneiric-security

« back to all changes in this revision

Viewing changes to tools/squidclient.cc

  • Committer: Bazaar Package Importer
  • Author(s): Mahyuddin Susanto
  • Date: 2011-02-15 18:46:13 UTC
  • mfrom: (21.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110215184613-1u3dh5sz4i055flk
Tags: 3.1.10-1ubuntu1
* Merge from debian unstable. (LP: #719283)  Remaining changes:
  - debian/patches/18-fix-ftbfs-binutils-gold.dpatch: Add library linker into
    LIBS instead to LDFLAGS to fixing FTBFS binutils-gold.
* Drop Ubuntu configuration for ufw which landed in Debian and sync it: 
  - debian/squid3.ufw.profile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
            strcat(msg, buf);
435
435
        }
436
436
 
437
 
        /* HTTP/1.0 may need keep-alive */
438
 
        if (strcmp(version, "1.0") == 0) {
439
 
            if (keep_alive) {
440
 
                if (strchr(url, ':')) {
441
 
                    snprintf(buf, BUFSIZ, "Proxy-Connection: keep-alive\r\n");
442
 
                    strcat(msg, buf);
443
 
                } else
444
 
                    strcat(msg, "Connection: keep-alive\r\n");
445
 
            }
446
 
        }
447
 
        /* HTTP/1.1 may need close */
 
437
        /* HTTP/1.0 may need keep-alive explicitly */
 
438
        if (strcmp(version, "1.0") == 0 && keep_alive)
 
439
            strcat(msg, "Connection: keep-alive\r\n");
 
440
 
 
441
        /* HTTP/1.1 may need close explicitly */
448
442
        if (!keep_alive)
449
443
            strcat(msg, "Connection: close\r\n");
450
444
 
453
447
    }
454
448
 
455
449
    if (opt_verbose)
456
 
        fprintf(stderr, "Request: '%s'\n", msg);
 
450
        fprintf(stderr, "Request:'%s'\n", msg);
457
451
 
458
452
    if (ping) {
459
453
#if HAVE_SIGACTION
481
475
        int fsize = 0;
482
476
        struct addrinfo *AI = NULL;
483
477
 
 
478
        if (opt_verbose)
 
479
            fprintf(stderr, "Resolving... %s\n", hostname);
 
480
 
484
481
        /* Connect to the server */
485
482
 
486
483
        if (localhost) {
518
515
 
519
516
        iaddr.SetPort(port);
520
517
 
 
518
        if (opt_verbose) {
 
519
            char ipbuf[MAX_IPSTRLEN];
 
520
            fprintf(stderr, "Connecting... %s(%s)\n", hostname, iaddr.NtoA(ipbuf, MAX_IPSTRLEN));
 
521
        }
 
522
 
521
523
        if (client_comm_connect(conn, iaddr, ping ? &tv1 : NULL) < 0) {
522
524
            char hostnameBuf[MAX_IPSTRLEN];
523
525
            iaddr.ToURL(hostnameBuf, MAX_IPSTRLEN);
530
532
            }
531
533
            exit(1);
532
534
        }
 
535
        if (opt_verbose) {
 
536
            char ipbuf[MAX_IPSTRLEN];
 
537
            fprintf(stderr, "Connected to: %s (%s)\n", hostname, iaddr.NtoA(ipbuf, MAX_IPSTRLEN));
 
538
        }
533
539
 
534
540
        /* Send the HTTP request */
535
541
        bytesWritten = mywrite(conn, msg, strlen(msg));