GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Beanstalkd is a fast, distributed, in-memory workqueue service. Its interface is generic, but was designed for use in reducing the latency of page views in high-volume web applications by running most time-consuming tasks asynchronously.
Homepage: http://xph.us/software/beanstalkd/
Clone URL: git://github.com/kr/beanstalkd.git
Click here to lend your support to: beanstalkd and make a donation at www.pledgie.com !
Make sure lines fit in 80 columns.
kr (author)
Wed Jan 02 16:40:52 -0800 2008
commit  7a49cd570c9ebe807b9d33ddea8bdf238e744004
tree    00a05187e3d1c381b743dc1462e6d9b23c05e603
parent  c779823d106750eeeef9450dca9f132cf46a4326
0
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 /* Copyright (C) 2007 Keith Rarick and Philotic Inc.
0
 
0
- * This program is free software: you can redistribute it and/or modify and Philotic Inc.
0
+ * This program is free software: you can redistribute it and/or modify
0
  * it under the terms of the GNU General Public License as published by
0
  * the Free Software Foundation, either version 3 of the License, or
0
  * (at your option) any later version.
0
...
670
671
672
673
 
 
 
674
675
676
...
696
697
698
699
 
 
 
700
701
702
...
764
765
766
767
 
 
 
768
769
770
...
779
780
781
782
 
 
 
783
784
785
...
879
880
881
882
 
883
884
885
...
670
671
672
 
673
674
675
676
677
678
...
698
699
700
 
701
702
703
704
705
706
...
768
769
770
 
771
772
773
774
775
776
...
785
786
787
 
788
789
790
791
792
793
...
887
888
889
 
890
891
892
893
0
@@ -670,7 +670,9 @@ dispatch_cmd(conn c)
0
         break;
0
     case OP_PEEK:
0
         /* don't allow trailing garbage */
0
- if (c->cmd_len != CMD_PEEK_LEN + 2) return reply_cerr(c, CERR_BAD_FORMAT);
0
+ if (c->cmd_len != CMD_PEEK_LEN + 2) {
0
+ return reply_cerr(c, CERR_BAD_FORMAT);
0
+ }
0
 
0
         j = job_copy(peek_buried_job() ? : delay_q_peek());
0
 
0
@@ -696,7 +698,9 @@ dispatch_cmd(conn c)
0
         break;
0
     case OP_RESERVE:
0
         /* don't allow trailing garbage */
0
- if (c->cmd_len != CMD_RESERVE_LEN + 2) return reply_cerr(c, CERR_BAD_FORMAT);
0
+ if (c->cmd_len != CMD_RESERVE_LEN + 2) {
0
+ return reply_cerr(c, CERR_BAD_FORMAT);
0
+ }
0
 
0
         reserve_ct++; /* stats */
0
         conn_set_worker(c);
0
@@ -764,7 +768,9 @@ dispatch_cmd(conn c)
0
     case OP_KICK:
0
         errno = 0;
0
         count = strtoul(c->cmd + CMD_KICK_LEN, &end_buf, 10);
0
- if (end_buf == c->cmd + CMD_KICK_LEN) return reply_cerr(c, CERR_BAD_FORMAT);
0
+ if (end_buf == c->cmd + CMD_KICK_LEN) {
0
+ return reply_cerr(c, CERR_BAD_FORMAT);
0
+ }
0
         if (errno) return reply_cerr(c, CERR_BAD_FORMAT);
0
 
0
         kick_ct++; /* stats */
0
@@ -779,7 +785,9 @@ dispatch_cmd(conn c)
0
         break;
0
     case OP_STATS:
0
         /* don't allow trailing garbage */
0
- if (c->cmd_len != CMD_STATS_LEN + 2) return reply_cerr(c, CERR_BAD_FORMAT);
0
+ if (c->cmd_len != CMD_STATS_LEN + 2) {
0
+ return reply_cerr(c, CERR_BAD_FORMAT);
0
+ }
0
 
0
         stats_ct++; /* stats */
0
 
0
@@ -879,7 +887,7 @@ h_conn_data(conn c)
0
     case STATE_WANTDATA:
0
         j = c->in_job;
0
 
0
- r = read(c->fd, j->body + c->in_job_read, j->body_size - c->in_job_read);
0
+ r = read(c->fd, j->body + c->in_job_read, j->body_size -c->in_job_read);
0
         if (r == -1) return check_err(c, "read()");
0
         if (r == 0) return conn_close(c); /* the client hung up */
0
 
0
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 /* Copyright (C) 2007 Keith Rarick and Philotic Inc.
0
 
0
- * This program is free software: you can redistribute it and/or modify and Philotic Inc.
0
+ * This program is free software: you can redistribute it and/or modify
0
  * it under the terms of the GNU General Public License as published by
0
  * the Free Software Foundation, either version 3 of the License, or
0
  * (at your option) any later version.

Comments

    No one has commented yet.