~ubuntu-branches/debian/stretch/haproxy/stretch

« back to all changes in this revision

Viewing changes to src/session.c

  • Committer: Package Import Robot
  • Author(s): Vincent Bernat, Apollon Oikonomopoulos, Vincent Bernat, Prach Pongpanich
  • Date: 2013-05-06 20:02:14 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130506200214-36s6p81fsa5zqybt
Tags: 1.4.23-1
[ Apollon Oikonomopoulos ]
* New upstream version (Closes: #643650, #678953)
   + This fixes CVE-2012-2942 (Closes: #674447)
   + This fixes CVE-2013-1912 (Closes: #704611)
* Ship vim addon as vim-haproxy (Closes: #702893)
* Check for the configuration file after sourcing /etc/default/haproxy
  (Closes: #641762)
* Use /dev/log for logging by default (Closes: #649085)

[ Vincent Bernat ]
* debian/control:
   + add Vcs-* fields
   + switch maintenance to Debian HAProxy team. (Closes: #706890)
   + drop dependency to quilt: 3.0 (quilt) format is in use.
* debian/rules:
   + don't explicitly call dh_installchangelog.
   + use dh_installdirs to install directories.
   + use dh_install to install error and configuration files.
   + switch to `linux2628` Makefile target for Linux.
* debian/postrm:
   + remove haproxy user and group on purge.
* Ship a more minimal haproxy.cfg file: no `listen` blocks but `global`
  and `defaults` block with appropriate configuration to use chroot and
  logging in the expected way.

[ Prach Pongpanich ]
* debian/copyright:
   + add missing copyright holders
   + update years of copyright
* debian/rules:
   + build with -Wl,--as-needed to get rid of unnecessary depends
* Remove useless files in debian/haproxy.{docs,examples}
* Update debian/watch file, thanks to Bart Martens

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        }
204
204
 
205
205
        /* OK, maybe we want to abort */
206
 
        if (unlikely((rep->flags & BF_SHUTW) ||
 
206
        if (!(req->flags & BF_WRITE_PARTIAL) &&
 
207
            unlikely((rep->flags & BF_SHUTW) ||
207
208
                     ((req->flags & BF_SHUTW_NOW) && /* FIXME: this should not prevent a connection from establishing */
208
209
                      (((req->flags & (BF_OUT_EMPTY|BF_WRITE_ACTIVITY)) == BF_OUT_EMPTY) ||
209
210
                       s->be->options & PR_O_ABRT_CLOSE)))) {
989
990
                        if (may_dequeue_tasks(s->srv, s->be))
990
991
                                process_srv_queue(s->srv);
991
992
                }
 
993
 
 
994
                if (s->req->cons->iohandler == stats_io_handler &&
 
995
                    s->req->cons->st0 == STAT_CLI_O_SESS && s->data_state == DATA_ST_LIST) {
 
996
                        /* This is a fix for a design bug in the stats I/O handler :
 
997
                         * "show sess $sess" may corrupt the struct session if not
 
998
                         * properly detached. Unfortunately, in 1.4 there is no way
 
999
                         * to ensure we always cleanly unregister an I/O handler upon
 
1000
                         * error. So we're doing the cleanup here if we can detect the
 
1001
                         * situation.
 
1002
                         */
 
1003
                        if (!LIST_ISEMPTY(&s->data_ctx.sess.bref.users)) {
 
1004
                                LIST_DEL(&s->data_ctx.sess.bref.users);
 
1005
                                LIST_INIT(&s->data_ctx.sess.bref.users);
 
1006
                        }
 
1007
                }
992
1008
        }
993
1009
 
994
1010
        /*
1408
1424
                            s->srv->rdr_len && (s->flags & SN_REDIRECTABLE))
1409
1425
                                perform_http_redirect(s, &s->si[1]);
1410
1426
                } while (s->si[1].state == SI_ST_ASS);
 
1427
 
 
1428
                /* Now we can add the server name to a header (if requested) */
 
1429
                /* check for HTTP mode and proxy server_name_hdr_name != NULL */
 
1430
                if ((s->flags & SN_BE_ASSIGNED) &&
 
1431
                        (s->be->mode == PR_MODE_HTTP) &&
 
1432
                        (s->be->server_id_hdr_name != NULL)) {
 
1433
 
 
1434
                        http_send_name_header(&s->txn,
 
1435
                                              &s->txn.req,
 
1436
                                              s->req,
 
1437
                                              s->be,
 
1438
                                              s->srv->id);
 
1439
                }
1411
1440
        }
1412
1441
 
1413
1442
        /* Benchmarks have shown that it's optimal to do a full resync now */
1508
1537
                                      s->uniq_id, s->be->id,
1509
1538
                                      (unsigned short)s->si[0].fd,
1510
1539
                                      (unsigned short)s->si[1].fd);
1511
 
                        write(1, trash, len);
 
1540
                        if (write(1, trash, len) < 0) /* shut gcc warning */;
1512
1541
                }
1513
1542
 
1514
1543
                if (s->si[0].state == SI_ST_CLO &&
1517
1546
                                      s->uniq_id, s->be->id,
1518
1547
                                      (unsigned short)s->si[0].fd,
1519
1548
                                      (unsigned short)s->si[1].fd);
1520
 
                        write(1, trash, len);
 
1549
                        if (write(1, trash, len) < 0) /* shut gcc warning */;
1521
1550
                }
1522
1551
        }
1523
1552
 
1614
1643
                len = sprintf(trash, "%08x:%s.closed[%04x:%04x]\n",
1615
1644
                              s->uniq_id, s->be->id,
1616
1645
                              (unsigned short)s->req->prod->fd, (unsigned short)s->req->cons->fd);
1617
 
                write(1, trash, len);
 
1646
                if (write(1, trash, len) < 0) /* shut gcc warning */;
1618
1647
        }
1619
1648
 
1620
1649
        s->logs.t_close = tv_ms_elapsed(&s->logs.tv_accept, &now);