if (!strcasecmp("content-type", (const char *)name)) {
/* TODO: add a per-group option for content-type if we need to
* support protocols other than DNS here */
- if (strcasecmp("application/dns-message", (const char *)value)) {
+ if (strcasecmp("application/dns-message", (const char *)value) != 0) {
set_status(ctx, HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE);
return 0;
}
enum protolayer_event_type event,
void *baton);
-struct protolayer_globals protolayer_globals[PROTOLAYER_PROTOCOL_COUNT] = {0};
+struct protolayer_globals protolayer_globals[PROTOLAYER_PROTOCOL_COUNT] = {{0}};
static enum protolayer_protocol protolayer_grp_doudp[] = {
/** Human-readable names for protocol layer groups. */
const char *protolayer_grp_names[PROTOLAYER_GRP_COUNT] = {
[PROTOLAYER_GRP_NULL] = "(null)",
-#define XX(cid, vid, name) [PROTOLAYER_GRP_##cid] = name,
+#define XX(cid, vid, name) [PROTOLAYER_GRP_##cid] = (name),
PROTOLAYER_GRP_MAP(XX)
#undef XX
};
/** Human-readable names for payloads. */
const char *protolayer_payload_names[PROTOLAYER_PAYLOAD_COUNT] = {
[PROTOLAYER_PAYLOAD_NULL] = "(null)",
-#define XX(cid, name) [PROTOLAYER_PAYLOAD_##cid] = name,
+#define XX(cid, name) [PROTOLAYER_PAYLOAD_##cid] = (name),
PROTOLAYER_PAYLOAD_MAP(XX)
#undef XX
};
struct protolayer_globals *globals = &protolayer_globals[p];
struct protolayer_data *iter_data = protolayer_iter_data_get(ctx, i);
if (iter_data) {
- bzero(iter_data, globals->iter_size);
+ memset(iter_data, 0, globals->iter_size);
iter_data->session = manager->session;
}
struct protolayer_globals *globals = &protolayer_globals[protocols[i]];
struct protolayer_data *sess_data = protolayer_sess_data_get(m, i);
if (sess_data) {
- bzero(sess_data, globals->sess_size);
+ memset(sess_data, 0, globals->sess_size);
sess_data->session = s;
}
/** Sends an event to be synchronously processed by the protocol layers of the
* specified session. The layers are first iterated through in the `_UNWRAP`
* direction, then bounced back in the `_WRAP` direction. */
-void session2_event(struct session2 *s, enum protolayer_event_type type, void *baton);
+void session2_event(struct session2 *s, enum protolayer_event_type event, void *baton);
/** Sends an event to be synchronously processed by the protocol layers of the
* specified session, starting from the specified `protocol` in the `_UNWRAP`
* specified by `protocol` and those before it are only skipped in the
* `_UNWRAP` direction! */
void session2_event_after(struct session2 *s, enum protolayer_protocol protocol,
- enum protolayer_event_type type, void *baton);
+ enum protolayer_event_type event, void *baton);
void session2_init_request(struct session2 *s, struct kr_request *req);