Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/http/src/response.c

    r10de842 rcbfc8b7  
    3434 */
    3535
    36 #include <errno.h>
    3736#include <stdio.h>
    3837#include <stdlib.h>
     
    4140
    4241#include <http/http.h>
     42#include <http/errno.h>
    4343
    4444static bool is_digit(char c)
     
    5454        recv_mark(rb, &start);
    5555        int rc = recv_while(rb, is_digit);
    56         if (rc != EOK) {
     56        if (rc < 0) {
    5757                recv_unmark(rb, &start);
    5858                return rc;
     
    9696static int expect(receive_buffer_t *rb, const char *expect)
    9797{
    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))
    103102                return HTTP_EPARSE;
    104103        return EOK;
     
    149148       
    150149        rc = recv_while(rb, is_not_newline);
    151         if (rc != EOK) {
     150        if (rc < 0) {
    152151                recv_unmark(rb, &msg_start);
    153152                return rc;
     
    169168        recv_unmark(rb, &msg_end);
    170169       
    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)
    174172                rc = HTTP_EPARSE;
    175         if (rc != EOK) {
     173        if (rc < 0) {
    176174                free(message);
    177175                return rc;
     
    206204                goto error;
    207205       
    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)
    211208                rc = HTTP_EPARSE;
    212         if (rc != EOK)
     209        if (rc < 0)
    213210                goto error;
    214211       
Note: See TracChangeset for help on using the changeset viewer.