Skip to content

Commit

Permalink
except
Browse files Browse the repository at this point in the history
  • Loading branch information
RekGRpth committed Nov 14, 2023
1 parent 5c8e117 commit 60c0e58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pg_curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ EXTENSION(pg_curl_easy_setopt_postfields) {
if (PG_ARGISNULL(0)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("curl_easy_setopt_postfields requires argument parameter")));
parameter = PG_GETARG_BYTEA_PP(0);
resetStringInfo(&curl->postfield);
resetStringInfo(&curl->readdata);
appendBinaryStringInfo(&curl->postfield, VARDATA_ANY(parameter), VARSIZE_ANY_EXHDR(parameter));
PG_FREE_IF_COPY(parameter, 0);
PG_RETURN_BOOL(ec == CURLE_OK);
Expand All @@ -590,6 +591,7 @@ EXTENSION(pg_curl_easy_setopt_readdata) {
pg_curl_t *curl = pg_curl_easy_init(conname);
if (PG_ARGISNULL(0)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("curl_easy_setopt_readdata requires argument parameter")));
parameter = PG_GETARG_BYTEA_PP(0);
resetStringInfo(&curl->postfield);
resetStringInfo(&curl->readdata);
appendBinaryStringInfo(&curl->readdata, VARDATA_ANY(parameter), VARSIZE_ANY_EXHDR(parameter));
PG_FREE_IF_COPY(parameter, 0);
Expand Down Expand Up @@ -633,6 +635,7 @@ EXTENSION(pg_curl_postfield_append) {
NameData *conname = PG_CONNAME(2);
pg_curl_t *curl = pg_curl_easy_init(conname);
if (PG_ARGISNULL(0)) ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("pg_curl_postfield_append requires argument name")));
resetStringInfo(&curl->readdata);
return pg_curl_postfield_or_url_append(fcinfo, curl, &curl->postfield);
}

Expand Down

0 comments on commit 60c0e58

Please sign in to comment.