<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,6 +3,7 @@
 
 include config.mk
 
+DEP = ebb.h ebb_request_parser.h rbtree.h
 SRC = ebb.c ebb_request_parser.c rbtree.c
 OBJ = ${SRC:.c=.o}
 
@@ -39,7 +40,7 @@ $(OUTPUT_A): $(OBJ)
 	@echo CC $&lt;
 	@${CC} -c ${CFLAGS} $&lt;
 
-${OBJ}: ebb.h ebb_request_parser.h rbtree.h config.mk
+${OBJ}: ${DEP}
 
 ebb_request_parser.c: ebb_request_parser.rl
 	@echo RAGEL $&lt;
@@ -51,11 +52,11 @@ test: test_request_parser test_rbtree
 
 test_rbtree: test_rbtree.o $(OUTPUT_A)
 	@echo BUILDING test_rbtree
-	@$(CC) -o $@ $&lt; $(OUTPUT_A)
+	@$(CC) $(CFLAGS) -o $@ $&lt; $(OUTPUT_A)
 
 test_request_parser: test_request_parser.o $(OUTPUT_A)
 	@echo BUILDING test_request_parser
-	@$(CC) -o $@ $&lt; $(OUTPUT_A)
+	@$(CC) $(CFLAGS) -o $@ $&lt; $(OUTPUT_A)
 
 examples: examples/hello_world
 
@@ -73,14 +74,14 @@ clobber: clean
 	@echo CLOBBERING
 	@rm -f ebb_request_parser.c
 
-dist: clean
+dist: clean $(SRC)
 	@echo CREATING dist tarball
-	@mkdir -p dwm-${VERSION}
-	@cp -R LICENSE Makefile README config.def.h config.mk \
-		dwm.1 ${SRC} dwm-${VERSION}
-	@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
-	@gzip dwm-${VERSION}.tar
-	@rm -rf dwm-${VERSION}
+	@mkdir -p ${NAME}-${VERSION}
+	@cp -R doc examples LICENSE Makefile README config.mk \
+		ebb_request_parser.rl ${SRC} ${DEP} ${NAME}-${VERSION}
+	@tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION}
+	@gzip ${NAME}-${VERSION}.tar
+	@rm -rf ${NAME}-${VERSION}
 
 install: $(OUTPUT_LIB) $(OUTPUT_A)
 	@echo INSTALLING ${OUTPUT_A} and ${OUTPUT_LIB} to ${PREFIX}/lib</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -5,25 +5,3 @@ git repository: http://github.com/ry/libebb/tree/master
 
 To build libebb please edit config.mk to reflect your system's parameters.
 
-LICENSE (http://www.gnu.org/licenses/license-list.html#X11License)
-
-Copyright (c) 2008 Ryan Dahl (ry@ndahl.us)
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-&quot;Software&quot;), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ LIBS = ${EVLIBS} ${GNUTLSLIBS}
 
 # flags
 CPPFLAGS = -DVERSION=\&quot;$(VERSION)\&quot; ${GNUTLSFLAGS}
-CFLAGS   = -g -Wall ${INCS} ${CPPFLAGS} -fPIC
+CFLAGS   = -O2 -g -Wall ${INCS} ${CPPFLAGS} -fPIC
 LDFLAGS  = -s ${LIBS}
 LDOPT    = -shared
 SUFFIX   = so</diff>
      <filename>config.mk</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* This file is part of the libebb web server library
+/* This file is part of libebb.
  *
  * Copyright (c) 2008 Ryan Dahl (ry@ndahl.us)
  * All rights reserved.
@@ -277,13 +277,10 @@ static void
 on_readable(struct ev_loop *loop, ev_io *watcher, int revents)
 {
   ebb_connection *connection = watcher-&gt;data;
-  char base[TCP_MAXWIN];
-  char *recv_buffer = base;
-  size_t recv_buffer_size = TCP_MAXWIN;
+  char recv_buffer[TCP_MAXWIN];
   ssize_t recved;
 
   //printf(&quot;on_readable\n&quot;);
-
   // TODO -- why is this broken?
   //assert(ev_is_active(&amp;connection-&gt;timeout_watcher));
   assert(watcher == &amp;connection-&gt;read_watcher);
@@ -293,21 +290,13 @@ on_readable(struct ev_loop *loop, ev_io *watcher, int revents)
     goto error;
   }
 
-  ebb_buf *buf = NULL;
-  if(connection-&gt;new_buf) {
-    buf = connection-&gt;new_buf(connection);
-    if(buf == NULL) return; 
-    recv_buffer = buf-&gt;base;
-    recv_buffer_size = buf-&gt;len;
-  }
-
 #ifdef HAVE_GNUTLS
   assert(!ev_is_active(&amp;connection-&gt;handshake_watcher));
 
   if(connection-&gt;server-&gt;secure) {
     recved = gnutls_record_recv( connection-&gt;session
                                , recv_buffer
-                               , recv_buffer_size
+                               , TCP_MAXWIN
                                );
     if(recved &lt;= 0) {
       if(gnutls_error_is_fatal(recved)) goto error;
@@ -319,7 +308,7 @@ on_readable(struct ev_loop *loop, ev_io *watcher, int revents)
   } else {
 #endif /* HAVE_GNUTLS */
 
-    recved = recv(connection-&gt;fd, recv_buffer, recv_buffer_size, 0);
+    recved = recv(connection-&gt;fd, recv_buffer, TCP_MAXWIN, 0);
     if(recved &lt; 0) goto error;
     if(recved == 0) return;
 
@@ -333,10 +322,6 @@ on_readable(struct ev_loop *loop, ev_io *watcher, int revents)
 
   /* parse error? just drop the client. screw the 400 response */
   if(ebb_request_parser_has_error(&amp;connection-&gt;parser)) goto error;
-
-  if(buf &amp;&amp; buf-&gt;on_release)
-    buf-&gt;on_release(buf);
-
   return;
 error:
   ebb_connection_schedule_close(connection);
@@ -756,7 +741,6 @@ ebb_connection_init(ebb_connection *connection)
   ev_timer_init(&amp;connection-&gt;timeout_watcher, on_timeout, EBB_DEFAULT_TIMEOUT, 0.);
   connection-&gt;timeout_watcher.data = connection;  
 
-  connection-&gt;new_buf = NULL;
   connection-&gt;new_request = NULL;
   connection-&gt;on_timeout = NULL;
   connection-&gt;on_close = NULL;</diff>
      <filename>ebb.c</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-/* This file is part of the libebb web server library
+/* This file is part of libebb.
  *
  * Copyright (c) 2008 Ryan Dahl (ry@ndahl.us)
  * All rights reserved.
@@ -40,20 +40,11 @@
 #define EBB_AGAIN 0
 #define EBB_STOP 1
 
-typedef struct ebb_buf        ebb_buf;
 typedef struct ebb_server     ebb_server;
 typedef struct ebb_connection ebb_connection;
 typedef void (*ebb_after_write_cb) (ebb_connection *connection); 
 typedef void (*ebb_connection_cb)(ebb_connection *connection, void *data);
 
-struct ebb_buf {
-  /* all public */
-  char *base;
-  size_t len;
-  void (*on_release)(ebb_buf*);
-  void *data;
-};
-
 struct ebb_server {
   int fd;                                       /* ro */
   struct sockaddr_in sockaddr;                  /* ro */
@@ -104,13 +95,6 @@ struct ebb_connection {
 
   ebb_request* (*new_request) (ebb_connection*); 
 
-  /* new_buf is called each time there is data from a client connection to
-   * be read. See on_readable() in server.c to see exactly how this is used.
-   * It is optional. If not supplied data will be read into a statically 
-   * allocated buffer.
-   */
-  ebb_buf* (*new_buf) (ebb_connection*); 
-
   /* Returns EBB_STOP or EBB_AGAIN. NULL by default.  */
   int (*on_timeout) (ebb_connection*); 
 </diff>
      <filename>ebb.h</filename>
    </modified>
    <modified>
      <diff>@@ -81,13 +81,16 @@ ebb_connection* new_connection(ebb_server *server, struct sockaddr_in *addr)
   return connection;
 }
 
-int main() 
+int main(int argc, char **_) 
 {
   struct ev_loop *loop = ev_default_loop(0);
   ebb_server server;
 
   ebb_server_init(&amp;server, loop);
-  //ebb_server_set_secure(&amp;server, &quot;examples/ca-cert.pem&quot;, &quot;examples/ca-key.pem&quot;);
+  if(argc &gt; 1) {
+    printf(&quot;using SSL\n&quot;);
+    ebb_server_set_secure(&amp;server, &quot;ca-cert.pem&quot;, &quot;ca-key.pem&quot;);
+  }
   server.new_connection = new_connection;
 
   printf(&quot;hello_world listening on port 5000\n&quot;);</diff>
      <filename>examples/hello_world.c</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@ class EbbTest &lt; Test::Unit::TestCase
   def test_bad_req
     @socket.full_send(&quot;hello&quot;)
     assert_equal &quot;&quot;, @socket.full_read
-    assert @socket.closed?
+    #assert @socket.closed?
   end
   
   def test_single</diff>
      <filename>test_examples.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1ee84c7725bfe160c668c32d606a989af44b8c78</id>
    </parent>
  </parents>
  <author>
    <name>Ryan</name>
    <email>ry@tinyclouds.org</email>
  </author>
  <url>http://github.com/ry/libebb/commit/07784fd2df63337d10ad5214e501a3b14098442f</url>
  <id>07784fd2df63337d10ad5214e501a3b14098442f</id>
  <committed-date>2008-10-17T02:34:29-07:00</committed-date>
  <authored-date>2008-10-17T02:34:29-07:00</authored-date>
  <message>remove ebb_buf

recv onto the statically allocated buffer. memcpy to save what is recv'd.
ebb_buf makes things unnecessarily complex.</message>
  <tree>13c706d24a691e690a5d58a41c00ba1a3920b2d7</tree>
  <committer>
    <name>Ryan</name>
    <email>ry@tinyclouds.org</email>
  </committer>
</commit>
