Changes in uspace/lib/http/src/response.c [cbfc8b7:10de842] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/http/src/response.c
rcbfc8b7 r10de842 34 34 */ 35 35 36 #include <errno.h> 36 37 #include <stdio.h> 37 38 #include <stdlib.h> … … 40 41 41 42 #include <http/http.h> 42 #include <http/errno.h>43 43 44 44 static bool is_digit(char c) … … 54 54 recv_mark(rb, &start); 55 55 int rc = recv_while(rb, is_digit); 56 if (rc < 0) {56 if (rc != EOK) { 57 57 recv_unmark(rb, &start); 58 58 return rc; … … 96 96 static int expect(receive_buffer_t *rb, const char *expect) 97 97 { 98 int rc = recv_discard_str(rb, expect); 99 if (rc < 0) 100 return rc; 101 if ((size_t) rc < str_length(expect)) 98 size_t ndisc; 99 int rc = recv_discard_str(rb, expect, &ndisc); 100 if (rc != EOK) 101 return rc; 102 if (ndisc < str_length(expect)) 102 103 return HTTP_EPARSE; 103 104 return EOK; … … 148 149 149 150 rc = recv_while(rb, is_not_newline); 150 if (rc < 0) {151 if (rc != EOK) { 151 152 recv_unmark(rb, &msg_start); 152 153 return rc; … … 168 169 recv_unmark(rb, &msg_end); 169 170 170 rc = recv_eol(rb); 171 if (rc == 0) 171 size_t nrecv; 172 rc = recv_eol(rb, &nrecv); 173 if (rc == EOK && nrecv == 0) 172 174 rc = HTTP_EPARSE; 173 if (rc < 0) {175 if (rc != EOK) { 174 176 free(message); 175 177 return rc; … … 204 206 goto error; 205 207 206 rc = recv_eol(rb); 207 if (rc == 0) 208 size_t nrecv; 209 rc = recv_eol(rb, &nrecv); 210 if (rc == EOK && nrecv == 0) 208 211 rc = HTTP_EPARSE; 209 if (rc < 0)212 if (rc != EOK) 210 213 goto error; 211 214
Note:
See TracChangeset
for help on using the changeset viewer.