Skip to content

Commit ea855bc

Browse files
committed
broker: fix whitespace issues
Problem: some event publishing code in the broker does not conform to RFC 7. Break long paramter lists to one per line. Indent long compound conditionals by one level.
1 parent 5f55d3c commit ea855bc

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/broker/broker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ static int handle_event (broker_ctx_t *ctx, const flux_msg_t *msg)
15751575
const char *topic;
15761576

15771577
if (flux_msg_get_seq (msg, &seq) < 0
1578-
|| flux_msg_get_topic (msg, &topic) < 0) {
1578+
|| flux_msg_get_topic (msg, &topic) < 0) {
15791579
flux_log (ctx->h, LOG_ERR, "dropping malformed event");
15801580
return -1;
15811581
}

src/broker/publisher.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ struct publisher {
3434
void *arg;
3535
};
3636

37-
static flux_msg_t *encode_event (const char *topic, int flags,
37+
static flux_msg_t *encode_event (const char *topic,
38+
int flags,
3839
struct flux_msg_cred cred,
39-
uint32_t seq, const char *src)
40+
uint32_t seq,
41+
const char *src)
4042
{
4143
flux_msg_t *msg;
4244
char *dst = NULL;
@@ -103,10 +105,12 @@ static void publish_cb (flux_t *h,
103105
flux_msg_t *event = NULL;
104106
const char *errmsg = NULL;
105107

106-
if (flux_request_unpack (msg, NULL, "{s:s s:i s?s}",
107-
"topic", &topic,
108-
"flags", &flags,
109-
"payload", &payload) < 0)
108+
if (flux_request_unpack (msg,
109+
NULL,
110+
"{s:s s:i s?s}",
111+
"topic", &topic,
112+
"flags", &flags,
113+
"payload", &payload) < 0)
110114
goto error;
111115
if (pub->ctx->rank > 0) {
112116
errno = EPROTO;
@@ -152,8 +156,10 @@ int publisher_send (struct publisher *pub, const flux_msg_t *msg)
152156
return -1;
153157
}
154158

155-
static void subscribe_cb (flux_t *h, flux_msg_handler_t *mh,
156-
const flux_msg_t *msg, void *arg)
159+
static void subscribe_cb (flux_t *h,
160+
flux_msg_handler_t *mh,
161+
const flux_msg_t *msg,
162+
void *arg)
157163
{
158164
struct publisher *pub = arg;
159165
const char *uuid;
@@ -181,8 +187,10 @@ static void subscribe_cb (flux_t *h, flux_msg_handler_t *mh,
181187
flux_log_error (h, "error responding to subscribe request");
182188
}
183189

184-
static void unsubscribe_cb (flux_t *h, flux_msg_handler_t *mh,
185-
const flux_msg_t *msg, void *arg)
190+
static void unsubscribe_cb (flux_t *h,
191+
flux_msg_handler_t *mh,
192+
const flux_msg_t *msg,
193+
void *arg)
186194
{
187195
struct publisher *pub = arg;
188196
const char *uuid;
@@ -245,7 +253,6 @@ struct publisher *publisher_create (struct broker *ctx,
245253
return pub;
246254
}
247255

248-
249256
/*
250257
* vi:tabstop=4 shiftwidth=4 expandtab
251258
*/

0 commit comments

Comments
 (0)