Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 29DC7200B6F for ; Wed, 24 Aug 2016 17:23:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 283F1160AB1; Wed, 24 Aug 2016 15:23:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F140C160A91 for ; Wed, 24 Aug 2016 17:23:28 +0200 (CEST) Received: (qmail 72190 invoked by uid 500); 24 Aug 2016 15:23:28 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 72181 invoked by uid 99); 24 Aug 2016 15:23:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Aug 2016 15:23:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7A759C0C08 for ; Wed, 24 Aug 2016 15:23:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id yuvO6ZO3TNsL for ; Wed, 24 Aug 2016 15:23:14 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 6AC2B5F39B for ; Wed, 24 Aug 2016 15:23:13 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9C418E0069 for ; Wed, 24 Aug 2016 15:23:12 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 92AA43A0184 for ; Wed, 24 Aug 2016 15:23:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1757542 [1/2] - in /httpd/httpd/branches/2.4.x: ./ modules/http2/ Date: Wed, 24 Aug 2016 15:23:12 -0000 To: cvs@httpd.apache.org From: icing@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160824152312.92AA43A0184@svn01-us-west.apache.org> archived-at: Wed, 24 Aug 2016 15:23:31 -0000 Author: icing Date: Wed Aug 24 15:23:12 2016 New Revision: 1757542 URL: http://svn.apache.org/viewvc?rev=1757542&view=rev Log: merge of 1752145,1753498,1753541,1754129,1754414,1754534,1755323,1756844,1757524,1757534,1757540 from trunk mod_http2: backport of latest changes - intermediate responses - graceful shutdown of connections - ht debug draft update Modified: httpd/httpd/branches/2.4.x/ (props changed) httpd/httpd/branches/2.4.x/CHANGES httpd/httpd/branches/2.4.x/modules/http2/h2.h httpd/httpd/branches/2.4.x/modules/http2/h2_filter.c httpd/httpd/branches/2.4.x/modules/http2/h2_from_h1.c httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.c httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.h httpd/httpd/branches/2.4.x/modules/http2/h2_ngn_shed.c httpd/httpd/branches/2.4.x/modules/http2/h2_request.c httpd/httpd/branches/2.4.x/modules/http2/h2_response.c httpd/httpd/branches/2.4.x/modules/http2/h2_response.h httpd/httpd/branches/2.4.x/modules/http2/h2_session.c httpd/httpd/branches/2.4.x/modules/http2/h2_stream.c httpd/httpd/branches/2.4.x/modules/http2/h2_stream.h httpd/httpd/branches/2.4.x/modules/http2/h2_task.c httpd/httpd/branches/2.4.x/modules/http2/h2_task.h httpd/httpd/branches/2.4.x/modules/http2/h2_util.c httpd/httpd/branches/2.4.x/modules/http2/h2_version.h Propchange: httpd/httpd/branches/2.4.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Aug 24 15:23:12 2016 @@ -2,4 +2,4 @@ /httpd/httpd/branches/2.4.17-protocols-http2:1701609-1705681 /httpd/httpd/branches/revert-ap-ldap:1150158-1150173 /httpd/httpd/branches/wombat-integration:723609-723841 -/httpd/httpd/trunk:1200475,1200478,1200482,1200491,1200496,1200513,1200550,1200556,1200580,1200605,1200612,1200614,1200639,1200646,1200656,1200667,1200679,1200699,1200702,1200955,1200957,1200961,1200963,1200968,1200975,1200977,1201032,1201042,1201111,1201194,1201198,1201202,1201443,1201450,1201460,1201956,1202236,1202453,1202456,1202886,1203400,1203491,1203632,1203714,1203859,1203980,1204630,1204968,1204990,1205061,1205075,1205379,1205885,1206291,1206472,1206587,1206850,1206940,1206978,1207719,1208753,1208835,1209053,1209085,1209417,1209432,1209461,1209601,1209603,1209618,1209623,1209741,1209754,1209766,1209776,1209797-1209798,1209811-1209812,1209814,1209908,1209910,1209913,1209916-1209917,1209947,1209952,1210067,1210080,1210120,1210124,1210130,1210148,1210219,1210221,1210252,1210284,1210336,1210378,1210725,1210892,1210951,1210954,1211351-1211352,1211364,1211490,1211495,1211528,1211663,1211680,1212872,1212883,1213338,1213380-1213381,1213391,1213399,1213567,1214003,1214005,1214015,12 15514,1220462,1220467,1220493,1220524,1220570,1220768,1220794,1220826,1220846,1221205,1221292,1222335,1222370,1222473,1222915,1222917,1222921,1222930,1223048,1225060,1225197-1225199,1225223,1225380,1225476,1225478,1225791,1225795-1225796,1226339,1226375,1227910,1228700,1228816,1229024,1229059,1229099,1229116,1229134,1229136,1229930,1230286,1231255,1231257,1231442,1231446,1231508,1231510,1231518,1232575,1232594,1232630,1232838,1234180,1234297,1234479,1234511,1234565,1234574,1234642-1234643,1234876,1234899,1235019,1236122,1236701,1237407,1238545,1238768,1239029-1239030,1239071,1239565,1240315,1240470,1240778,1241069,1241071,1242089,1242798,1242967,1243176,1243246,1243797,1243799,1244211,1245717,1290823,1290835,1291819-1291820,1291834,1291840,1292043,1293405,1293534-1293535,1293658,1293678,1293708,1294306,1294349,1294356,1294358,1294372,1294471,1297560,1299718,1299786,1300766,1301111,1301725,1302444,1302483,1302653,1302665,1302674,1303201,1303435,1303827,1304087,1304874-1304875,1305167 ,1305586,1306350,1306409,1306426,1306841,1307790,1308327,1308459,1309536,1309567,1311468,1324760,1325218,1325227,1325250,1325265,1325275,1325632,1325724,1326980,1326984,1326991,1327689,1328325-1328326,1328339,1328345,1328950,1330189,1330964,1331110,1331115,1331942,1331977,1332378,1333969,1334343,1335882,1337344,1341906,1341913,1343085,1343087,1343094,1343099,1343109,1343935,1345319,1345329,1346905,1347980,1348036,1348653,1348656,1348660,1349905,1351012-1351020,1351071-1351072,1351074,1351737,1352047,1352534,1352909-1352912,1357685,1358061,1359057,1359881,1359884,1361153,1361298,1361766,1361773,1361778,1361784,1361791-1361792,1361801,1361803,1362020,1362538,1362707,1363035,1363183,1363186,1363312,1363440,1363557,1363589,1363829,1363832,1363836-1363837,1363853,1364133,1364138,1364229,1364601,1364695,1365001,1365020,1365029,1365479,1366319,1366344,1366621,1367778,1367819,1368053,1368058,1368094,1368121,1368131,1368393,1368396,1369419,1369568,1369604,1369618,1369904,1369995,1369999,1370 001,1370466,1370592,1370615-1370616,1370763,1371387,1371791,1371801,1371878,1371903,1373270,1373447,1373898,1373955,1374157,1374199,1374247,1374874,1374877,1374880,1375006,1375009,1375011,1375013,1375584,1376695,1376700,1378178,1383490,1384408,1384913,1386576,1386578,1386726,1386822,1386880,1386913,1387085,1387088,1387110,1387389,1387444,1387603,1387607,1387633,1387693,1387979,1388029,1388445,1388447,1388648,1388660,1388825,1388899,1389316,1389339,1389481,1389506,1389564,1389566-1389569,1390562,1390564,1391396,1391398,1391771,1392120,1392122,1392150,1392214,1392345-1392347,1392850,1393033,1393058,1393152,1393338,1393564,1394079,1395225,1395253-1395256,1395792,1396440,1397172,1397320,1397636,1397687,1397710,1397716,1398025,1398040,1398066,1398478,1398480-1398481,1398970,1399413,1399687,1399708,1400700,1401448,1402924,1403476,1403483,1403492,1404653,1405407,1405856,1405973,1406068,1406493,1406495,1406616,1406646,1406760,1407004,1407006,1407085,1407088,1407248,1407381,1407459-1407460,1 407528,1407853,1407965,1408093,1408402,1408958,1408961,1409170,1409437,1409726,1409800,1410681,1410954,1411862,1412278,1413732,1414094,1415008,1415023,1415075,1416121,1416150,1416278,1417197,1417440,1417529,1418524,1418556,1418648,1418655,1418703,1418721,1418752,1418769,1419084,1419719,1419726,1419755,1419781,1419796,1420120,1420124,1420149,1420184,1420644,1420685-1420686,1420975,1421288,1421323,1421851,1421912,1421953,1422135,1422549,1422594,1422712,1422855,1422937,1422943,1422980,1423353,1423933,1425360,1425771-1425772,1425775,1425777,1425874,1426850,1426975,1427546,1428184,1428280,1428916,1429228,1429559,1429561,1429564,1429582,1430575,1430814,1430869,1433001,1433613,1433682,1433861,1433988,1435178,1435811,1436058,1436401,1439083,1439106,1439114,1439404,1439623,1442309,1442320,1442326,1442412,1442759,1442865,1447993,1448171,1448453,1451478,1451484,1451633,1451849,1451905,1451921,1452128,1452195,1452259,1452281,1452551,1452911,1452949,1452954,1453022,1453574,1453604,1453875-145387 6,1453963,1453981,1454386,1454414-1454415,1454888,1457437,1457450,1457471,1457504,1457520-1457521,1457610,1457995,1458003-1458004,1458020,1458285,1458447,1458456,1462266,1462269,1462643,1463044-1463047,1463052,1463056,1463455,1463736,1463750,1463754,1464675,1464721,1464762,1465115-1465116,1465190,1467765,1468581,1470183,1470679,1470940,1471449,1475878,1476604,1476621,1476642,1476644-1476645,1476652,1476680,1477094,1477530,1478382,1478748,1479117,1479216,1479222,1479411,1479528,1479905,1479966,1480046,1480627,1481197,1481302,1481306,1481396-1481397,1481891,1482041,1482075,1482170,1482555,1482859,1482996,1483005,1483027,1483190,1484343,1484398,1484832,1484910,1484914,1485409,1485668,1486490,1487528,1487530,1488158,1488164,1488296,1488471,1488492,1488644,1490493,1490507,1490550,1490761,1490994,1491155,1491221,1491234,1491458,1491479,1491538,1491564,1491724,1492663,1492710,1492782,1493330,1493921,1493925,1494536,1495501,1496194,1496338,1496429,1496709,1497371,1497588,1498880,1499679,150 0323,1500345,1500362,1500423,1500437,1500483,1500519,1501294,1501369,1501399,1501913,1502665,1502772,1503680,1503866,1503990-1503991,1504276,1506474,1506714,1509872,1509983,1510084-1510085,1510098,1510588,1510707,1511093,1513492,1513508,1514039,1514064,1514214-1514215,1514255,1514267,1514617,1515050,1515162,1515403,1515411,1515420,1517025,1517045,1517175,1517366,1517386,1517388,1518265,1518269,1519475,1520368,1520445,1520760,1520908,1521909,1523235,1523239,1523281,1523387,1524101,1524158,1524192,1524368,1524388,1524770,1525276,1525280-1525281,1525931,1526168,1526189,1526647,1526666,1527008,1527220,1527291,1527294-1527295,1527509,1527925-1527926,1528143,1528718,1529014,1529277,1529449,1529559,1529988,1529991,1530793,1531340,1531370,1531505,1531672,1531961-1531962,1532746,1532816,1533065,1533224,1534321,1534754,1534890,1534892,1536310,1537535,1538490,1540051-1540052,1541181,1541270,1541368,1542338,1542379,1542533,1542562,1542615,1543020,1543147,1543149,1543174,1544381,1544774,1544784, 1544812,1544820,1545286,1545292,1545325,1545364,1545408,1545411,1546692-1546693,1546730,1546759-1546760,1546801,1546804-1546805,1546835-1546836,1547845,1550061,1550302,1550307,1551685,1551714,1551802,1552130,1552227,1553204,1553824,1554161,1554168,1554170,1554175-1554176,1554179,1554181,1554184,1554188,1554192,1554195,1554276,1554281,1554300-1554301,1554994-1554995,1555240,1555259,1555266,1555423-1555424,1555463-1555464,1555467,1555555,1555569,1556206,1556428,1556911-1556912,1556914,1556937,1557317,1557617,1558483,1559351,1559828,1560367,1560546,1560679,1560689,1560729,1560977,1560979,1561137,1561262,1561385,1561660,1561923,1562472,1563193,1563379,1563381,1563417-1563418,1563420,1564052,1564437,1564475,1564756,1564760,1565081,1565711,1568404,1569615,1570288,1570598,1571369,1572092,1572198,1572543,1572561,1572611,1572630,1572655,1572663,1572668-1572671,1572896,1572905,1572911,1572967,1573224,1573229,1573626,1574151,1575400,1576233,1576741,1578760,1578762,1580568,1583005,1583007-15830 08,1583027,1583175,1583191,1584098,1584430,1584434,1584572,1584653,1584658,1584665,1584703,1584878,1584884,1584896,1585054,1585072,1585090,1585435,1585609,1585824,1585918-1585919,1586745,1586827,1587036,1587040,1587053,1587255,1587594,1587607,1587639,1587654,1588054,1588065,1588213,1588330,1588427,1588519,1588527,1588704,1588851,1588853,1588868,1589413,1590437,1590509,1591143,1591320,1591322,1591328,1591390,1591394,1591401,1591472,1591508,1592032,1592037,1592500,1592511,1592514,1592529,1592615,1592632,1593745,1594625,1594643,1594648,1595305,1595321,1595426,1597182,1597349,1597352,1597639,1597642,1598107,1598946,1599535,1601076,1601184-1601185,1601274,1601291,1601624,1601630,1601919,1601995,1602338,1602978,1602989,1603027,1603029,1603122,1603156,1603915,1604382,1604461,1604631,1605207,1605827,1605829,1607960,1608284,1608785,1608999,1609914,1609936,1609938,1610207,1610311,1610353,1610366,1610491,1610652,1610674,1611165,1611169,1611244,1611600,1611871,1611978,1612068,1615026,1615289,16 17018,1618401,1618541,1619297,1619383,1619444,1619483,1619835,1620324,1620461,1620932,1621367,1621372,1621417,1621453,1621806,1622450,1624234,1624349,1625196,1625952,1626050,1626978,1628104,1628918-1628919,1628924,1628950,1629235,1629239,1629244,1629250,1629372,1629440-1629441,1629485,1629507-1629508,1629519,1629577,1629652,1629916,1631885,1632454,1632740,1632742,1633730-1633731,1633793,1634120,1634237,1634425,1634736,1634836,1635510,1635558,1635644-1635645,1635762,1637112,1638072-1638073,1638879,1639614,1640031,1640036,1640040,1640042,1640331,1641077,1641095,1641376,1642099,1642484,1642499,1642847,1642868,1643034,1643284,1643537,1643825,1644245,1646282,1646724,1647035,1648201,1648394,1648433,1648719,1648840,1649001,1649043,1649632,1649966,1650047,1650061,1650309-1650310,1650320,1651088,1652829,1652929,1652931,1652955,1652982,1652985,1652989,1653941,1653978,1653997,1656225,1656669,1657256,1657261,1657636,1657638,1657685,1657881,1657897,1658760,1658765,1661067,1661258,1661448,1661464 ,1661486,1662245-1662246,1663017,1663647,1664071,1664133,1664205,1664299,1664709,1665215,1665218,1665625,1665643,1665721,1666297,1666361,1666363,1666468,1666618,1666998,1667385-1667386,1668532,1668535,1668553,1669130,1669289,1669292,1670434,1671364,1671396-1671397,1671918,1672289,1672453,1672466,1672480,1672483,1672564,1672757,1672985,1672989,1673113,1673155,1673368,1673455,1673769,1674056,1674538,1674542,1674606,1674632,1674697,1675103,1675410,1675533,1676085,1676654,1676709,1676842,1677096,1677143-1677146,1677149,1677151,1677153-1677156,1677159,1677339,1677462,1677702,1677830,1677832,1677834-1677835,1678763,1679032,1679181-1679182,1679192,1679428,1679432,1679470,1679620,1679712,1680276,1680895,1680900,1680942,1681037,1681424,1681440,1681685,1681694,1681795,1682482,1682816,1682819,1682907,1682923,1682937,1682979,1682988,1683044,1683047,1683123,1683881,1683884,1684057,1684171,1684900,1685069,1685339,1685345,1685347,1685349-1685350,1685650,1685659,1685779,1686085,1686853,1686856,1687 539,1687680,1687980,1688274,1688331,1688339-1688341,1688343,1688474-1688475,1688536,1688538,1688660,1689325,1689605,1689694,1689698,1690120,1690137,1690248,1691374,1691582,1691592,1691819,1691908,1692285,1692432,1692486,1692516,1693792,1693918-1693919,1693963,1694903,1694936,1694950-1694951,1695170,1695727,1695874,1695885,1695920,1696105,1696264,1696266,1696279,1696428,1696442,1696565,1696592,1696607,1696755,1696881,1697013,1697015,1697051,1697323,1697339,1697370,1697389,1697446,1697543,1697634,1697855,1698023,1698103,1698107,1698116,1698133,1698330,1700271,1700275,1700317-1700322,1700326,1700328,1700330-1700332,1700334,1700336,1700338,1700418,1700514,1700777,1700851,1700917,1700925,1700968,1701005,1701145,1701178,1701204,1701347,1701436,1701545,1701717,1702643,1702919,1703152,1703417,1703642,1703807,1703813,1703822,1703871,1703902,1703952,1704099,1704241,1704262,1704797,1704799,1704826,1705099,1705134,1705194,1705217,1705257,1705749,1705776,1705823,1705826,1705828,1705833,1705983,1 706275,1706627,1706635,1706637,1706640,1706918,1706942,1706989,1707002,1707230-1707231,1707497,1707519,1707591,1707626-1707627,1707640,1707831,1707883,1707889,1708107,1709008,1709587,1709596,1709602,1709995,1710095,1710105,1710231,1710380,1710391,1710419,1710572,1710583,1710723,1711479,1711553,1711648,1711728,1711902,1712382,1713040,1713209,1713937,1715023,1715255,1715273,1715567-1715568,1715570-1715572,1715576,1715581-1715585,1715886,1716211,1716388,1716460,1716487,1716660,1716940,1717063,1717086,1717639,1717816,1717934,1717958,1717975,1717985,1718314,1718338,1718400,1718514,1718556,1718569,1718598,1719016,1719018,1719189-1719190,1719252,1719254-1719255,1719257,1719967,1720129,1720996,1721313,1721685,1721899,1722137,1722154,1722177,1722195,1722229,1722320,1722328,1722334,1722350-1722351,1722358,1722377,1722572,1722701,1723122,1723143,1723284,1723295,1723567,1723953,1724847,1724857,1724879,1724992-1724993,1724995,1725018,1725031,1725090,1725120,1725149,1725325,1725328,1725387,172539 2,1725394-1725395,1725445,1725468,1725485,1725489,1725498-1725499,1725516,1725523,1725545,1725567,1725581,1725602,1725822,1725940,1725967,1726009,1726026,1726038,1726049,1726051-1726052,1726055,1726086,1726167,1726233,1726798,1726881,1726888,1727071,1727111,1727317,1727544,1727573,1727603,1727842,1728326,1729208,1729374,1729376,1729826,1729847,1729929-1729931,1729960,1730297,1730640,1730723,1730865,1731929,1732252,1732353,1732369,1732716,1732954,1732986,1733056,1733064,1733068,1733088-1733089,1733275,1733523,1733537,1733691,1734006,1734125,1734239,1734294,1734412,1734561,1734807,1734817,1734947,1734955,1734989,1735088,1735159,1735337,1735608-1735609,1735611,1735668,1735786,1735931,1735935,1735942,1735952,1736156,1736243,1736250,1736463,1736681,1736686,1737006,1737014,1737020-1737021,1737102,1737114,1737125,1737254,1737256,1737265,1737447,1737449,1737451,1737476,1738217,1738331,1738333,1738563,1739008,1739146,1739151,1739193,1739303,1739312,1739738,1739932,1740075,1740084,1740108,174 0110,1740155,1740735,1741045,1741065,1741112,1741115,1741268,1741310,1741392,1741414,1741446,1741461,1741557,1741564,1741596,1741621,1741648,1741934,1742005,1742135,1742260,1742359,1742444-1742447,1742460,1742791-1742792,1743335,1743517,1743699,1743788,1743816,1744203-1744204,1744206,1744283,1744415,1744421,1744458-1744459,1744712,1744751,1744767,1744778,1744980,1745034,1745175,1745767,1745835,1746207,1746647,1746988,1747170,1747531,1747550,1747735,1747808,1747810,1747946,1748047,1748368,1748448,1748531,1748653,1748888,1749151,1749401,1749404,1749505,1749658-1749659,1749676,1749678,1749695,1749924-1749925,1750043,1750218,1750335,1750407,1750420,1750507,1750553,1750567,1750750,1750779,1751970,1752087,1752096,1752145,1752415,1753224,1753228-1753229,1753498,1753541,1753592,1753594,1753777 +/httpd/httpd/trunk:1200475,1200478,1200482,1200491,1200496,1200513,1200550,1200556,1200580,1200605,1200612,1200614,1200639,1200646,1200656,1200667,1200679,1200699,1200702,1200955,1200957,1200961,1200963,1200968,1200975,1200977,1201032,1201042,1201111,1201194,1201198,1201202,1201443,1201450,1201460,1201956,1202236,1202453,1202456,1202886,1203400,1203491,1203632,1203714,1203859,1203980,1204630,1204968,1204990,1205061,1205075,1205379,1205885,1206291,1206472,1206587,1206850,1206940,1206978,1207719,1208753,1208835,1209053,1209085,1209417,1209432,1209461,1209601,1209603,1209618,1209623,1209741,1209754,1209766,1209776,1209797-1209798,1209811-1209812,1209814,1209908,1209910,1209913,1209916-1209917,1209947,1209952,1210067,1210080,1210120,1210124,1210130,1210148,1210219,1210221,1210252,1210284,1210336,1210378,1210725,1210892,1210951,1210954,1211351-1211352,1211364,1211490,1211495,1211528,1211663,1211680,1212872,1212883,1213338,1213380-1213381,1213391,1213399,1213567,1214003,1214005,1214015,12 15514,1220462,1220467,1220493,1220524,1220570,1220768,1220794,1220826,1220846,1221205,1221292,1222335,1222370,1222473,1222915,1222917,1222921,1222930,1223048,1225060,1225197-1225199,1225223,1225380,1225476,1225478,1225791,1225795-1225796,1226339,1226375,1227910,1228700,1228816,1229024,1229059,1229099,1229116,1229134,1229136,1229930,1230286,1231255,1231257,1231442,1231446,1231508,1231510,1231518,1232575,1232594,1232630,1232838,1234180,1234297,1234479,1234511,1234565,1234574,1234642-1234643,1234876,1234899,1235019,1236122,1236701,1237407,1238545,1238768,1239029-1239030,1239071,1239565,1240315,1240470,1240778,1241069,1241071,1242089,1242798,1242967,1243176,1243246,1243797,1243799,1244211,1245717,1290823,1290835,1291819-1291820,1291834,1291840,1292043,1293405,1293534-1293535,1293658,1293678,1293708,1294306,1294349,1294356,1294358,1294372,1294471,1297560,1299718,1299786,1300766,1301111,1301725,1302444,1302483,1302653,1302665,1302674,1303201,1303435,1303827,1304087,1304874-1304875,1305167 ,1305586,1306350,1306409,1306426,1306841,1307790,1308327,1308459,1309536,1309567,1311468,1324760,1325218,1325227,1325250,1325265,1325275,1325632,1325724,1326980,1326984,1326991,1327689,1328325-1328326,1328339,1328345,1328950,1330189,1330964,1331110,1331115,1331942,1331977,1332378,1333969,1334343,1335882,1337344,1341906,1341913,1343085,1343087,1343094,1343099,1343109,1343935,1345319,1345329,1346905,1347980,1348036,1348653,1348656,1348660,1349905,1351012-1351020,1351071-1351072,1351074,1351737,1352047,1352534,1352909-1352912,1357685,1358061,1359057,1359881,1359884,1361153,1361298,1361766,1361773,1361778,1361784,1361791-1361792,1361801,1361803,1362020,1362538,1362707,1363035,1363183,1363186,1363312,1363440,1363557,1363589,1363829,1363832,1363836-1363837,1363853,1364133,1364138,1364229,1364601,1364695,1365001,1365020,1365029,1365479,1366319,1366344,1366621,1367778,1367819,1368053,1368058,1368094,1368121,1368131,1368393,1368396,1369419,1369568,1369604,1369618,1369904,1369995,1369999,1370 001,1370466,1370592,1370615-1370616,1370763,1371387,1371791,1371801,1371878,1371903,1373270,1373447,1373898,1373955,1374157,1374199,1374247,1374874,1374877,1374880,1375006,1375009,1375011,1375013,1375584,1376695,1376700,1378178,1383490,1384408,1384913,1386576,1386578,1386726,1386822,1386880,1386913,1387085,1387088,1387110,1387389,1387444,1387603,1387607,1387633,1387693,1387979,1388029,1388445,1388447,1388648,1388660,1388825,1388899,1389316,1389339,1389481,1389506,1389564,1389566-1389569,1390562,1390564,1391396,1391398,1391771,1392120,1392122,1392150,1392214,1392345-1392347,1392850,1393033,1393058,1393152,1393338,1393564,1394079,1395225,1395253-1395256,1395792,1396440,1397172,1397320,1397636,1397687,1397710,1397716,1398025,1398040,1398066,1398478,1398480-1398481,1398970,1399413,1399687,1399708,1400700,1401448,1402924,1403476,1403483,1403492,1404653,1405407,1405856,1405973,1406068,1406493,1406495,1406616,1406646,1406760,1407004,1407006,1407085,1407088,1407248,1407381,1407459-1407460,1 407528,1407853,1407965,1408093,1408402,1408958,1408961,1409170,1409437,1409726,1409800,1410681,1410954,1411862,1412278,1413732,1414094,1415008,1415023,1415075,1416121,1416150,1416278,1417197,1417440,1417529,1418524,1418556,1418648,1418655,1418703,1418721,1418752,1418769,1419084,1419719,1419726,1419755,1419781,1419796,1420120,1420124,1420149,1420184,1420644,1420685-1420686,1420975,1421288,1421323,1421851,1421912,1421953,1422135,1422549,1422594,1422712,1422855,1422937,1422943,1422980,1423353,1423933,1425360,1425771-1425772,1425775,1425777,1425874,1426850,1426975,1427546,1428184,1428280,1428916,1429228,1429559,1429561,1429564,1429582,1430575,1430814,1430869,1433001,1433613,1433682,1433861,1433988,1435178,1435811,1436058,1436401,1439083,1439106,1439114,1439404,1439623,1442309,1442320,1442326,1442412,1442759,1442865,1447993,1448171,1448453,1451478,1451484,1451633,1451849,1451905,1451921,1452128,1452195,1452259,1452281,1452551,1452911,1452949,1452954,1453022,1453574,1453604,1453875-145387 6,1453963,1453981,1454386,1454414-1454415,1454888,1457437,1457450,1457471,1457504,1457520-1457521,1457610,1457995,1458003-1458004,1458020,1458285,1458447,1458456,1462266,1462269,1462643,1463044-1463047,1463052,1463056,1463455,1463736,1463750,1463754,1464675,1464721,1464762,1465115-1465116,1465190,1467765,1468581,1470183,1470679,1470940,1471449,1475878,1476604,1476621,1476642,1476644-1476645,1476652,1476680,1477094,1477530,1478382,1478748,1479117,1479216,1479222,1479411,1479528,1479905,1479966,1480046,1480627,1481197,1481302,1481306,1481396-1481397,1481891,1482041,1482075,1482170,1482555,1482859,1482996,1483005,1483027,1483190,1484343,1484398,1484832,1484910,1484914,1485409,1485668,1486490,1487528,1487530,1488158,1488164,1488296,1488471,1488492,1488644,1490493,1490507,1490550,1490761,1490994,1491155,1491221,1491234,1491458,1491479,1491538,1491564,1491724,1492663,1492710,1492782,1493330,1493921,1493925,1494536,1495501,1496194,1496338,1496429,1496709,1497371,1497588,1498880,1499679,150 0323,1500345,1500362,1500423,1500437,1500483,1500519,1501294,1501369,1501399,1501913,1502665,1502772,1503680,1503866,1503990-1503991,1504276,1506474,1506714,1509872,1509983,1510084-1510085,1510098,1510588,1510707,1511093,1513492,1513508,1514039,1514064,1514214-1514215,1514255,1514267,1514617,1515050,1515162,1515403,1515411,1515420,1517025,1517045,1517175,1517366,1517386,1517388,1518265,1518269,1519475,1520368,1520445,1520760,1520908,1521909,1523235,1523239,1523281,1523387,1524101,1524158,1524192,1524368,1524388,1524770,1525276,1525280-1525281,1525931,1526168,1526189,1526647,1526666,1527008,1527220,1527291,1527294-1527295,1527509,1527925-1527926,1528143,1528718,1529014,1529277,1529449,1529559,1529988,1529991,1530793,1531340,1531370,1531505,1531672,1531961-1531962,1532746,1532816,1533065,1533224,1534321,1534754,1534890,1534892,1536310,1537535,1538490,1540051-1540052,1541181,1541270,1541368,1542338,1542379,1542533,1542562,1542615,1543020,1543147,1543149,1543174,1544381,1544774,1544784, 1544812,1544820,1545286,1545292,1545325,1545364,1545408,1545411,1546692-1546693,1546730,1546759-1546760,1546801,1546804-1546805,1546835-1546836,1547845,1550061,1550302,1550307,1551685,1551714,1551802,1552130,1552227,1553204,1553824,1554161,1554168,1554170,1554175-1554176,1554179,1554181,1554184,1554188,1554192,1554195,1554276,1554281,1554300-1554301,1554994-1554995,1555240,1555259,1555266,1555423-1555424,1555463-1555464,1555467,1555555,1555569,1556206,1556428,1556911-1556912,1556914,1556937,1557317,1557617,1558483,1559351,1559828,1560367,1560546,1560679,1560689,1560729,1560977,1560979,1561137,1561262,1561385,1561660,1561923,1562472,1563193,1563379,1563381,1563417-1563418,1563420,1564052,1564437,1564475,1564756,1564760,1565081,1565711,1568404,1569615,1570288,1570598,1571369,1572092,1572198,1572543,1572561,1572611,1572630,1572655,1572663,1572668-1572671,1572896,1572905,1572911,1572967,1573224,1573229,1573626,1574151,1575400,1576233,1576741,1578760,1578762,1580568,1583005,1583007-15830 08,1583027,1583175,1583191,1584098,1584430,1584434,1584572,1584653,1584658,1584665,1584703,1584878,1584884,1584896,1585054,1585072,1585090,1585435,1585609,1585824,1585918-1585919,1586745,1586827,1587036,1587040,1587053,1587255,1587594,1587607,1587639,1587654,1588054,1588065,1588213,1588330,1588427,1588519,1588527,1588704,1588851,1588853,1588868,1589413,1590437,1590509,1591143,1591320,1591322,1591328,1591390,1591394,1591401,1591472,1591508,1592032,1592037,1592500,1592511,1592514,1592529,1592615,1592632,1593745,1594625,1594643,1594648,1595305,1595321,1595426,1597182,1597349,1597352,1597639,1597642,1598107,1598946,1599535,1601076,1601184-1601185,1601274,1601291,1601624,1601630,1601919,1601995,1602338,1602978,1602989,1603027,1603029,1603122,1603156,1603915,1604382,1604461,1604631,1605207,1605827,1605829,1607960,1608284,1608785,1608999,1609914,1609936,1609938,1610207,1610311,1610353,1610366,1610491,1610652,1610674,1611165,1611169,1611244,1611600,1611871,1611978,1612068,1615026,1615289,16 17018,1618401,1618541,1619297,1619383,1619444,1619483,1619835,1620324,1620461,1620932,1621367,1621372,1621417,1621453,1621806,1622450,1624234,1624349,1625196,1625952,1626050,1626978,1628104,1628918-1628919,1628924,1628950,1629235,1629239,1629244,1629250,1629372,1629440-1629441,1629485,1629507-1629508,1629519,1629577,1629652,1629916,1631885,1632454,1632740,1632742,1633730-1633731,1633793,1634120,1634237,1634425,1634736,1634836,1635510,1635558,1635644-1635645,1635762,1637112,1638072-1638073,1638879,1639614,1640031,1640036,1640040,1640042,1640331,1641077,1641095,1641376,1642099,1642484,1642499,1642847,1642868,1643034,1643284,1643537,1643825,1644245,1646282,1646724,1647035,1648201,1648394,1648433,1648719,1648840,1649001,1649043,1649632,1649966,1650047,1650061,1650309-1650310,1650320,1651088,1652829,1652929,1652931,1652955,1652982,1652985,1652989,1653941,1653978,1653997,1656225,1656669,1657256,1657261,1657636,1657638,1657685,1657881,1657897,1658760,1658765,1661067,1661258,1661448,1661464 ,1661486,1662245-1662246,1663017,1663647,1664071,1664133,1664205,1664299,1664709,1665215,1665218,1665625,1665643,1665721,1666297,1666361,1666363,1666468,1666618,1666998,1667385-1667386,1668532,1668535,1668553,1669130,1669289,1669292,1670434,1671364,1671396-1671397,1671918,1672289,1672453,1672466,1672480,1672483,1672564,1672757,1672985,1672989,1673113,1673155,1673368,1673455,1673769,1674056,1674538,1674542,1674606,1674632,1674697,1675103,1675410,1675533,1676085,1676654,1676709,1676842,1677096,1677143-1677146,1677149,1677151,1677153-1677156,1677159,1677339,1677462,1677702,1677830,1677832,1677834-1677835,1678763,1679032,1679181-1679182,1679192,1679428,1679432,1679470,1679620,1679712,1680276,1680895,1680900,1680942,1681037,1681424,1681440,1681685,1681694,1681795,1682482,1682816,1682819,1682907,1682923,1682937,1682979,1682988,1683044,1683047,1683123,1683881,1683884,1684057,1684171,1684900,1685069,1685339,1685345,1685347,1685349-1685350,1685650,1685659,1685779,1686085,1686853,1686856,1687 539,1687680,1687980,1688274,1688331,1688339-1688341,1688343,1688474-1688475,1688536,1688538,1688660,1689325,1689605,1689694,1689698,1690120,1690137,1690248,1691374,1691582,1691592,1691819,1691908,1692285,1692432,1692486,1692516,1693792,1693918-1693919,1693963,1694903,1694936,1694950-1694951,1695170,1695727,1695874,1695885,1695920,1696105,1696264,1696266,1696279,1696428,1696442,1696565,1696592,1696607,1696755,1696881,1697013,1697015,1697051,1697323,1697339,1697370,1697389,1697446,1697543,1697634,1697855,1698023,1698103,1698107,1698116,1698133,1698330,1700271,1700275,1700317-1700322,1700326,1700328,1700330-1700332,1700334,1700336,1700338,1700418,1700514,1700777,1700851,1700917,1700925,1700968,1701005,1701145,1701178,1701204,1701347,1701436,1701545,1701717,1702643,1702919,1703152,1703417,1703642,1703807,1703813,1703822,1703871,1703902,1703952,1704099,1704241,1704262,1704797,1704799,1704826,1705099,1705134,1705194,1705217,1705257,1705749,1705776,1705823,1705826,1705828,1705833,1705983,1 706275,1706627,1706635,1706637,1706640,1706918,1706942,1706989,1707002,1707230-1707231,1707497,1707519,1707591,1707626-1707627,1707640,1707831,1707883,1707889,1708107,1709008,1709587,1709596,1709602,1709995,1710095,1710105,1710231,1710380,1710391,1710419,1710572,1710583,1710723,1711479,1711553,1711648,1711728,1711902,1712382,1713040,1713209,1713937,1715023,1715255,1715273,1715567-1715568,1715570-1715572,1715576,1715581-1715585,1715886,1716211,1716388,1716460,1716487,1716660,1716940,1717063,1717086,1717639,1717816,1717934,1717958,1717975,1717985,1718314,1718338,1718400,1718514,1718556,1718569,1718598,1719016,1719018,1719189-1719190,1719252,1719254-1719255,1719257,1719967,1720129,1720996,1721313,1721685,1721899,1722137,1722154,1722177,1722195,1722229,1722320,1722328,1722334,1722350-1722351,1722358,1722377,1722572,1722701,1723122,1723143,1723284,1723295,1723567,1723953,1724847,1724857,1724879,1724992-1724993,1724995,1725018,1725031,1725090,1725120,1725149,1725325,1725328,1725387,172539 2,1725394-1725395,1725445,1725468,1725485,1725489,1725498-1725499,1725516,1725523,1725545,1725567,1725581,1725602,1725822,1725940,1725967,1726009,1726026,1726038,1726049,1726051-1726052,1726055,1726086,1726167,1726233,1726798,1726881,1726888,1727071,1727111,1727317,1727544,1727573,1727603,1727842,1728326,1729208,1729374,1729376,1729826,1729847,1729929-1729931,1729960,1730297,1730640,1730723,1730865,1731929,1732252,1732353,1732369,1732716,1732954,1732986,1733056,1733064,1733068,1733088-1733089,1733275,1733523,1733537,1733691,1734006,1734125,1734239,1734294,1734412,1734561,1734807,1734817,1734947,1734955,1734989,1735088,1735159,1735337,1735608-1735609,1735611,1735668,1735786,1735931,1735935,1735942,1735952,1736156,1736243,1736250,1736463,1736681,1736686,1737006,1737014,1737020-1737021,1737102,1737114,1737125,1737254,1737256,1737265,1737447,1737449,1737451,1737476,1738217,1738331,1738333,1738563,1739008,1739146,1739151,1739193,1739303,1739312,1739738,1739932,1740075,1740084,1740108,174 0110,1740155,1740735,1741045,1741065,1741112,1741115,1741268,1741310,1741392,1741414,1741446,1741461,1741557,1741564,1741596,1741621,1741648,1741934,1742005,1742135,1742260,1742359,1742444-1742447,1742460,1742791-1742792,1743335,1743517,1743699,1743788,1743816,1744203-1744204,1744206,1744283,1744415,1744421,1744458-1744459,1744712,1744751,1744767,1744778,1744980,1745034,1745175,1745767,1745835,1746207,1746647,1746988,1747170,1747531,1747550,1747735,1747808,1747810,1747946,1748047,1748368,1748448,1748531,1748653,1748888,1749151,1749401,1749404,1749505,1749658-1749659,1749676,1749678,1749695,1749924-1749925,1750043,1750218,1750335,1750407,1750420,1750507,1750553,1750567,1750750,1750779,1751970,1752087,1752096,1752145,1752415,1753224,1753228-1753229,1753498,1753541,1753592,1753594,1753777,1754129,1754414,1754534,1755323,1756844,1757524,1757534,1757540 Modified: httpd/httpd/branches/2.4.x/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original) +++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Wed Aug 24 15:23:12 2016 @@ -2,6 +2,13 @@ Changes with Apache 2.4.24 + *) mod_http2: h2 status resource follows latest draft, see + http://www.ietf.org/id/draft-benfield-http2-debug-state-01.txt + [Stefan Eissing] + + *) mod_http2: handling graceful shutdown gracefully, e.g. handling existing + streams to the end. [Stefan Eissing] + *) core: CVE-2016-5387: Mitigate [f]cgi "httpoxy" issues. [Dominic Scheirlinck , Yann Ylavic] Modified: httpd/httpd/branches/2.4.x/modules/http2/h2.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2.h?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2.h (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2.h Wed Aug 24 15:23:12 2016 @@ -95,8 +95,6 @@ typedef enum { H2_SESSION_ST_IDLE, /* nothing to write, expecting data inc */ H2_SESSION_ST_BUSY, /* read/write without stop */ H2_SESSION_ST_WAIT, /* waiting for tasks reporting back */ - H2_SESSION_ST_LOCAL_SHUTDOWN, /* we announced GOAWAY */ - H2_SESSION_ST_REMOTE_SHUTDOWN, /* client announced GOAWAY */ } h2_session_state; typedef struct h2_session_props { @@ -106,6 +104,7 @@ typedef struct h2_session_props { apr_uint32_t emitted_max; /* the highest local stream id sent */ apr_uint32_t error; /* the last session error encountered */ unsigned int accepting : 1; /* if the session is accepting new streams */ + unsigned int shutdown : 1; /* if the final GOAWAY has been sent */ } h2_session_props; @@ -146,6 +145,8 @@ struct h2_response { apr_off_t content_length; apr_table_t *headers; apr_table_t *trailers; + struct h2_response *next; + const char *sos_filter; }; Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_filter.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_filter.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_filter.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_filter.c Wed Aug 24 15:23:12 2016 @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -23,6 +24,7 @@ #include "h2_private.h" #include "h2.h" +#include "h2_config.h" #include "h2_conn_io.h" #include "h2_ctx.h" #include "h2_mplx.h" @@ -31,6 +33,7 @@ #include "h2_stream.h" #include "h2_request.h" #include "h2_response.h" +#include "h2_stream.h" #include "h2_session.h" #include "h2_util.h" #include "h2_version.h" @@ -209,15 +212,138 @@ static apr_status_t bbout(apr_bucket_bri return rv; } -static apr_status_t h2_status_stream_filter(h2_stream *stream) +static void add_settings(apr_bucket_brigade *bb, h2_session *s, int last) { - h2_session *session = stream->session; - h2_mplx *mplx = session->mplx; - conn_rec *c = session->c; - h2_push_diary *diary; + h2_mplx *m = s->mplx; + + bbout(bb, " \"settings\": {\n"); + bbout(bb, " \"SETTINGS_MAX_CONCURRENT_STREAMS\": %d,\n", m->max_streams); + bbout(bb, " \"SETTINGS_MAX_FRAME_SIZE\": %d,\n", 16*1024); + bbout(bb, " \"SETTINGS_INITIAL_WINDOW_SIZE\": %d,\n", + h2_config_geti(s->config, H2_CONF_WIN_SIZE)); + bbout(bb, " \"SETTINGS_ENABLE_PUSH\": %d\n", h2_session_push_enabled(s)); + bbout(bb, " }%s\n", last? "" : ","); +} + +static void add_peer_settings(apr_bucket_brigade *bb, h2_session *s, int last) +{ + bbout(bb, " \"peerSettings\": {\n"); + bbout(bb, " \"SETTINGS_MAX_CONCURRENT_STREAMS\": %d,\n", + nghttp2_session_get_remote_settings(s->ngh2, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS)); + bbout(bb, " \"SETTINGS_MAX_FRAME_SIZE\": %d,\n", + nghttp2_session_get_remote_settings(s->ngh2, NGHTTP2_SETTINGS_MAX_FRAME_SIZE)); + bbout(bb, " \"SETTINGS_INITIAL_WINDOW_SIZE\": %d,\n", + nghttp2_session_get_remote_settings(s->ngh2, NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE)); + bbout(bb, " \"SETTINGS_ENABLE_PUSH\": %d,\n", + nghttp2_session_get_remote_settings(s->ngh2, NGHTTP2_SETTINGS_ENABLE_PUSH)); + bbout(bb, " \"SETTINGS_HEADER_TABLE_SIZE\": %d,\n", + nghttp2_session_get_remote_settings(s->ngh2, NGHTTP2_SETTINGS_HEADER_TABLE_SIZE)); + bbout(bb, " \"SETTINGS_MAX_HEADER_LIST_SIZE\": %d\n", + nghttp2_session_get_remote_settings(s->ngh2, NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE)); + bbout(bb, " }%s\n", last? "" : ","); +} + +typedef struct { apr_bucket_brigade *bb; + h2_session *s; + int idx; +} stream_ctx_t; + +static int add_stream(h2_stream *stream, void *ctx) +{ + stream_ctx_t *x = ctx; + int32_t flowIn, flowOut; + + flowIn = nghttp2_session_get_stream_effective_local_window_size(x->s->ngh2, stream->id); + flowOut = nghttp2_session_get_stream_remote_window_size(x->s->ngh2, stream->id); + bbout(x->bb, "%s\n \"%d\": {\n", (x->idx? "," : ""), stream->id); + bbout(x->bb, " \"state\": \"%s\",\n", h2_stream_state_str(stream)); + bbout(x->bb, " \"created\": %f,\n", ((double)stream->created)/APR_USEC_PER_SEC); + bbout(x->bb, " \"flowIn\": %d,\n", flowIn); + bbout(x->bb, " \"flowOut\": %d,\n", flowOut); + bbout(x->bb, " \"dataIn\": %"APR_UINT64_T_FMT",\n", stream->in_data_octets); + bbout(x->bb, " \"dataOut\": %"APR_UINT64_T_FMT"\n", stream->out_data_octets); + bbout(x->bb, " }"); + + ++x->idx; + return 1; +} + +static void add_streams(apr_bucket_brigade *bb, h2_session *s, int last) +{ + stream_ctx_t x; + + x.bb = bb; + x.s = s; + x.idx = 0; + bbout(bb, " \"streams\": {"); + h2_mplx_stream_do(s->mplx, add_stream, &x); + bbout(bb, "\n }%s\n", last? "" : ","); +} + +static void add_push(apr_bucket_brigade *bb, h2_session *s, + h2_stream *stream, int last) +{ + h2_push_diary *diary; apr_status_t status; + bbout(bb, " \"push\": {\n"); + diary = s->push_diary; + if (diary) { + const char *data; + const char *base64_digest; + apr_size_t len; + + status = h2_push_diary_digest_get(diary, bb->p, 256, + stream->request->authority, + &data, &len); + if (status == APR_SUCCESS) { + base64_digest = h2_util_base64url_encode(data, len, bb->p); + bbout(bb, " \"cacheDigest\": \"%s\",\n", base64_digest); + } + } + bbout(bb, " \"promises\": %d,\n", s->pushes_promised); + bbout(bb, " \"submits\": %d,\n", s->pushes_submitted); + bbout(bb, " \"resets\": %d\n", s->pushes_reset); + bbout(bb, " }%s\n", last? "" : ","); +} + +static void add_in(apr_bucket_brigade *bb, h2_session *s, int last) +{ + bbout(bb, " \"in\": {\n"); + bbout(bb, " \"requests\": %d,\n", s->remote.emitted_count); + bbout(bb, " \"resets\": %d, \n", s->streams_reset); + bbout(bb, " \"frames\": %ld,\n", (long)s->frames_received); + bbout(bb, " \"octets\": %"APR_UINT64_T_FMT"\n", s->io.bytes_read); + bbout(bb, " }%s\n", last? "" : ","); +} + +static void add_out(apr_bucket_brigade *bb, h2_session *s, int last) +{ + bbout(bb, " \"out\": {\n"); + bbout(bb, " \"responses\": %d,\n", s->responses_submitted); + bbout(bb, " \"frames\": %ld,\n", (long)s->frames_sent); + bbout(bb, " \"octets\": %"APR_UINT64_T_FMT"\n", s->io.bytes_written); + bbout(bb, " }%s\n", last? "" : ","); +} + +static void add_stats(apr_bucket_brigade *bb, h2_session *s, + h2_stream *stream, int last) +{ + bbout(bb, " \"stats\": {\n"); + add_in(bb, s, 0); + add_out(bb, s, 0); + add_push(bb, s, stream, 1); + bbout(bb, " }%s\n", last? "" : ","); +} + +static apr_status_t h2_status_stream_filter(h2_stream *stream) +{ + h2_session *s = stream->session; + conn_rec *c = s->c; + apr_bucket_brigade *bb; + int32_t connFlowIn, connFlowOut; + if (!stream->response) { return APR_EINVAL; } @@ -230,50 +356,24 @@ static apr_status_t h2_status_stream_fil apr_table_unset(stream->response->headers, "Content-Length"); stream->response->content_length = -1; + connFlowIn = nghttp2_session_get_effective_local_window_size(s->ngh2); + connFlowOut = nghttp2_session_get_remote_window_size(s->ngh2); + apr_table_setn(stream->response->headers, "conn-flow-in", + apr_itoa(stream->pool, connFlowIn)); + apr_table_setn(stream->response->headers, "conn-flow-out", + apr_itoa(stream->pool, connFlowOut)); + bbout(bb, "{\n"); - bbout(bb, " \"HTTP2\": \"on\",\n"); - bbout(bb, " \"H2PUSH\": \"%s\",\n", h2_session_push_enabled(session)? "on" : "off"); - bbout(bb, " \"mod_http2_version\": \"%s\",\n", MOD_HTTP2_VERSION); - bbout(bb, " \"session_id\": %ld,\n", (long)session->id); - bbout(bb, " \"streams_max\": %d,\n", (int)session->max_stream_count); - bbout(bb, " \"this_stream\": %d,\n", stream->id); - bbout(bb, " \"streams_open\": %d,\n", (int)h2_ihash_count(session->streams)); - bbout(bb, " \"max_stream_started\": %d,\n", mplx->max_stream_started); - bbout(bb, " \"requests_received\": %d,\n", session->remote.emitted_count); - bbout(bb, " \"responses_submitted\": %d,\n", session->responses_submitted); - bbout(bb, " \"streams_reset\": %d, \n", session->streams_reset); - bbout(bb, " \"pushes_promised\": %d,\n", session->pushes_promised); - bbout(bb, " \"pushes_submitted\": %d,\n", session->pushes_submitted); - bbout(bb, " \"pushes_reset\": %d,\n", session->pushes_reset); + bbout(bb, " \"version\": \"draft-01\",\n"); + add_settings(bb, s, 0); + add_peer_settings(bb, s, 0); + bbout(bb, " \"connFlowIn\": %d,\n", connFlowIn); + bbout(bb, " \"connFlowOut\": %d,\n", connFlowOut); + bbout(bb, " \"sentGoAway\": %d,\n", s->local.shutdown); + + add_streams(bb, s, 0); - diary = session->push_diary; - if (diary) { - const char *data; - const char *base64_digest; - apr_size_t len; - - status = h2_push_diary_digest_get(diary, stream->pool, 256, - stream->request->authority, &data, &len); - if (status == APR_SUCCESS) { - base64_digest = h2_util_base64url_encode(data, len, stream->pool); - bbout(bb, " \"cache_digest\": \"%s\",\n", base64_digest); - } - - /* try the reverse for testing purposes */ - status = h2_push_diary_digest_set(diary, stream->request->authority, data, len); - if (status == APR_SUCCESS) { - status = h2_push_diary_digest_get(diary, stream->pool, 256, - stream->request->authority, &data, &len); - if (status == APR_SUCCESS) { - base64_digest = h2_util_base64url_encode(data, len, stream->pool); - bbout(bb, " \"cache_digest^2\": \"%s\",\n", base64_digest); - } - } - } - bbout(bb, " \"frames_received\": %ld,\n", (long)session->frames_received); - bbout(bb, " \"frames_sent\": %ld,\n", (long)session->frames_sent); - bbout(bb, " \"bytes_received\": %"APR_UINT64_T_FMT",\n", session->io.bytes_read); - bbout(bb, " \"bytes_sent\": %"APR_UINT64_T_FMT"\n", session->io.bytes_written); + add_stats(bb, s, stream, 1); bbout(bb, "}\n"); return APR_SUCCESS; Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_from_h1.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_from_h1.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_from_h1.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_from_h1.c Wed Aug 24 15:23:12 2016 @@ -471,7 +471,8 @@ static h2_response *create_response(h2_f (void *) headers, r->headers_out, NULL); } - return h2_response_rcreate(from_h1->stream_id, r, headers, r->pool); + return h2_response_rcreate(from_h1->stream_id, r, r->status, + headers, r->pool); } apr_status_t h2_response_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.c Wed Aug 24 15:23:12 2016 @@ -196,12 +196,17 @@ static int purge_stream(void *ctx, void { h2_mplx *m = ctx; h2_stream *stream = val; - h2_task *task = h2_ihash_get(m->tasks, stream->id); - h2_ihash_remove(m->spurge, stream->id); + int stream_id = stream->id; + h2_task *task = h2_ihash_get(m->tasks, stream_id); + + h2_ihash_remove(m->spurge, stream_id); h2_stream_destroy(stream); if (task) { task_destroy(m, task, 1); } + /* FIXME: task_destroy() might in some twisted way place the + * stream in the spurge hash again. Remove it last. */ + h2_ihash_remove(m->spurge, stream_id); return 0; } @@ -212,6 +217,7 @@ static void purge_streams(h2_mplx *m) /* repeat until empty */ } h2_ihash_clear(m->spurge); + AP_DEBUG_ASSERT(h2_ihash_empty(m->spurge)); } } @@ -467,6 +473,33 @@ static int stream_done_iter(void *ctx, v return 0; } +typedef struct { + h2_mplx_stream_cb *cb; + void *ctx; +} stream_iter_ctx_t; + +static int stream_iter_wrap(void *ctx, void *stream) +{ + stream_iter_ctx_t *x = ctx; + return x->cb(stream, x->ctx); +} + +apr_status_t h2_mplx_stream_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx) +{ + apr_status_t status; + int acquired; + + if ((status = enter_mutex(m, &acquired)) == APR_SUCCESS) { + stream_iter_ctx_t x; + x.cb = cb; + x.ctx = ctx; + h2_ihash_iter(m->streams, stream_iter_wrap, &x); + + leave_mutex(m, acquired); + } + return status; +} + static int task_print(void *ctx, void *val) { h2_mplx *m = ctx; @@ -477,13 +510,13 @@ static int task_print(void *ctx, void *v ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, /* NO APLOGNO */ "->03198: h2_stream(%s): %s %s %s -> %s %d" - "[orph=%d/started=%d/done=%d]", + "[orph=%d/started=%d/done=%d/frozen=%d]", task->id, task->request->method, task->request->authority, task->request->path, task->response? "http" : (task->rst_error? "reset" : "?"), task->response? task->response->http_status : task->rst_error, (stream? 0 : 1), task->worker_started, - task->worker_done); + task->worker_done, task->frozen); } else if (task) { ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, /* NO APLOGNO */ @@ -566,8 +599,11 @@ apr_status_t h2_mplx_release_and_join(h2 if (!h2_ihash_empty(m->shold)) { ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, - "h2_mplx(%ld): 2. release_join with %d streams in hold", - m->id, (int)h2_ihash_count(m->shold)); + "h2_mplx(%ld): 2. release_join with %d streams in " + "hold, %d workers busy, %d tasks", + m->id, (int)h2_ihash_count(m->shold), + m->workers_busy, + (int)h2_ihash_count(m->tasks)); } if (!h2_ihash_empty(m->spurge)) { ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, @@ -608,6 +644,12 @@ apr_status_t h2_mplx_release_and_join(h2 } } + if (!h2_ihash_empty(m->tasks) && APLOGctrace1(m->c)) { + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, + "h2_mplx(%ld): 3. release_join with %d tasks", + m->id, (int)h2_ihash_count(m->tasks)); + h2_ihash_iter(m->tasks, task_print, m); + } AP_DEBUG_ASSERT(h2_ihash_empty(m->shold)); if (!h2_ihash_empty(m->spurge)) { ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, @@ -615,7 +657,6 @@ apr_status_t h2_mplx_release_and_join(h2 m->id, (int)h2_ihash_count(m->spurge)); purge_streams(m); } - AP_DEBUG_ASSERT(h2_ihash_empty(m->spurge)); if (!h2_ihash_empty(m->tasks)) { ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, m->c, APLOGNO(03056) @@ -675,13 +716,15 @@ static apr_status_t out_open(h2_mplx *m, return APR_ECONNABORTED; } - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, - "h2_mplx(%s): open response: %d, rst=%d", + status = h2_task_add_response(task, response); + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c, + "h2_mplx(%s): add response: %d, rst=%d", task->id, response->http_status, response->rst_error); + if (status != APR_SUCCESS) { + return status; + } - h2_task_set_response(task, response); - - if (task->output.beam) { + if (task->output.beam && !task->output.opened) { h2_beam_buffer_size_set(task->output.beam, m->stream_max_mem); h2_beam_timeout_set(task->output.beam, m->stream_timeout); h2_beam_on_consumed(task->output.beam, stream_output_consumed, task); @@ -690,6 +733,7 @@ static apr_status_t out_open(h2_mplx *m, h2_beam_on_file_beam(task->output.beam, can_beam_file, m); } h2_beam_mutex_set(task->output.beam, beam_enter, task->cond, m); + task->output.opened = 1; } h2_ihash_add(m->sready, stream); @@ -1375,13 +1419,21 @@ apr_status_t h2_mplx_dispatch_master_eve m->id, stream->id); task = h2_ihash_get(m->tasks, stream->id); if (task) { - task->submitted = 1; + task->response_sent = 1; if (task->rst_error) { h2_stream_rst(stream, task->rst_error); } else { AP_DEBUG_ASSERT(task->response); - h2_stream_set_response(stream, task->response, task->output.beam); + status = h2_stream_add_response(stream, task->response, + task->output.beam); + if (status != APR_SUCCESS) { + h2_stream_rst(stream, H2_ERR_INTERNAL_ERROR); + } + if (!h2_response_get_final(task->response)) { + /* the final response needs still to arrive */ + task->response = NULL; + } } } else { @@ -1449,7 +1501,7 @@ apr_status_t h2_mplx_suspend_stream(h2_m if (stream->started && (!task || task->worker_done)) { h2_ihash_add(m->sresume, stream); } - else { + else if (task->output.beam) { /* register callback so that we can resume on new output */ h2_beam_on_produced(task->output.beam, output_produced, m); } Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.h?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.h (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_mplx.h Wed Aug 24 15:23:12 2016 @@ -230,6 +230,11 @@ apr_status_t h2_mplx_dispatch_master_eve apr_status_t h2_mplx_suspend_stream(h2_mplx *m, int stream_id); + +typedef int h2_mplx_stream_cb(struct h2_stream *s, void *ctx); + +apr_status_t h2_mplx_stream_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx); + /******************************************************************************* * Output handling of streams. ******************************************************************************/ Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_ngn_shed.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_ngn_shed.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_ngn_shed.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_ngn_shed.c Wed Aug 24 15:23:12 2016 @@ -168,6 +168,12 @@ apr_status_t h2_ngn_shed_push_task(h2_ng return APR_EOF; } + if (task->assigned) { + --task->assigned->no_assigned; + --task->assigned->no_live; + task->assigned = NULL; + } + ngn = apr_hash_get(shed->ngns, ngn_type, APR_HASH_KEY_STRING); if (ngn && !ngn->shutdown) { /* this task will be processed in another thread, @@ -178,7 +184,6 @@ apr_status_t h2_ngn_shed_push_task(h2_ng if (!h2_task_is_detached(task)) { h2_task_freeze(task); } - /* FIXME: sometimes ngn is garbage, probly alread freed */ ngn_add_task(ngn, task); ngn->no_assigned++; return APR_SUCCESS; Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_request.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_request.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_request.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_request.c Wed Aug 24 15:23:12 2016 @@ -249,7 +249,8 @@ request_rec *h2_request_create_rec(const request_rec *r; apr_pool_t *p; int access_status = HTTP_OK; - + const char *expect; + apr_pool_create(&p, conn->pool); apr_pool_tag(p, "request"); r = apr_pcalloc(p, sizeof(request_rec)); @@ -327,6 +328,18 @@ request_rec *h2_request_create_rec(const /* we may have switched to another server */ r->per_dir_config = r->server->lookup_defaults; + if (r && ((expect = apr_table_get(r->headers_in, "Expect")) != NULL) + && (expect[0] != '\0')) { + if (ap_cstr_casecmp(expect, "100-continue") == 0) { + r->expecting_100 = 1; + ap_add_input_filter("H2_CONTINUE", NULL, r, conn); + } + else { + r->status = HTTP_EXPECTATION_FAILED; + ap_send_error_response(r, 0); + } + } + /* * Add the HTTP_IN filter here to ensure that ap_discard_request_body * called by ap_die and by ap_send_error_response works correctly on @@ -350,7 +363,7 @@ request_rec *h2_request_create_rec(const r = NULL; goto traceout; } - + AP_READ_REQUEST_SUCCESS((uintptr_t)r, (char *)r->method, (char *)r->uri, (char *)r->server->defn_name, r->status); Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_response.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_response.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_response.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_response.c Wed Aug 24 15:23:12 2016 @@ -133,7 +133,7 @@ h2_response *h2_response_create(int stre parse_headers(hlines, pool), notes, pool); } -h2_response *h2_response_rcreate(int stream_id, request_rec *r, +h2_response *h2_response_rcreate(int stream_id, request_rec *r, int status, apr_table_t *header, apr_pool_t *pool) { h2_response *response = apr_pcalloc(pool, sizeof(h2_response)); @@ -142,9 +142,9 @@ h2_response *h2_response_rcreate(int str } response->stream_id = stream_id; - response->http_status = r->status; + response->http_status = status; response->content_length = -1; - response->headers = header; + response->headers = header? header : apr_table_make(pool, 5); response->sos_filter = get_sos_filter(r->notes); check_clen(response, r, pool); @@ -203,3 +203,17 @@ void h2_response_set_trailers(h2_respons response->trailers = trailers; } +int h2_response_is_final(h2_response *response) +{ + return response->http_status >= 200; +} + +h2_response *h2_response_get_final(h2_response *response) +{ + for (/**/; response; response = response->next) { + if (h2_response_is_final(response)) { + return response; + } + } + return NULL; +} Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_response.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_response.h?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_response.h (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_response.h Wed Aug 24 15:23:12 2016 @@ -40,7 +40,7 @@ h2_response *h2_response_create(int stre * @param header the headers of the response * @param pool the memory pool to use */ -h2_response *h2_response_rcreate(int stream_id, request_rec *r, +h2_response *h2_response_rcreate(int stream_id, request_rec *r, int status, apr_table_t *header, apr_pool_t *pool); /** @@ -70,4 +70,7 @@ h2_response *h2_response_clone(apr_pool_ */ void h2_response_set_trailers(h2_response *response, apr_table_t *trailers); +int h2_response_is_final(h2_response *response); +h2_response *h2_response_get_final(h2_response *response); + #endif /* defined(__mod_h2__h2_response__) */ Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_session.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_session.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_session.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_session.c Wed Aug 24 15:23:12 2016 @@ -75,7 +75,6 @@ static apr_status_t h2_session_receive(v const char *data, apr_size_t len, apr_size_t *readlen); -static int is_accepting_streams(h2_session *session); static void dispatch_event(h2_session *session, h2_session_event_t ev, int err, const char *msg); @@ -285,11 +284,6 @@ static int on_data_chunk_recv_cb(nghttp2 int rv; (void)flags; - if (!is_accepting_streams(session)) { - /* ignore */ - return 0; - } - stream = get_stream(session, stream_id); if (!stream) { ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03064) @@ -398,11 +392,6 @@ static int on_header_cb(nghttp2_session apr_status_t status; (void)flags; - if (!is_accepting_streams(session)) { - /* just ignore */ - return 0; - } - stream = get_stream(session, frame->hd.stream_id); if (!stream) { ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, session->c, @@ -519,9 +508,16 @@ static int on_frame_recv_cb(nghttp2_sess } break; case NGHTTP2_GOAWAY: - session->remote.accepted_max = frame->goaway.last_stream_id; - session->remote.error = frame->goaway.error_code; - dispatch_event(session, H2_SESSION_EV_REMOTE_GOAWAY, 0, NULL); + if (frame->goaway.error_code == 0 + && frame->goaway.last_stream_id == ((1u << 31) - 1)) { + /* shutdown notice. Should not come from a client... */ + session->remote.accepting = 0; + } + else { + session->remote.accepted_max = frame->goaway.last_stream_id; + dispatch_event(session, H2_SESSION_EV_REMOTE_GOAWAY, + frame->goaway.error_code, NULL); + } break; default: if (APLOGctrace2(session->c)) { @@ -628,7 +624,8 @@ static int on_send_data_cb(nghttp2_sessi apr_brigade_cleanup(session->bbtmp); if (status == APR_SUCCESS) { - stream->data_frames_sent++; + stream->out_data_frames++; + stream->out_data_octets += length; return 0; } else { @@ -714,12 +711,35 @@ static void h2_session_destroy(h2_sessio } } +static apr_status_t h2_session_shutdown_notice(h2_session *session) +{ + apr_status_t status; + + AP_DEBUG_ASSERT(session); + if (!session->local.accepting) { + return APR_SUCCESS; + } + + nghttp2_submit_shutdown_notice(session->ngh2); + session->local.accepting = 0; + status = nghttp2_session_send(session->ngh2); + if (status == APR_SUCCESS) { + status = h2_conn_io_flush(&session->io); + } + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO() + "session(%ld): sent shutdown notice", session->id); + return status; +} + static apr_status_t h2_session_shutdown(h2_session *session, int error, const char *msg, int force_close) { apr_status_t status = APR_SUCCESS; AP_DEBUG_ASSERT(session); + if (session->local.shutdown) { + return APR_SUCCESS; + } if (!msg && error) { msg = nghttp2_strerror(error); } @@ -743,6 +763,8 @@ static apr_status_t h2_session_shutdown( nghttp2_submit_goaway(session->ngh2, NGHTTP2_FLAG_NONE, session->local.accepted_max, error, (uint8_t*)msg, msg? strlen(msg):0); + session->local.accepting = 0; + session->local.shutdown = 1; status = nghttp2_session_send(session->ngh2); if (status == APR_SUCCESS) { status = h2_conn_io_flush(&session->io); @@ -772,8 +794,7 @@ static apr_status_t session_pool_cleanup ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, "session(%ld): pool_cleanup", session->id); - if (session->state != H2_SESSION_ST_DONE - && session->state != H2_SESSION_ST_LOCAL_SHUTDOWN) { + if (session->state != H2_SESSION_ST_DONE) { /* Not good. The connection is being torn down and we have * not sent a goaway. This is considered a protocol error and * the client has to assume that any streams "in flight" may have @@ -1179,12 +1200,6 @@ static ssize_t stream_data_cb(nghttp2_se return (ssize_t)nread; } -typedef struct { - nghttp2_nv *nv; - size_t nvlen; - size_t offset; -} nvctx_t; - struct h2_stream *h2_session_push(h2_session *session, h2_stream *is, h2_push *push) { @@ -1418,18 +1433,28 @@ static apr_status_t on_stream_response(v if (!stream) { return APR_NOTFOUND; } - - response = h2_stream_get_response(stream); - AP_DEBUG_ASSERT(response || stream->rst_error); - - if (stream->submitted) { - rv = NGHTTP2_PROTOCOL_ERROR; + else if (!stream->response) { + int err = H2_STREAM_RST(stream, H2_ERR_PROTOCOL_ERROR); + + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03074) + "h2_stream(%ld-%d): RST_STREAM, err=%d", + session->id, stream->id, err); + + rv = nghttp2_submit_rst_stream(session->ngh2, NGHTTP2_FLAG_NONE, + stream->id, err); + goto leave; } - else if (response && response->headers) { + + while ((response = h2_stream_get_unsent_response(stream)) != NULL) { nghttp2_data_provider provider, *pprovider = NULL; h2_ngheader *ngh; const h2_priority *prio; + if (stream->submitted) { + rv = NGHTTP2_PROTOCOL_ERROR; + goto leave; + } + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03073) "h2_stream(%ld-%d): submit response %d, REMOTE_WINDOW_SIZE=%u", session->id, stream->id, response->http_status, @@ -1457,7 +1482,9 @@ static apr_status_t on_stream_response(v * as the client, having this resource in its cache, might * also have the pushed ones as well. */ - if (stream->request && !stream->request->initiated_on + if (stream->request + && !stream->request->initiated_on + && h2_response_is_final(response) && H2_HTTP_2XX(response->http_status) && h2_session_push_enabled(session)) { @@ -1467,35 +1494,24 @@ static apr_status_t on_stream_response(v prio = h2_stream_get_priority(stream); if (prio) { h2_session_set_prio(session, stream, prio); - /* no showstopper if that fails for some reason */ } ngh = h2_util_ngheader_make_res(stream->pool, response->http_status, response->headers); rv = nghttp2_submit_response(session->ngh2, response->stream_id, ngh->nv, ngh->nvlen, pprovider); - } - else { - int err = H2_STREAM_RST(stream, H2_ERR_PROTOCOL_ERROR); + stream->submitted = h2_response_is_final(response); + session->have_written = 1; - ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03074) - "h2_stream(%ld-%d): RST_STREAM, err=%d", - session->id, stream->id, err); - - rv = nghttp2_submit_rst_stream(session->ngh2, NGHTTP2_FLAG_NONE, - stream->id, err); - } - - stream->submitted = 1; - session->have_written = 1; - - if (stream->request && stream->request->initiated_on) { - ++session->pushes_submitted; - } - else { - ++session->responses_submitted; + if (stream->request && stream->request->initiated_on) { + ++session->pushes_submitted; + } + else { + ++session->responses_submitted; + } } +leave: if (nghttp2_is_fatal(rv)) { status = APR_EGENERAL; dispatch_event(session, H2_SESSION_EV_PROTO_ERROR, rv, nghttp2_strerror(rv)); @@ -1600,9 +1616,6 @@ static apr_status_t h2_session_read(h2_s * status. */ return rstatus; } - if (!is_accepting_streams(session)) { - break; - } if ((session->io.bytes_read - read_start) > (64*1024)) { /* read enough in one go, give write a chance */ ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, c, @@ -1653,8 +1666,6 @@ static const char *StateNames[] = { "IDLE", /* H2_SESSION_ST_IDLE */ "BUSY", /* H2_SESSION_ST_BUSY */ "WAIT", /* H2_SESSION_ST_WAIT */ - "LSHUTDOWN", /* H2_SESSION_ST_LOCAL_SHUTDOWN */ - "RSHUTDOWN", /* H2_SESSION_ST_REMOTE_SHUTDOWN */ }; static const char *state_name(h2_session_state state) @@ -1665,18 +1676,6 @@ static const char *state_name(h2_session return StateNames[state]; } -static int is_accepting_streams(h2_session *session) -{ - switch (session->state) { - case H2_SESSION_ST_IDLE: - case H2_SESSION_ST_BUSY: - case H2_SESSION_ST_WAIT: - return 1; - default: - return 0; - } -} - static void update_child_status(h2_session *session, int status, const char *msg) { /* Assume that we also change code/msg when something really happened and @@ -1698,7 +1697,12 @@ static void update_child_status(h2_sessi static void transit(h2_session *session, const char *action, h2_session_state nstate) { if (session->state != nstate) { - ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03078) + int loglvl = APLOG_DEBUG; + if ((session->state == H2_SESSION_ST_BUSY && nstate == H2_SESSION_ST_WAIT) + || (session->state == H2_SESSION_ST_WAIT && nstate == H2_SESSION_ST_BUSY)){ + loglvl = APLOG_TRACE1; + } + ap_log_cerror(APLOG_MARK, loglvl, 0, session->c, APLOGNO(03078) "h2_session(%ld): transit [%s] -- %s --> [%s]", session->id, state_name(session->state), action, state_name(nstate)); session->state = nstate; @@ -1708,12 +1712,6 @@ static void transit(h2_session *session, SERVER_BUSY_KEEPALIVE : SERVER_BUSY_READ), "idle"); break; - case H2_SESSION_ST_REMOTE_SHUTDOWN: - update_child_status(session, SERVER_CLOSING, "remote goaway"); - break; - case H2_SESSION_ST_LOCAL_SHUTDOWN: - update_child_status(session, SERVER_CLOSING, "local goaway"); - break; case H2_SESSION_ST_DONE: update_child_status(session, SERVER_CLOSING, "done"); break; @@ -1738,39 +1736,22 @@ static void h2_session_ev_init(h2_sessio static void h2_session_ev_local_goaway(h2_session *session, int arg, const char *msg) { - session->local.accepting = 0; cleanup_streams(session); - switch (session->state) { - case H2_SESSION_ST_LOCAL_SHUTDOWN: - /* already did that? */ - break; - case H2_SESSION_ST_IDLE: - case H2_SESSION_ST_REMOTE_SHUTDOWN: - /* all done */ - transit(session, "local goaway", H2_SESSION_ST_DONE); - break; - default: - transit(session, "local goaway", H2_SESSION_ST_LOCAL_SHUTDOWN); - break; + if (!session->remote.shutdown) { + update_child_status(session, SERVER_CLOSING, "local goaway"); } + transit(session, "local goaway", H2_SESSION_ST_DONE); } static void h2_session_ev_remote_goaway(h2_session *session, int arg, const char *msg) { - session->remote.accepting = 0; - cleanup_streams(session); - switch (session->state) { - case H2_SESSION_ST_REMOTE_SHUTDOWN: - /* already received that? */ - break; - case H2_SESSION_ST_IDLE: - case H2_SESSION_ST_LOCAL_SHUTDOWN: - /* all done */ - transit(session, "remote goaway", H2_SESSION_ST_DONE); - break; - default: - transit(session, "remote goaway", H2_SESSION_ST_REMOTE_SHUTDOWN); - break; + if (!session->remote.shutdown) { + session->remote.error = arg; + session->remote.accepting = 0; + session->remote.shutdown = 1; + cleanup_streams(session); + update_child_status(session, SERVER_CLOSING, "remote goaway"); + transit(session, "remote goaway", H2_SESSION_ST_DONE); } } @@ -1779,7 +1760,6 @@ static void h2_session_ev_conn_error(h2_ switch (session->state) { case H2_SESSION_ST_INIT: case H2_SESSION_ST_DONE: - case H2_SESSION_ST_LOCAL_SHUTDOWN: /* just leave */ transit(session, "conn error", H2_SESSION_ST_DONE); break; @@ -1794,31 +1774,18 @@ static void h2_session_ev_conn_error(h2_ static void h2_session_ev_proto_error(h2_session *session, int arg, const char *msg) { - switch (session->state) { - case H2_SESSION_ST_DONE: - case H2_SESSION_ST_LOCAL_SHUTDOWN: - /* just leave */ - transit(session, "proto error", H2_SESSION_ST_DONE); - break; - - default: - ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03402) - "h2_session(%ld): proto error -> shutdown", session->id); - h2_session_shutdown(session, arg, msg, 0); - break; + if (!session->local.shutdown) { + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03402) + "h2_session(%ld): proto error -> shutdown", session->id); + h2_session_shutdown(session, arg, msg, 0); } } static void h2_session_ev_conn_timeout(h2_session *session, int arg, const char *msg) { - switch (session->state) { - case H2_SESSION_ST_LOCAL_SHUTDOWN: - transit(session, "conn timeout", H2_SESSION_ST_DONE); - break; - default: - h2_session_shutdown(session, arg, msg, 1); - transit(session, "conn timeout", H2_SESSION_ST_DONE); - break; + transit(session, msg, H2_SESSION_ST_DONE); + if (!session->local.shutdown) { + h2_session_shutdown(session, arg, msg, 1); } } @@ -1826,8 +1793,6 @@ static void h2_session_ev_no_io(h2_sessi { switch (session->state) { case H2_SESSION_ST_BUSY: - case H2_SESSION_ST_LOCAL_SHUTDOWN: - case H2_SESSION_ST_REMOTE_SHUTDOWN: /* Nothing to READ, nothing to WRITE on the master connection. * Possible causes: * - we wait for the client to send us sth @@ -1837,6 +1802,7 @@ static void h2_session_ev_no_io(h2_sessi ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, session->c, "h2_session(%ld): NO_IO event, %d streams open", session->id, session->open_streams); + h2_conn_io_flush(&session->io); if (session->open_streams > 0) { if (has_unsubmitted_streams(session) || has_suspended_streams(session)) { @@ -1860,7 +1826,7 @@ static void h2_session_ev_no_io(h2_sessi } } } - else if (is_accepting_streams(session)) { + else if (session->local.accepting) { /* When we have no streams, but accept new, switch to idle */ apr_time_t now = apr_time_now(); transit(session, "no io (keepalive)", H2_SESSION_ST_IDLE); @@ -1923,26 +1889,17 @@ static void h2_session_ev_mpm_stopping(h { switch (session->state) { case H2_SESSION_ST_DONE: - case H2_SESSION_ST_LOCAL_SHUTDOWN: /* nop */ break; default: - h2_session_shutdown(session, arg, msg, 0); + h2_session_shutdown_notice(session); break; } } static void h2_session_ev_pre_close(h2_session *session, int arg, const char *msg) { - switch (session->state) { - case H2_SESSION_ST_DONE: - case H2_SESSION_ST_LOCAL_SHUTDOWN: - /* nop */ - break; - default: - h2_session_shutdown(session, arg, msg, 1); - break; - } + h2_session_shutdown(session, arg, msg, 1); } static void h2_session_ev_stream_open(h2_session *session, int arg, const char *msg) @@ -2052,14 +2009,14 @@ apr_status_t h2_session_process(h2_sessi c->cs->state = CONN_STATE_WRITE_COMPLETION; } - while (1) { + while (session->state != H2_SESSION_ST_DONE) { trace = APLOGctrace3(c); session->have_read = session->have_written = 0; - if (!ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state)) { + if (session->local.accepting + && !ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state)) { if (mpm_state == AP_MPMQ_STOPPING) { dispatch_event(session, H2_SESSION_EV_MPM_STOPPING, 0, NULL); - break; } } @@ -2188,8 +2145,6 @@ apr_status_t h2_session_process(h2_sessi break; case H2_SESSION_ST_BUSY: - case H2_SESSION_ST_LOCAL_SHUTDOWN: - case H2_SESSION_ST_REMOTE_SHUTDOWN: if (nghttp2_session_want_read(session->ngh2)) { ap_update_child_status(session->c->sbh, SERVER_BUSY_READ, NULL); h2_filter_cin_timeout_set(session->cin, session->s->timeout); @@ -2272,7 +2227,7 @@ apr_status_t h2_session_process(h2_sessi else if (APR_STATUS_IS_TIMEUP(status)) { /* go back to checking all inputs again */ transit(session, "wait cycle", session->local.accepting? - H2_SESSION_ST_BUSY : H2_SESSION_ST_LOCAL_SHUTDOWN); + H2_SESSION_ST_BUSY : H2_SESSION_ST_DONE); } else if (APR_STATUS_IS_ECONNRESET(status) || APR_STATUS_IS_ECONNABORTED(status)) { @@ -2288,10 +2243,6 @@ apr_status_t h2_session_process(h2_sessi } break; - case H2_SESSION_ST_DONE: - status = APR_EOF; - goto out; - default: ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, c, APLOGNO(03080) @@ -2321,11 +2272,12 @@ out: && (APR_STATUS_IS_EOF(status) || APR_STATUS_IS_ECONNRESET(status) || APR_STATUS_IS_ECONNABORTED(status))) { - dispatch_event(session, H2_SESSION_EV_CONN_ERROR, 0, NULL); - } + dispatch_event(session, H2_SESSION_EV_CONN_ERROR, 0, NULL); + } - status = (session->state == H2_SESSION_ST_DONE)? APR_EOF : APR_SUCCESS; + status = APR_SUCCESS; if (session->state == H2_SESSION_ST_DONE) { + status = APR_EOF; if (!session->eoc_written) { session->eoc_written = 1; h2_conn_io_write_eoc(&session->io, session); @@ -2339,6 +2291,7 @@ apr_status_t h2_session_pre_close(h2_ses { ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, "h2_session(%ld): pre_close", session->id); - dispatch_event(session, H2_SESSION_EV_PRE_CLOSE, 0, "timeout"); + dispatch_event(session, H2_SESSION_EV_PRE_CLOSE, 0, + (session->state == H2_SESSION_ST_IDLE)? "timeout" : NULL); return APR_SUCCESS; } Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_stream.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_stream.c?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_stream.c (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_stream.c Wed Aug 24 15:23:12 2016 @@ -181,6 +181,7 @@ h2_stream *h2_stream_open(int id, apr_po h2_stream *stream = apr_pcalloc(pool, sizeof(h2_stream)); stream->id = id; + stream->created = apr_time_now(); stream->state = H2_STREAM_ST_IDLE; stream->pool = pool; stream->session = session; @@ -265,6 +266,16 @@ struct h2_response *h2_stream_get_respon return stream->response; } +struct h2_response *h2_stream_get_unsent_response(h2_stream *stream) +{ + h2_response *unsent = (stream->last_sent? + stream->last_sent->next : stream->response); + if (unsent) { + stream->last_sent = unsent; + } + return unsent; +} + apr_status_t h2_stream_set_request(h2_stream *stream, request_rec *r) { apr_status_t status; @@ -462,6 +473,9 @@ apr_status_t h2_stream_write_data(h2_str status = h2_beam_send(stream->input, stream->tmp, APR_BLOCK_READ); apr_brigade_cleanup(stream->tmp); + stream->in_data_frames++; + stream->in_data_octets += len; + return status; } @@ -521,11 +535,12 @@ static apr_status_t fill_buffer(h2_strea return status; } -apr_status_t h2_stream_set_response(h2_stream *stream, h2_response *response, +apr_status_t h2_stream_add_response(h2_stream *stream, h2_response *response, h2_bucket_beam *output) { apr_status_t status = APR_SUCCESS; conn_rec *c = stream->session->c; + h2_response **pr = &stream->response; if (!output_open(stream)) { ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, @@ -533,15 +548,29 @@ apr_status_t h2_stream_set_response(h2_s stream->session->id, stream->id); return APR_ECONNRESET; } + if (stream->submitted) { + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, + "h2_stream(%ld-%d): already submitted final response", + stream->session->id, stream->id); + return APR_ECONNRESET; + } - stream->response = response; - stream->output = output; - stream->buffer = apr_brigade_create(stream->pool, c->bucket_alloc); - - h2_stream_filter(stream); - if (stream->output) { - status = fill_buffer(stream, 0); + /* append */ + while (*pr) { + pr = &((*pr)->next); + } + *pr = response; + + if (h2_response_is_final(response)) { + stream->output = output; + stream->buffer = apr_brigade_create(stream->pool, c->bucket_alloc); + + h2_stream_filter(stream); + if (stream->output) { + status = fill_buffer(stream, 0); + } } + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, c, "h2_stream(%ld-%d): set_response(%d)", stream->session->id, stream->id, @@ -558,7 +587,7 @@ apr_status_t h2_stream_set_error(h2_stre } response = h2_response_die(stream->id, http_status, stream->request, stream->pool); - return h2_stream_set_response(stream, response, NULL); + return h2_stream_add_response(stream, response, NULL); } static const apr_size_t DATA_CHUNK_SIZE = ((16*1024) - 100 - 9); @@ -576,6 +605,10 @@ apr_status_t h2_stream_out_prepare(h2_st return APR_ECONNRESET; } + if (!stream->buffer) { + return APR_EAGAIN; + } + if (*plen > 0) { requested = H2MIN(*plen, DATA_CHUNK_SIZE); } @@ -659,7 +692,7 @@ apr_status_t h2_stream_submit_pushes(h2_ int i; pushes = h2_push_collect_update(stream, stream->request, - h2_stream_get_response(stream)); + stream->response); if (pushes && !apr_is_empty_array(pushes)) { ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->session->c, "h2_stream(%ld-%d): found %d push candidates", @@ -683,10 +716,8 @@ apr_table_t *h2_stream_get_trailers(h2_s const h2_priority *h2_stream_get_priority(h2_stream *stream) { - h2_response *response = h2_stream_get_response(stream); - - if (response && stream->request && stream->request->initiated_on) { - const char *ctype = apr_table_get(response->headers, "content-type"); + if (stream->response && stream->request && stream->request->initiated_on) { + const char *ctype = apr_table_get(stream->response->headers, "content-type"); if (ctype) { /* FIXME: Not good enough, config needs to come from request->server */ return h2_config_get_priority(stream->session->config, ctype); @@ -695,3 +726,26 @@ const h2_priority *h2_stream_get_priorit return NULL; } +const char *h2_stream_state_str(h2_stream *stream) +{ + switch (stream->state) { + case H2_STREAM_ST_IDLE: + return "IDLE"; + case H2_STREAM_ST_OPEN: + return "OPEN"; + case H2_STREAM_ST_RESV_LOCAL: + return "RESERVED_LOCAL"; + case H2_STREAM_ST_RESV_REMOTE: + return "RESERVED_REMOTE"; + case H2_STREAM_ST_CLOSED_INPUT: + return "HALF_CLOSED_REMOTE"; + case H2_STREAM_ST_CLOSED_OUTPUT: + return "HALF_CLOSED_LOCAL"; + case H2_STREAM_ST_CLOSED: + return "CLOSED"; + default: + return "UNKNOWN"; + + } +} + Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_stream.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_stream.h?rev=1757542&r1=1757541&r2=1757542&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/http2/h2_stream.h (original) +++ httpd/httpd/branches/2.4.x/modules/http2/h2_stream.h Wed Aug 24 15:23:12 2016 @@ -43,6 +43,7 @@ typedef struct h2_stream h2_stream; struct h2_stream { int id; /* http2 stream id */ + apr_time_t created; /* when stream was created */ h2_stream_state_t state; /* http/2 state of this stream */ struct h2_session *session; /* the session this stream belongs to */ @@ -52,6 +53,7 @@ struct h2_stream { int request_headers_added; /* number of request headers added */ struct h2_response *response; + struct h2_response *last_sent; struct h2_bucket_beam *output; apr_bucket_brigade *buffer; apr_bucket_brigade *tmp; @@ -65,7 +67,10 @@ struct h2_stream { unsigned int submitted : 1; /* response HEADER has been sent */ apr_off_t input_remaining; /* remaining bytes on input as advertised via content-length */ - apr_off_t data_frames_sent; /* # of DATA frames sent out for this stream */ + apr_off_t out_data_frames; /* # of DATA frames sent */ + apr_off_t out_data_octets; /* # of DATA octets (payload) sent */ + apr_off_t in_data_frames; /* # of DATA frames received */ + apr_off_t in_data_octets; /* # of DATA octets (payload) received */ }; @@ -176,6 +181,7 @@ apr_status_t h2_stream_schedule(h2_strea int h2_stream_is_scheduled(const h2_stream *stream); struct h2_response *h2_stream_get_response(h2_stream *stream); +struct h2_response *h2_stream_get_unsent_response(h2_stream *stream); /** * Set the response for this stream. Invoked when all meta data for @@ -186,7 +192,7 @@ struct h2_response *h2_stream_get_respon * @param bb bucket brigade with output data for the stream. Optional, * may be incomplete. */ -apr_status_t h2_stream_set_response(h2_stream *stream, +apr_status_t h2_stream_add_response(h2_stream *stream, struct h2_response *response, struct h2_bucket_beam *output); @@ -277,4 +283,10 @@ apr_status_t h2_stream_submit_pushes(h2_ */ const struct h2_priority *h2_stream_get_priority(h2_stream *stream); +/** + * Return a textual representation of the stream state as in RFC 7540 + * nomenclator, all caps, underscores. + */ +const char *h2_stream_state_str(h2_stream *stream); + #endif /* defined(__mod_h2__h2_stream__) */