提交 1fc01f37 编写于 作者: H Heikki Linnakangas

Fix --without-libcurl build.

The readable_external_table_timeout global variable is needed even when
building without libcurl, because the GUC still exists and is listed in
guc.c, even though doesn't do anything without libcurl support. Move it
outside the #ifdef USE_CURL block.

While we're at it, silence a few  "<function> defined but not used"
warnings from sendalert.c. Some static functions were only called when
compiling with libcurl, so put them inside #ifdef LIBCURL blocks to silence
the warnings.

Reported by Digoal.zhou.
上级 e76972db
......@@ -96,9 +96,11 @@ static int extssl_libcurldebug = 1;
char extssl_key_full[MAXPGPATH] = {0};
char extssl_cer_full[MAXPGPATH] = {0};
char extssl_cas_full[MAXPGPATH] = {0};
int readable_external_table_timeout = 0;
#endif
/* GUC */
int readable_external_table_timeout = 0;
/* Will hold the last curl error */
/* Currently it is in use only for SSL connection, */
/* but we should consider using it always */
......
......@@ -84,6 +84,7 @@ oid objid_gpdbAlertSqlStmt[] = { 1, 3, 6, 1, 4, 1, 31327, 1, 5 };
oid objid_gpdbAlertSystemName[] = { 1, 3, 6, 1, 4, 1, 31327, 1, 6 };
#endif
#ifdef USE_CURL
/* state information for messagebody_cb function */
typedef struct
{
......@@ -95,9 +96,10 @@ static size_t messagebody_cb(void *ptr, size_t size, size_t nmemb, void *userp);
static void build_messagebody(StringInfo buf, const GpErrorData *errorData,
const char *subject, const char *email_priority);
#ifdef USE_CURL
static void send_alert_via_email(const GpErrorData * errorData,
const char * subject, const char * email_priority);
static char *extract_email_addr(char *str);
static bool SplitMailString(char *rawstring, char delimiter, List **namelist);
#endif
#ifdef USE_SNMP
......@@ -105,8 +107,6 @@ static int send_snmp_inform_or_trap();
extern pg_time_t MyStartTime;
#endif
static char *extract_email_addr(char *str);
static bool SplitMailString(char *rawstring, char delimiter, List **namelist);
int send_alert_from_chunks(const PipeProtoChunk *chunk,
const PipeProtoChunk * saved_chunks_in)
......@@ -1022,6 +1022,11 @@ get_str_from_chunk(CSVChunkStr *chunkstr, const PipeProtoChunk *saved_chunks)
return out;
}
#ifdef USE_CURL
/*
* Support functions for building an alert email.
*/
/*
* The message is read a line at a time and the newlines converted
* to \r\n. Unfortunately, RFC 822 states that bare \n and \r are
......@@ -1029,7 +1034,6 @@ get_str_from_chunk(CSVChunkStr *chunkstr, const PipeProtoChunk *saved_chunks)
* line termination. This requirement cannot be reconciled with storing
* messages with Unix line terminations. RFC 2822 rescues this situation
* slightly by prohibiting lone \r and \n in messages.
*
*/
static void
add_to_message(StringInfo buf, const char *newstr_in)
......@@ -1299,3 +1303,4 @@ SplitMailString(char *rawstring, char delimiter,
return true;
}
#endif /* USE_CURL */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册