1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Move copy_stream function to misc.c.

* dirmngr/ks-action.c (copy_stream): Move function from here...
* dirmngr/misc.c (copy_stream): ... to here and drop the static
qualifier.
* dirmngr/misc.h (copy_stream): Add declaration.

--
Signed-off-by: Neal H. Walfield <neal@g10code.de>
This commit is contained in:
Neal H. Walfield 2015-03-13 13:44:18 +01:00
parent 63552852bf
commit 9e79a15f74
3 changed files with 20 additions and 19 deletions

View file

@ -619,3 +619,21 @@ armor_data (char **r_string, const void *data, size_t datalen)
*r_string = buffer;
return 0;
}
/* Copy all data from IN to OUT. */
gpg_error_t
copy_stream (estream_t in, estream_t out)
{
char buffer[512];
size_t nread;
while (!es_read (in, buffer, sizeof buffer, &nread))
{
if (!nread)
return 0; /* EOF */
if (es_write (out, buffer, nread, NULL))
break;
}
return gpg_error_from_syserror ();
}