Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Fix the mistake of field entryOperationName in sw6 header.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjoy committed Feb 12, 2020
1 parent 095d182 commit 74ff315
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion skywalking.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,26 @@ static void generate_context() {
add_assoc_long(&SKYWALKING_G(context), "parentApplicationInstance", application_instance);
add_assoc_long(&SKYWALKING_G(context), "entryApplicationInstance", application_instance);
char *uri = get_page_request_uri();
add_assoc_string(&SKYWALKING_G(context), "entryOperationName", (uri == NULL) ? "" : uri);
char *path = NULL;
if (uri != NULL) {
path = (char *)emalloc(strlen(uri) + 5);
bzero(path, strlen(uri) + 5);

int i;
for(i = 0; i < strlen(uri); i++) {
if (uri[i] == '?') {
break;
}
path[i] = uri[i];
}
path[i] = '\0';
}

add_assoc_string(&SKYWALKING_G(context), "entryOperationName", (path == NULL) ? "" : path);
if (path != NULL) {
efree(path);
}

add_assoc_string(&SKYWALKING_G(context), "distributedTraceId", makeTraceId);
if(uri != NULL) {
efree(uri);
Expand Down

0 comments on commit 74ff315

Please sign in to comment.