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