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


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    5151        receive_buffer_mark_t start;
    5252        receive_buffer_mark_t end;
    53        
     53
    5454        recv_mark(rb, &start);
    5555        errno_t rc = recv_while(rb, is_digit);
     
    5959        }
    6060        recv_mark(rb, &end);
    61        
     61
    6262        rc = recv_cut_str(rb, &start, &end, str);
    6363        recv_unmark(rb, &start);
     
    7070        char *str = NULL;
    7171        errno_t rc = receive_number(rb, &str);
    72        
    73         if (rc != EOK)
    74                 return rc;
    75        
     72
     73        if (rc != EOK)
     74                return rc;
     75
    7676        rc = str_uint8_t(str, NULL, 10, true, out_value);
    7777        free(str);
    78        
     78
    7979        return rc;
    8080}
     
    8484        char *str = NULL;
    8585        errno_t rc = receive_number(rb, &str);
    86        
    87         if (rc != EOK)
    88                 return rc;
    89        
     86
     87        if (rc != EOK)
     88                return rc;
     89
    9090        rc = str_uint16_t(str, NULL, 10, true, out_value);
    9191        free(str);
    92        
     92
    9393        return rc;
    9494}
     
    116116        uint16_t status;
    117117        char *message = NULL;
    118        
     118
    119119        errno_t rc = expect(rb, "HTTP/");
    120120        if (rc != EOK)
    121121                return rc;
    122        
     122
    123123        rc = receive_uint8_t(rb, &version.major);
    124124        if (rc != EOK)
    125125                return rc;
    126        
     126
    127127        rc = expect(rb, ".");
    128128        if (rc != EOK)
    129129                return rc;
    130        
     130
    131131        rc = receive_uint8_t(rb, &version.minor);
    132132        if (rc != EOK)
    133133                return rc;
    134        
     134
    135135        rc = expect(rb, " ");
    136136        if (rc != EOK)
    137137                return rc;
    138        
     138
    139139        rc = receive_uint16_t(rb, &status);
    140140        if (rc != EOK)
    141141                return rc;
    142        
     142
    143143        rc = expect(rb, " ");
    144144        if (rc != EOK)
    145145                return rc;
    146        
     146
    147147        receive_buffer_mark_t msg_start;
    148148        recv_mark(rb, &msg_start);
    149        
     149
    150150        rc = recv_while(rb, is_not_newline);
    151151        if (rc != EOK) {
     
    153153                return rc;
    154154        }
    155        
     155
    156156        receive_buffer_mark_t msg_end;
    157157        recv_mark(rb, &msg_end);
    158        
     158
    159159        if (out_message) {
    160160                rc = recv_cut_str(rb, &msg_start, &msg_end, &message);
     
    165165                }
    166166        }
    167        
     167
    168168        recv_unmark(rb, &msg_start);
    169169        recv_unmark(rb, &msg_end);
    170        
     170
    171171        size_t nrecv;
    172172        rc = recv_eol(rb, &nrecv);
     
    177177                return rc;
    178178        }
    179        
     179
    180180        if (out_version)
    181181                *out_version = version;
     
    195195        memset(resp, 0, sizeof(http_response_t));
    196196        http_headers_init(&resp->headers);
    197        
     197
    198198        errno_t rc = http_receive_status(rb, &resp->version, &resp->status,
    199199            &resp->message);
    200200        if (rc != EOK)
    201201                goto error;
    202        
     202
    203203        rc = http_headers_receive(rb, &resp->headers, max_headers_size,
    204204            max_headers_count);
    205205        if (rc != EOK)
    206206                goto error;
    207        
     207
    208208        size_t nrecv;
    209209        rc = recv_eol(rb, &nrecv);
     
    212212        if (rc != EOK)
    213213                goto error;
    214        
     214
    215215        *out_response = resp;
    216        
     216
    217217        return EOK;
    218218error:
Note: See TracChangeset for help on using the changeset viewer.