Skip to content

Commit

Permalink
Remove debugging print statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Rarick committed Sep 25, 2007
1 parent b8caff8 commit 92a06db
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
16 changes: 0 additions & 16 deletions beanstalkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ fill_extra_data(conn c)

/* how many extra bytes did we read? */
extra_bytes = c->cmd_read - c->cmd_len;
fprintf(stderr, "have %d extra bytes\n", extra_bytes);

/* how many bytes should we put into the job data? */
fprintf(stderr, "c->in_job is %p\n", c->in_job);
if (c->in_job) {
job_data_bytes = min(extra_bytes, c->in_job->data_size);
memcpy(c->in_job->data, c->cmd + c->cmd_len, job_data_bytes);
Expand All @@ -130,8 +128,6 @@ enqueue_incoming_job(conn c)

c->in_job = NULL; /* the connection no longer owns this job */

fprintf(stderr, "enqueueing job %lld\n", j->id);

/* check if the trailer is present and correct */
if (memcmp(j->data + j->data_size - 2, "\r\n", 2)) return conn_close(c);

Expand Down Expand Up @@ -198,8 +194,6 @@ dispatch_cmd(conn c)

c->in_job = make_job(pri, data_size + 2);

fprintf(stderr, "put pri=%d bytes=%d\n", pri, data_size);

fill_extra_data(c);

/* it's possible we already have a complete job */
Expand All @@ -213,10 +207,6 @@ dispatch_cmd(conn c)
/* don't allow trailing garbage */
if (c->cmd_len != CMD_RESERVE_LEN + 2) return conn_close(c);

fprintf(stderr, "got reserve cmd: %s\n", c->cmd);

warn("looking for a job");

/* keep any existing job, but take one if necessary */
//c->reserved_job = c->reserved_job ? : pq_take(ready_q);

Expand Down Expand Up @@ -273,8 +263,6 @@ reset_conn(conn c)
{
int r;

fprintf(stderr, "%d: resetting back to STATE_WANTCOMMAND\n", c->fd);

r = conn_update_evq(c, EV_READ | EV_PERSIST, NULL);
if (r == -1) return warn("update events failed"), conn_close(c);

Expand Down Expand Up @@ -318,7 +306,6 @@ handle_connection(conn c)
if (r == -1) return check_err(c, "read()");
if (r == 0) return conn_close(c); /* the client hung up */

fprintf(stderr, "got %d data bytes\n", r);
j->data_xfer += r; /* we got some bytes */

/* (j->data_xfer > j->data_size) can't happen */
Expand Down Expand Up @@ -379,8 +366,6 @@ h_conn(const int fd, const short which, conn c)
return conn_close(c);
}

fprintf(stderr, "%d: got event %d\n", fd, which);

handle_connection(c);
while (cmd_data_ready(c) && (c->cmd_len = cmd_len(c))) do_cmd(c);
}
Expand All @@ -406,7 +391,6 @@ h_accept(const int fd, const short which, struct event *ev)
r = fcntl(cfd, F_SETFL, flags | O_NONBLOCK);
if (r < 0) return perror("setting O_NONBLOCK"), close(cfd), v();

fprintf(stderr, "got a new connection %d\n", cfd);
c = make_conn(cfd, STATE_WANTCOMMAND);
if (!c) return warn("make_conn() failed"), close(cfd), v();

Expand Down
1 change: 0 additions & 1 deletion conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ conn_update_evq(conn c, const int events, evh handler)
void
conn_close(conn c)
{
fprintf(stderr, "closing conn %d\n", c->fd);
event_del(&c->evq);

close(c->fd);
Expand Down
4 changes: 0 additions & 4 deletions prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ process_queue()
{
job j;

fprintf(stderr, "processing queue conns=%d j=%p\n", waiting_conn_p(), &ready_q[0]);
while (waiting_conn_p()) {
j = pq_take(ready_q);
fprintf(stderr, "j=%p\n", j);
if (!j) return;
warn("reserving job");
reserve_job(next_waiting_conn(), j);
}
}
Expand All @@ -100,7 +97,6 @@ enqueue_job(job j)
void
enqueue_waiting_conn(conn c)
{
fprintf(stderr, "%d: putting in wait queue\n", c->fd);
c->next = NULL;
if (waiting_conn_p()) {
waiting_conn_rear->next = c;
Expand Down

0 comments on commit 92a06db

Please sign in to comment.