comparison http.c @ 1820:ec025d5fbbe2 libavformat

get_packetheader() forgot to read the header_checksum in big packets patch from Clemens Ladisch cladisch AT fastmail dot net (stray base64 patch reverted in the next commits)
author lu_zero
date Wed, 28 Feb 2007 03:28:31 +0000
parents eb16c64144ee
children
comparison
equal deleted inserted replaced
1819:5e4bfdf0ecaf 1820:ec025d5fbbe2
204 const char *auth, int *new_location) 204 const char *auth, int *new_location)
205 { 205 {
206 HTTPContext *s = h->priv_data; 206 HTTPContext *s = h->priv_data;
207 int post, err, ch; 207 int post, err, ch;
208 char line[1024], *q; 208 char line[1024], *q;
209 char *auth_b64; 209 char *auth_b64 = av_malloc(strlen(auth) * 4 / 3 + 12);
210 offset_t off = s->off; 210 offset_t off = s->off;
211 211
212 if (auth_b64 == NULL) return AVERROR(ENOMEM);
212 213
213 /* send http header */ 214 /* send http header */
214 post = h->flags & URL_WRONLY; 215 post = h->flags & URL_WRONLY;
215 216
216 auth_b64 = av_base64_encode((uint8_t *)auth, strlen(auth)); 217 auth_b64 = av_base64_encode(auth_b64, strlen(auth) * 4 / 3 + 12,
218 (uint8_t *)auth, strlen(auth));
219
217 snprintf(s->buffer, sizeof(s->buffer), 220 snprintf(s->buffer, sizeof(s->buffer),
218 "%s %s HTTP/1.1\r\n" 221 "%s %s HTTP/1.1\r\n"
219 "User-Agent: %s\r\n" 222 "User-Agent: %s\r\n"
220 "Accept: */*\r\n" 223 "Accept: */*\r\n"
221 "Range: bytes=%"PRId64"-\r\n" 224 "Range: bytes=%"PRId64"-\r\n"