Silence delivery noise
This commit is contained in:
parent
c42deefbef
commit
e52c3df365
14
queue.c
14
queue.c
|
@ -83,10 +83,10 @@ static void shoveller(void *qv) {
|
||||||
subscription_t *sub = NULL;
|
subscription_t *sub = NULL;
|
||||||
|
|
||||||
check_for_work:
|
check_for_work:
|
||||||
info("Checking for work\n");
|
//info("Checking for work\n");
|
||||||
|
|
||||||
if (sexp_queue_emptyp(q->backlog_q)) {
|
if (sexp_queue_emptyp(q->backlog_q)) {
|
||||||
info("Backlog empty\n");
|
//info("Backlog empty\n");
|
||||||
goto wait_and_shovel;
|
goto wait_and_shovel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ static void shoveller(void *qv) {
|
||||||
|
|
||||||
find_valid_waiter:
|
find_valid_waiter:
|
||||||
if (q->waiter_q.count == 0) {
|
if (q->waiter_q.count == 0) {
|
||||||
info("No waiters\n");
|
//info("No waiters\n");
|
||||||
sexp_queue_pushback(q->backlog_q, body);
|
sexp_queue_pushback(q->backlog_q, body);
|
||||||
DECREF(body, sexp_destructor);
|
DECREF(body, sexp_destructor);
|
||||||
q->waiter_q = examined;
|
q->waiter_q = examined;
|
||||||
|
@ -104,9 +104,11 @@ static void shoveller(void *qv) {
|
||||||
|
|
||||||
sub = dequeue(&q->waiter_q);
|
sub = dequeue(&q->waiter_q);
|
||||||
|
|
||||||
|
/*
|
||||||
info("Delivering to <<%.*s>>/<<%.*s>>...\n",
|
info("Delivering to <<%.*s>>/<<%.*s>>...\n",
|
||||||
sexp_data(sub->sink).len, sexp_data(sub->sink).bytes,
|
sexp_data(sub->sink).len, sexp_data(sub->sink).bytes,
|
||||||
sexp_data(sub->name).len, sexp_data(sub->name).bytes);
|
sexp_data(sub->name).len, sexp_data(sub->name).bytes);
|
||||||
|
*/
|
||||||
|
|
||||||
if ((sub->uuid == NULL) /* It has been unsubscribed. */
|
if ((sub->uuid == NULL) /* It has been unsubscribed. */
|
||||||
|| !send_to_waiter(sub, body)) { /* Destination no longer exists. */
|
|| !send_to_waiter(sub, body)) { /* Destination no longer exists. */
|
||||||
|
@ -115,17 +117,17 @@ static void shoveller(void *qv) {
|
||||||
goto find_valid_waiter;
|
goto find_valid_waiter;
|
||||||
}
|
}
|
||||||
|
|
||||||
info("Delivery successful\n");
|
//info("Delivery successful\n");
|
||||||
DECREF(body, sexp_destructor);
|
DECREF(body, sexp_destructor);
|
||||||
queue_append(&q->waiter_q, &examined);
|
queue_append(&q->waiter_q, &examined);
|
||||||
enqueue(&q->waiter_q, sub);
|
enqueue(&q->waiter_q, sub);
|
||||||
goto check_for_work;
|
goto check_for_work;
|
||||||
|
|
||||||
wait_and_shovel:
|
wait_and_shovel:
|
||||||
info("Waiting for throck\n");
|
//info("Waiting for throck\n");
|
||||||
q->shovel_awake = 0;
|
q->shovel_awake = 0;
|
||||||
suspend();
|
suspend();
|
||||||
info("Throck received!\n");
|
//info("Throck received!\n");
|
||||||
goto check_for_work;
|
goto check_for_work;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
relay.c
4
relay.c
|
@ -59,8 +59,10 @@ static void relay_destructor(node_t *n) {
|
||||||
static void relay_handle_message(node_t *n, sexp_t *m) {
|
static void relay_handle_message(node_t *n, sexp_t *m) {
|
||||||
relay_extension_t *r = n->extension;
|
relay_extension_t *r = n->extension;
|
||||||
|
|
||||||
|
/*
|
||||||
info("fd %d <-- ", r->fd);
|
info("fd %d <-- ", r->fd);
|
||||||
sexp_writeln(stderr_h, m);
|
sexp_writeln(stderr_h, m);
|
||||||
|
*/
|
||||||
|
|
||||||
BCHECK(!sexp_write(r->outh, m), "relay_handle_message sexp_write");
|
BCHECK(!sexp_write(r->outh, m), "relay_handle_message sexp_write");
|
||||||
}
|
}
|
||||||
|
@ -113,8 +115,10 @@ static void relay_main(node_t *n) {
|
||||||
|
|
||||||
if (inh->error_kind != 0) goto network_error;
|
if (inh->error_kind != 0) goto network_error;
|
||||||
|
|
||||||
|
/*
|
||||||
info("fd %d --> ", r->fd);
|
info("fd %d --> ", r->fd);
|
||||||
sexp_writeln(stderr_h, message);
|
sexp_writeln(stderr_h, message);
|
||||||
|
*/
|
||||||
|
|
||||||
if (!(sexp_pairp(message) && sexp_stringp(sexp_head(message)))) {
|
if (!(sexp_pairp(message) && sexp_stringp(sexp_head(message)))) {
|
||||||
send_error(r->outh, "ill-formed message", NULL);
|
send_error(r->outh, "ill-formed message", NULL);
|
||||||
|
|
Loading…
Reference in New Issue