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

Commit

Permalink
Merge pull request #184 from jmjoy/master
Browse files Browse the repository at this point in the history
Fix the mistake of field entryOperationName in sw6 header.
  • Loading branch information
heyanlong authored Feb 13, 2020
2 parents 095d182 + 74ff315 commit df2b059
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 df2b059

Please sign in to comment.