Mercurial > urweb
comparison src/c/driver.c @ 136:133fa2d51bb4
Dynamic arena allocation
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 17 Jul 2008 14:18:57 -0400 |
parents | 94856a3b4752 |
children | d6d78055f001 |
comparison
equal
deleted
inserted
replaced
135:b1cfe49ce692 | 136:133fa2d51bb4 |
---|---|
70 return; | 70 return; |
71 } | 71 } |
72 | 72 |
73 printf("Serving URI %s....\n", path); | 73 printf("Serving URI %s....\n", path); |
74 | 74 |
75 ctx = lw_init(1024); | 75 ctx = lw_init(1024, 1024); |
76 lw_write (ctx, "HTTP/1.1 200 OK\r\n"); | 76 lw_write (ctx, "HTTP/1.1 200 OK\r\n"); |
77 lw_write(ctx, "Content-type: text/html\r\n\r\n"); | 77 lw_write(ctx, "Content-type: text/html\r\n\r\n"); |
78 lw_write(ctx, "<html>"); | 78 lw_write(ctx, "<html>"); |
79 lw_handle(ctx, path); | 79 lw_handle(ctx, path); |
80 lw_write(ctx, "</html>"); | 80 lw_write(ctx, "</html>"); |
81 | 81 |
82 lw_send(ctx, sock); | 82 lw_send(ctx, sock); |
83 | 83 |
84 lw_free(ctx); | |
84 printf("Done with client.\n\n"); | 85 printf("Done with client.\n\n"); |
85 close(sock); | 86 close(sock); |
86 return; | 87 return; |
87 } | 88 } |
88 } | 89 } |