Changeset 132ab5d1 in mainline for uspace/lib/http/src/response.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

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

    r8bfb163 r132ab5d1  
    3434 */
    3535
     36#include <errno.h>
    3637#include <stdio.h>
    3738#include <stdlib.h>
     
    4041
    4142#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 < 0) {
     56        if (rc != EOK) {
    5757                recv_unmark(rb, &start);
    5858                return rc;
     
    9696static int expect(receive_buffer_t *rb, const char *expect)
    9797{
    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))
    102103                return HTTP_EPARSE;
    103104        return EOK;
     
    148149       
    149150        rc = recv_while(rb, is_not_newline);
    150         if (rc < 0) {
     151        if (rc != EOK) {
    151152                recv_unmark(rb, &msg_start);
    152153                return rc;
     
    168169        recv_unmark(rb, &msg_end);
    169170       
    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)
    172174                rc = HTTP_EPARSE;
    173         if (rc < 0) {
     175        if (rc != EOK) {
    174176                free(message);
    175177                return rc;
     
    204206                goto error;
    205207       
    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)
    208211                rc = HTTP_EPARSE;
    209         if (rc < 0)
     212        if (rc != EOK)
    210213                goto error;
    211214       
Note: See TracChangeset for help on using the changeset viewer.