]> source.dussan.org Git - jgit.git/commit
Limit receive commands 08/77108/7
authorShawn Pearce <spearce@spearce.org>
Tue, 5 Jul 2016 01:04:43 +0000 (18:04 -0700)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 10 Feb 2017 23:20:36 +0000 (00:20 +0100)
commit0bff481d45db74db81a3b1b86f7401443a60d970
tree47d11f395de3748b262c63e8d7d2e9f17d85f5e0
parent67da5635a47ad7680b3c60358a1fec080eef7d1e
Limit receive commands

Place a configurable upper bound on the amount of command data
received from clients during `git push`.  The limit is applied to the
encoded wire protocol format, not the JGit in-memory representation.
This allows clients to flexibly use the limit; shorter reference names
allow for more commands, longer reference names permit fewer commands
per batch.

Based on data gathered from many repositories at $DAY_JOB, the average
reference name is well under 200 bytes when encoded in UTF-8 (the wire
encoding).  The new 3 MiB default receive.maxCommandBytes allows about
11,155 references in a single `git push` invocation.  A Gerrit Code
Review system with six-digit change numbers could still encode 29,399
references in the 3 MiB maxCommandBytes limit.

Change-Id: I84317d396d25ab1b46820e43ae2b73943646032c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java