comparison src/c/http.c @ 1119:951fced704d6

Basis.textBlob; support HTTP requests with no headers
author Adam Chlipala <adamc@hcoop.net>
date Tue, 05 Jan 2010 15:53:35 -0500
parents db52c32dbe42
children 0cee0c8d8c37
comparison
equal deleted inserted replaced
1118:87b0a9d08e73 1119:951fced704d6
145 back += r; 145 back += r;
146 *back = 0; 146 *back = 0;
147 } 147 }
148 } 148 }
149 149
150 body[-4] = '\r';
151 body[-3] = '\n';
152
150 if (!(s = strstr(buf, "\r\n"))) { 153 if (!(s = strstr(buf, "\r\n"))) {
151 fprintf(stderr, "No newline in request\n"); 154 fprintf(stderr, "No newline in request\n");
152 close(sock); 155 close(sock);
153 goto done; 156 goto done;
154 } 157 }
158
159 body[-4] = body[-3] = 0;
155 160
156 *s = 0; 161 *s = 0;
157 headers = s + 2; 162 headers = s + 2;
158 method = s = buf; 163 method = s = buf;
159 164