Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions plugins/in_splunk/splunk_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ static int process_hec_payload(struct flb_splunk *ctx, struct splunk_conn *conn,
ret = handle_hec_payload(ctx, type, tag, request->data.data, request->data.len);
}

return 0;
return ret;
}

static int process_hec_raw_payload(struct flb_splunk *ctx, struct splunk_conn *conn,
Expand Down Expand Up @@ -887,10 +887,12 @@ int splunk_prot_handle(struct flb_splunk *ctx, struct splunk_conn *conn,
return -1;
}

if (!ret) {
if (ret < 0) {
send_json_message_response(conn, 400, "{\"text\":\"Invalid data format\",\"code\":6}");
}
send_json_message_response(conn, 200, "{\"text\":\"Success\",\"code\":0}");
else {
send_json_message_response(conn, 200, "{\"text\":\"Success\",\"code\":0}");
}
}
else if (strcasecmp(uri, "/services/collector/event/1.0") == 0 ||
strcasecmp(uri, "/services/collector/event") == 0 ||
Expand All @@ -910,10 +912,12 @@ int splunk_prot_handle(struct flb_splunk *ctx, struct splunk_conn *conn,
return -1;
}

if (!ret) {
if (ret < 0) {
send_json_message_response(conn, 400, "{\"text\":\"Invalid data format\",\"code\":6}");
}
send_json_message_response(conn, 200, "{\"text\":\"Success\",\"code\":0}");
else {
send_json_message_response(conn, 200, "{\"text\":\"Success\",\"code\":0}");
}
}
else {
send_response(conn, 400, "error: invalid HTTP endpoint\n");
Expand Down Expand Up @@ -1268,4 +1272,4 @@ int splunk_prot_handle_ng(struct flb_http_request *request,

flb_sds_destroy(tag);
return ret;
}
}
Loading