Skip to content

Commit 80f2811

Browse files
authored
Merge pull request #4 from topcoder-platform/dev_curl_fix
curl memory leak issue fix
2 parents c89643c + 1d2344e commit 80f2811

File tree

2 files changed

+12
-42
lines changed

2 files changed

+12
-42
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ builddeploy_steps: &builddeploy_steps
5050
# # consumer deployment
5151
# rm -rf buildenvvar
5252
# ./unsetenv.sh
53-
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-consumer-deployvar
54-
source buildenvvar
55-
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
53+
# ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-consumer-deployvar
54+
# source buildenvvar
55+
# ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
5656
# # without kafka dynamodb
5757
# rm -rf buildenvvar
5858
# ./unsetenv.sh

informix_auditing/audit_util.c

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ mi_string *doInsertCN()
169169
for (i = 0; i < colCount; i++) {
170170
/* get column name and type id */
171171
pcolname = mi_column_name(rd, i);
172-
DPRINTF("logger", 90, ("insert: colname: (0x%x) [%s]", pcolname, pcolname));
172+
DPRINTF("logger", 90, ("insert: colname: (0x%x) [%s]", pcolname, pcolname));
173+
printf("\n\"Reading TABLENAME-ColumnName\": \"%s-%s\" \n",tabname,pcolname);
173174
tid = mi_column_type_id(rd, i);
174175
switch(mi_value(row, i, &datum, &collen)) {
175176
/* we should do this test */
@@ -429,6 +430,7 @@ mi_string *doUpdateCN()
429430
if (j < colCountNew)
430431
pnewcolname = mi_column_name(rdNew, j);
431432
tid = mi_column_type_id(rdOld, i);
433+
printf("\"Reading TABLENAME-ColumnName\": \"%s-%s\" \n",ptabname,pnewcolname);
432434
switch(mi_value(oldRow, i, &datum, &collen)) {
433435
/* we should do this test */
434436
case MI_NULL_VALUE:
@@ -517,45 +519,19 @@ char* gettimestamp()
517519
strftime(timebuffer,30,"%Y-%m-%dT%T.",localtime(&curtime));
518520
//printf("%s%ld\n",buffer,tv.tv_usec);
519521
sprintf(timedate,"%s%ldZ",timebuffer,tv.tv_usec);
522+
printf("\nAllocating memory and strcopy before- getstimestamp\n");
520523
char *returnstr = malloc(strlen(timedate) + 1);
521524
strcpy(returnstr,timedate);
525+
printf("\nAllocating memory and strcopy success- getstimestamp\n");
522526
//printf("%s",timedate);
523527
return returnstr;
524528
}
525529
/*--------------------------------------------------------------*/
526530
/* post topic base don condition*/
527531

528532
int posttopic(char *jsondata, char *posturl)
529-
{
530-
// char *postinfo = getenv("POSTTOPIC");
531-
// char *fileeventsurl = "http://ifxpg-migrator.topcoder-dev.com/fileevents";
532-
// char *kafkaeventsurl = "http://ifxpg-migrator.topcoder-dev.com/kafkaevents";
533-
//char *localurl= "http://host.docker.internal:8080/events";
534-
//char *localurl= "http://localhost:8080/events";
535-
/* char *posturl = getenv("POSTURL");
536-
if (!postinfo)
537-
{
538-
printf("no post topic set true or false. defualt it will post topic \n");
539-
// return 0;
540-
}
541-
else
542-
{
543-
544-
if (strcmp(postinfo, "false") == 0)
545-
{
546-
return 0;
547-
}
548-
}
549-
printf("posting topic \n");
550-
if (!posturl)
551-
{
552-
posturl = fileeventsurl;
553-
//posturl = localurl;
554-
//printf("PATH : %s\n",ap);
555-
printf("no url provide in environment . So it is taking localurl");
556-
}
557-
*/
558-
printf("posting topic to url %s \n", posturl);
533+
{
534+
printf("\nPosting topic to url %s \n", posturl);
559535
CURL *hnd = curl_easy_init();
560536
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
561537
curl_easy_setopt(hnd, CURLOPT_URL, posturl);
@@ -568,15 +544,9 @@ int posttopic(char *jsondata, char *posturl)
568544
if(ret != CURLE_OK)
569545
{
570546
fprintf(stderr, "curl_easy_perform() failed: %s\n",
571-
curl_easy_strerror(ret));
547+
curl_easy_strerror(ret));
572548
}
573-
/* curl_easy_setopt(hnd, CURLOPT_URL, kafkaeventsurl);
574-
if(ret != CURLE_OK)
575-
{
576-
fprintf(stderr, "curl_easy_perform() failed: %s\n",
577-
curl_easy_strerror(ret));
578-
}
579-
*/
549+
curl_easy_cleanup(hnd);
580550
return 0;
581551
}
582552

0 commit comments

Comments
 (0)