Skip to content

Commit

Permalink
Merge pull request h2o#9 from methane/patch-2
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
kazuho committed Dec 15, 2014
2 parents 227b253 + c488b99 commit 7823d9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ ssize_t rret;
while (1) {
/* read the request */
while ((rret = read(sock, buf + len, sizeof(buf) - len)) == -1 && errno == EINTR)
while ((rret = read(sock, buf + buflen, sizeof(buf) - buflen)) == -1 && errno == EINTR)
;
if (rret <= 0)
return IOError;
len += rret;
prevbuflen = buflen;
buflen += rret;
/* parse the request */
num_headers = sizeof(headers) / sizeof(headers[0]);
pret = phr_parse_request(rbuf, rlen, &method, &method_len, &path, &path_len,
pret = phr_parse_request(buf, buflen, &method, &method_len, &path, &path_len,
&minor_version, headers, &num_headers, prevbuflen);
if (pret > 0)
break; /* successfully parsed the request */
Expand All @@ -49,10 +50,9 @@ while (1) {
assert(pret == -2);
if (buflen == sizeof(buf))
return RequestIsTooLongError;
prevbuflen = buflen;
}
printf("request is %d bytes long\n", rlen);
printf("request is %d bytes long\n", buflen);
printf("method is %.*s\n", (int)method_len, method);
printf("path is %.*s\n", (int)path_len, path);
printf("HTTP version is 1.%d\n", minor_version);
Expand Down

0 comments on commit 7823d9b

Please sign in to comment.