Changeset 390fb02
- Timestamp:
- Jan 7, 2021, 5:59:02 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c3ee5f3
- Parents:
- 5ad381b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/protocol.cfa
r5ad381b r390fb02 18 18 #include "options.hfa" 19 19 20 const char * volatile date = "Wed, 17 Apr 2013 12:00:00 GMT"; 21 20 22 const char * http_msgs[] = { 21 "HTTP/1.1 200 OK\n Content-Type: text/plain\nContent-Length: %zu\n\n",22 "HTTP/1.1 400 Bad Request\n Content-Type: text/plain\nContent-Length: 0\n\n",23 "HTTP/1.1 404 Not Found\n Content-Type: text/plain\nContent-Length: 0\n\n",24 "HTTP/1.1 413 Payload Too Large\n Content-Type: text/plain\nContent-Length: 0\n\n",25 "HTTP/1.1 414 URI Too Long\n Content-Type: text/plain\nContent-Length: 0\n\n",23 "HTTP/1.1 200 OK\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: %zu \n\n", 24 "HTTP/1.1 400 Bad Request\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 25 "HTTP/1.1 404 Not Found\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 26 "HTTP/1.1 413 Payload Too Large\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 27 "HTTP/1.1 414 URI Too Long\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 26 28 }; 27 29 … … 63 65 int answer_header( int fd, size_t size ) { 64 66 const char * fmt = http_msgs[OK200]; 65 int len = 100;67 int len = 200; 66 68 char buffer[len]; 67 len = snprintf(buffer, len, fmt, size);69 len = snprintf(buffer, len, fmt, date, size); 68 70 return answer( fd, buffer, len ); 69 71 }
Note: See TracChangeset
for help on using the changeset viewer.