pgsql: Refactor space allocation for base64 encoding/decoding in pgcryp

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Refactor space allocation for base64 encoding/decoding in pgcryp
Date: 2014-09-25 13:37:12
Message-ID: E1XX9EO-000792-MT@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor space allocation for base64 encoding/decoding in pgcrypto.

Instead of trying to accurately calculate the space needed, use a StringInfo
that's enlarged as needed. This is just moving things around currently - the
old code was not wrong - but this is in preparation for a patch that adds
support for extra armor headers, and would make the space calculation more
complicated.

Marko Tiikkaja

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1dcfb8da09c47d2a7502d1dfab06c8be4b6cf323

Modified Files
--------------
contrib/pgcrypto/pgp-armor.c | 77 +++++++++++++++++++-----------------------
contrib/pgcrypto/pgp-pgsql.c | 47 ++++++++++++--------------
contrib/pgcrypto/pgp.h | 8 ++---
3 files changed, 59 insertions(+), 73 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2014-09-25 14:58:10 pgsql: Change locking regimen around buffer replacement.
Previous Message Andres Freund 2014-09-25 13:25:17 pgsql: Fix VPATH builds of the replication parser from git for some !gc