Closed dennisip86 closed 8 years ago
Here is the testing code:
#include <stdio.h> #include <stdlib.h> #include "cetcd.h" int main() { cetcd_client cli; cetcd_response *resp; cetcd_array addrs; cetcd_array_init(&addrs, 3); cetcd_array_append(&addrs, (void *)"http://192.168.4.247:2379"); cetcd_array_append(&addrs, (void *)"http://192.168.4.247:2381"); cetcd_array_append(&addrs, (void *)"http://192.168.4.247:2383"); cetcd_client_init(&cli, &addrs); resp = cetcd_get(&cli, "/test/test.conf"); if(resp->err) { printf("error :%d, %s (%s)\n", resp->err->ecode, resp->err->message, resp->err->cause); } cetcd_response_print(resp); cetcd_response_release(resp); cetcd_array_destroy(&addrs); cetcd_client_destroy(&cli); return 0; }
A segmentation fault happens when one or all of the etcd cluster server down.
@dennisip86 Thanks very much for your report. It is because parser.json was not initialized. The latest master branch fixed this problem. Please checkout and see if it works for you.
parser.json
master
Here is the testing code:
A segmentation fault happens when one or all of the etcd cluster server down.