)]}'
{
  "commit": "4981fe750b1fc58bfdf5b9ca9843f4f505b9bb4d",
  "tree": "0dba124f33bf0f6e46bbc1a5621efe70150b9941",
  "parents": [
    "74543a0423c96130b3b07946c20b10735c3b5b15"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Sat Feb 23 17:31:34 2013 -0500"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Sun Feb 24 00:14:15 2013 -0800"
  },
  "message": "pkt-line: share buffer/descriptor reading implementation\n\nThe packet_read function reads from a descriptor. The\npacket_get_line function is similar, but reads from an\nin-memory buffer, and uses a completely separate\nimplementation. This patch teaches the generic packet_read\nfunction to accept either source, and we can do away with\npacket_get_line\u0027s implementation.\n\nThere are two other differences to account for between the\nold and new functions. The first is that we used to read\ninto a strbuf, but now read into a fixed size buffer. The\nonly two callers are fine with that, and in fact it\nsimplifies their code, since they can use the same\nstatic-buffer interface as the rest of the packet_read_line\ncallers (and we provide a similar convenience wrapper for\nreading from a buffer rather than a descriptor).\n\nThis is technically an externally-visible behavior change in\nthat we used to accept arbitrary sized packets up to 65532\nbytes, and now cap out at LARGE_PACKET_MAX, 65520. In\npractice this doesn\u0027t matter, as we use it only for parsing\nsmart-http headers (of which there is exactly one defined,\nand it is small and fixed-size). And any extension headers\nwould be breaking the protocol to go over LARGE_PACKET_MAX\nanyway.\n\nThe other difference is that packet_get_line would return\non error rather than dying. However, both callers of\npacket_get_line are actually improved by dying.\n\nThe first caller does its own error checking, but we can\ndrop that; as a result, we\u0027ll actually get more specific\nreporting about protocol breakage when packet_read dies\ninternally. The only downside is that packet_read will not\nprint the smart-http URL that failed, but that\u0027s not a big\ndeal; anybody not debugging can already see the remote\u0027s URL\nalready, and anybody debugging would want to run with\nGIT_CURL_VERBOSE anyway to see way more information.\n\nThe second caller, which is just trying to skip past any\nextra smart-http headers (of which there are none defined,\nbut which we allow to keep room for future expansion), did\nnot error check at all. As a result, it would treat an error\njust like a flush packet. The resulting mess would generally\ncause an error later in get_remote_heads, but now we get\nerror reporting much closer to the source of the problem.\n\nBrown-paper-bag-fixes-by: Ramsay Jones \u003cramsay@ramsay1.demon.co.uk\u003e\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "611ffb4419f402d6f1f2bc08a91a7ed99aab35e2",
      "old_mode": 33188,
      "old_path": "connect.c",
      "new_id": "3d999999e5130e08cfc2c2195436ab6d082e041a",
      "new_mode": 33188,
      "new_path": "connect.c"
    },
    {
      "type": "modify",
      "old_id": "3f70e79b8e6344512c84b026f857329bd459fcf1",
      "old_mode": 33188,
      "old_path": "daemon.c",
      "new_id": "82d5bf50e90cd28997e8610f5f8584d4250e9459",
      "new_mode": 33188,
      "new_path": "daemon.c"
    },
    {
      "type": "modify",
      "old_id": "55fb688899333363967f4cd7418560e28e352c26",
      "old_mode": 33188,
      "old_path": "pkt-line.c",
      "new_id": "70f19501d0e0c0dd625976519fd039d5c7a8b314",
      "new_mode": 33188,
      "new_path": "pkt-line.c"
    },
    {
      "type": "modify",
      "old_id": "fa93e32071b2add9eb03ca90ae1632f59b6feef2",
      "old_mode": 33188,
      "old_path": "pkt-line.h",
      "new_id": "0a838d1656171019c07fe802d615ecaf78412003",
      "new_mode": 33188,
      "new_path": "pkt-line.h"
    },
    {
      "type": "modify",
      "old_id": "b28f96504815224b2b1a06d8d07f0c6ef81c6380",
      "old_mode": 33188,
      "old_path": "remote-curl.c",
      "new_id": "c8379a53f0e7ea53ee126d0260717020c5fc5ab4",
      "new_mode": 33188,
      "new_path": "remote-curl.c"
    },
    {
      "type": "modify",
      "old_id": "15cc1aec22115a9f0d41d9e06e29184f64f1a86a",
      "old_mode": 33188,
      "old_path": "sideband.c",
      "new_id": "d1125f5c528b680f915bb2fbf54231cc8c3b2ec0",
      "new_mode": 33188,
      "new_path": "sideband.c"
    }
  ]
}
