comparison http.c @ 3973:549a09cf23fe libavformat

Remove offset_t typedef and use int64_t directly instead. The name offset_t is easily confused with the standard off_t type and *_t is POSIX reserved namespace if any POSIX header is included.
author diego
date Fri, 03 Oct 2008 10:16:29 +0000
parents 6f61c3b36632
children 77e0c7511d41
comparison
equal deleted inserted replaced
3972:c7a831579a13 3973:549a09cf23fe
39 typedef struct { 39 typedef struct {
40 URLContext *hd; 40 URLContext *hd;
41 unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end; 41 unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end;
42 int line_count; 42 int line_count;
43 int http_code; 43 int http_code;
44 offset_t off, filesize; 44 int64_t off, filesize;
45 char location[URL_SIZE]; 45 char location[URL_SIZE];
46 } HTTPContext; 46 } HTTPContext;
47 47
48 static int http_connect(URLContext *h, const char *path, const char *hoststr, 48 static int http_connect(URLContext *h, const char *path, const char *hoststr,
49 const char *auth, int *new_location); 49 const char *auth, int *new_location);
211 HTTPContext *s = h->priv_data; 211 HTTPContext *s = h->priv_data;
212 int post, err, ch; 212 int post, err, ch;
213 char line[1024], *q; 213 char line[1024], *q;
214 char *auth_b64; 214 char *auth_b64;
215 int auth_b64_len = strlen(auth)* 4 / 3 + 12; 215 int auth_b64_len = strlen(auth)* 4 / 3 + 12;
216 offset_t off = s->off; 216 int64_t off = s->off;
217 217
218 218
219 /* send http header */ 219 /* send http header */
220 post = h->flags & URL_WRONLY; 220 post = h->flags & URL_WRONLY;
221 auth_b64 = av_malloc(auth_b64_len); 221 auth_b64 = av_malloc(auth_b64_len);
314 url_close(s->hd); 314 url_close(s->hd);
315 av_free(s); 315 av_free(s);
316 return 0; 316 return 0;
317 } 317 }
318 318
319 static offset_t http_seek(URLContext *h, offset_t off, int whence) 319 static int64_t http_seek(URLContext *h, int64_t off, int whence)
320 { 320 {
321 HTTPContext *s = h->priv_data; 321 HTTPContext *s = h->priv_data;
322 URLContext *old_hd = s->hd; 322 URLContext *old_hd = s->hd;
323 offset_t old_off = s->off; 323 int64_t old_off = s->off;
324 324
325 if (whence == AVSEEK_SIZE) 325 if (whence == AVSEEK_SIZE)
326 return s->filesize; 326 return s->filesize;
327 else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed) 327 else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
328 return -1; 328 return -1;