aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2019-09-04 13:51:29 +0200
committerAnders Broman <a.broman58@gmail.com>2019-09-04 12:31:53 +0000
commit98cda1bf46fb262dbfd1865cf131a23504a41cec (patch)
tree9dba36fdaf4f3c885760ace24c2e76c7b00e70d6 /epan/packet.c
parentf2162a1005328a4921367cc52b767f7629944330 (diff)
Load environment vars to globals for efficency.
These environment variables are read very frequently, read them once to globals for performance improvment. Change-Id: I4f05a5edca85b370674cc5f85fce40bd1af695cb Reviewed-on: https://code.wireshark.org/review/34449 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 84878a8b2c..64b2da5935 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1023,7 +1023,7 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h
if (handle == NULL) {
fprintf(stderr, "OOPS: handle to register \"%s\" to doesn't exist\n",
name);
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1032,7 +1032,7 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h
name);
fprintf(stderr, "Protocol being registered is \"%s\"\n",
proto_get_protocol_long_name(handle->protocol));
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1506,7 +1506,7 @@ dissector_add_string(const char *name, const gchar *pattern,
if (handle == NULL) {
fprintf(stderr, "OOPS: handle to register \"%s\" to doesn't exist\n",
name);
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1515,7 +1515,7 @@ dissector_add_string(const char *name, const gchar *pattern,
name);
fprintf(stderr, "Protocol being registered is \"%s\"\n",
proto_get_protocol_long_name(handle->protocol));
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1768,7 +1768,7 @@ void dissector_add_custom_table_handle(const char *name, void *pattern, dissecto
if (handle == NULL) {
fprintf(stderr, "OOPS: handle to register \"%s\" to doesn't exist\n",
name);
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1777,7 +1777,7 @@ void dissector_add_custom_table_handle(const char *name, void *pattern, dissecto
name);
fprintf(stderr, "Protocol being registered is \"%s\"\n",
proto_get_protocol_long_name(handle->protocol));
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1824,7 +1824,7 @@ void dissector_add_guid(const char *name, guid_key* guid_val, dissector_handle_t
if (handle == NULL) {
fprintf(stderr, "OOPS: handle to register \"%s\" to doesn't exist\n",
name);
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -1833,7 +1833,7 @@ void dissector_add_guid(const char *name, guid_key* guid_val, dissector_handle_t
name);
fprintf(stderr, "Protocol being registered is \"%s\"\n",
proto_get_protocol_long_name(handle->protocol));
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -2019,7 +2019,7 @@ dissector_add_for_decode_as(const char *name, dissector_handle_t handle)
name);
fprintf(stderr, "Protocol being registered is \"%s\"\n",
proto_get_protocol_long_name(handle->protocol));
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -2037,7 +2037,7 @@ dissector_add_for_decode_as(const char *name, dissector_handle_t handle)
dissector_name,
proto_get_protocol_short_name(handle->protocol),
name);
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -2081,7 +2081,7 @@ dissector_add_for_decode_as(const char *name, dissector_handle_t handle)
dissector_name, dup_dissector_name,
proto_get_protocol_short_name(handle->protocol),
name);
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
}
}
@@ -2621,7 +2621,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis
fprintf(stderr, "Protocol being registered is \"%s\"\n",
proto_name);
}
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}
@@ -2640,7 +2640,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis
fprintf(stderr, "Protocol %s is already registered in \"%s\" table\n",
proto_name, name);
}
- if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
+ if (wireshark_abort_on_dissector_bug)
abort();
return;
}