debuginfod: PR28034 - No longer escape '/', and loop efficiency
authorNoah Sanci <nsanci@redhat.com>
Thu, 9 Sep 2021 17:10:33 +0000 (13:10 -0400)
committerNoah Sanci <nsanci@redhat.com>
Thu, 16 Sep 2021 13:40:07 +0000 (09:40 -0400)
commit00f0fa77c995684060aa8ea6fe7276ed9b593d11
tree81d64867863d8084a5bad11a8802784f93865e26
parent2ff803956d6aaefeed3bc3f186da6fe666c7b1b6
debuginfod: PR28034 - No longer escape '/', and loop efficiency

Previously, urls containing '/', so most urls, would escape '/' to %2F,
which is undesirable for use in other libraries which may escape
differently. This patch escapes the '/' and replaces all of them
ensuring there are no %2Fs sent.
Some inefficiencies within the code were fixed, such as changing constant
operations of a while loop within a for loop to a while loop outside of
a for loop. Also strlen is no longer used within the loop, simplifying
the interior operations to mere arithmetic.

https://sourceware.org/bugzilla/show_bug.cgi?id=28034

Signed-off-by: Noah Sanci <nsanci@redhat.com>
debuginfod/ChangeLog
debuginfod/debuginfod-client.c
tests/ChangeLog
tests/Makefile.am
tests/run-debuginfod-percent-escape.sh [new file with mode: 0755]