http.c (63236) | http.c (63281) |
---|---|
1/*- 2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/lib/libfetch/http.c 63236 2000-07-16 01:04:10Z des $ | 28 * $FreeBSD: head/lib/libfetch/http.c 63281 2000-07-16 23:18:44Z des $ |
29 */ 30 31/* 32 * The following copyright applies to the base64 code: 33 * 34 *- 35 * Copyright 1997 Massachusetts Institute of Technology 36 * --- 72 unchanged lines hidden (view full) --- 109 int fd; 110 char *buf; 111 size_t b_size; 112 size_t b_len; 113 int b_pos; 114 int eof; 115 int error; 116 long chunksize; | 29 */ 30 31/* 32 * The following copyright applies to the base64 code: 33 * 34 *- 35 * Copyright 1997 Massachusetts Institute of Technology 36 * --- 72 unchanged lines hidden (view full) --- 109 int fd; 110 char *buf; 111 size_t b_size; 112 size_t b_len; 113 int b_pos; 114 int eof; 115 int error; 116 long chunksize; |
117#ifdef DEBUG | 117#ifndef NDEBUG |
118 long total; 119#endif 120}; 121 122/* 123 * Get next chunk header 124 */ 125static int --- 10 unchanged lines hidden (view full) --- 136 for (p = c->buf; !isspace(*p) && *p != ';' && p < c->buf + c->b_len; ++p) 137 if (!ishexnumber(*p)) 138 return -1; 139 else if (isdigit(*p)) 140 c->chunksize = c->chunksize * 16 + *p - '0'; 141 else 142 c->chunksize = c->chunksize * 16 + 10 + tolower(*p) - 'a'; 143 | 118 long total; 119#endif 120}; 121 122/* 123 * Get next chunk header 124 */ 125static int --- 10 unchanged lines hidden (view full) --- 136 for (p = c->buf; !isspace(*p) && *p != ';' && p < c->buf + c->b_len; ++p) 137 if (!ishexnumber(*p)) 138 return -1; 139 else if (isdigit(*p)) 140 c->chunksize = c->chunksize * 16 + *p - '0'; 141 else 142 c->chunksize = c->chunksize * 16 + 10 + tolower(*p) - 'a'; 143 |
144#ifdef DEBUG | 144#ifndef NDEBUG |
145 c->total += c->chunksize; 146 if (c->chunksize == 0) 147 fprintf(stderr, "\033[1m_http_fillbuf(): " 148 "end of last chunk\033[m\n"); 149 else 150 fprintf(stderr, "\033[1m_http_fillbuf(): " 151 "new chunk: %ld (%ld)\033[m\n", c->chunksize, c->total); 152#endif --- 868 unchanged lines hidden --- | 145 c->total += c->chunksize; 146 if (c->chunksize == 0) 147 fprintf(stderr, "\033[1m_http_fillbuf(): " 148 "end of last chunk\033[m\n"); 149 else 150 fprintf(stderr, "\033[1m_http_fillbuf(): " 151 "new chunk: %ld (%ld)\033[m\n", c->chunksize, c->total); 152#endif --- 868 unchanged lines hidden --- |