ry / ebb fork watch download tarball
public this repo is viewable by everyone
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Ragel 6 does not require null-terminated strings
Ryan Dahl (author)
2 months ago
commit  9135730bd8c3e7c3b163b98d1d216a83b6bef5d0
tree    fc283ebc96b91ef70007dcc99ad3319ea9e85617
parent  05fac9f1f72ec39478d06178699d31fe8dd910e3
...
264
265
266
267
 
268
269
270
...
272
273
274
275
 
276
277
278
...
338
339
340
 
 
 
 
341
 
342
343
344
...
362
363
364
 
365
366
367
...
264
265
266
 
267
268
269
270
...
272
273
274
 
275
276
277
278
...
338
339
340
341
342
343
344
345
346
347
348
349
...
367
368
369
370
371
372
373
0
@@ -264,7 +264,7 @@ void on_readable(struct ev_loop *loop, ev_io *watcher, int revents)
0
   
0
   ssize_t read = recv( client->fd
0
                      , client->request_buffer + client->read
0
- , EBB_BUFFERSIZE - client->read - 1 /* -1 is for making ragel happy below */
0
+ , EBB_BUFFERSIZE - client->read //- 1 /* -1 is for making ragel happy below */
0
                      , 0
0
                      );
0
   if(read <= 0) goto error; /* XXX is this the right action to take for read==0 ? */
0
@@ -272,7 +272,7 @@ void on_readable(struct ev_loop *loop, ev_io *watcher, int revents)
0
   ev_timer_again(loop, &client->timeout_watcher);
0
   
0
   if(FALSE == client_finished_parsing) {
0
- client->request_buffer[client->read] = '\0'; /* make ragel happy */
0
+ //client->request_buffer[client->read] = '\0'; /* make ragel happy */
0
     http_parser_execute( &client->parser
0
                        , client->request_buffer
0
                        , client->read
0
@@ -338,7 +338,12 @@ void on_request(struct ev_loop *loop, ev_io *watcher, int revents)
0
   for(i = 0; i < EBB_MAX_CLIENTS; i++)
0
     if(server->clients[i].open) count += 1;
0
   g_debug("%d open connections", count);
0
+
0
+ /* does ragel fuck up if request buffer isn't null? */
0
+ for(i=0; i< EBB_BUFFERSIZE; i++)
0
+ client->request_buffer[i] = 'A';
0
 #endif
0
+
0
   client->open = TRUE;
0
   client->server = server;
0
   
0
@@ -362,6 +367,7 @@ void on_request(struct ev_loop *loop, ev_io *watcher, int revents)
0
   client->parser.content_length = content_length_cb;
0
   
0
   /* OTHER */
0
+
0
   client->env_size = 0;
0
   client->read = client->nread_from_body = 0;
0
   client->response_buffer->len = 0; /* see note in ebb_client_close */
...
59
60
61
62
 
63
64
65
...
59
60
61
 
62
63
64
65
0
@@ -59,7 +59,7 @@ size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len,
0
   p = buffer+off;
0
   pe = buffer+len;
0
   
0
- assert(*pe == '\0' && "pointer does not end on NUL");
0
+ //assert(*pe == '\0' && "pointer does not end on NUL");
0
   assert(pe - p == len - off && "pointers aren't same distance");
0
   
0
   
...
149
150
151
152
 
153
154
155
...
149
150
151
 
152
153
154
155
0
@@ -149,7 +149,7 @@ size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len,
0
   p = buffer+off;
0
   pe = buffer+len;
0
   
0
- assert(*pe == '\0' && "pointer does not end on NUL");
0
+ //assert(*pe == '\0' && "pointer does not end on NUL");
0
   assert(pe - p == len - off && "pointers aren't same distance");
0
   
0
   %% write exec;

Comments

    No one has commented yet.