Merge pull request #3 from Stephen-Seo/master

Fix bug where downloading a +2GB file over HTTPS fails at exactly 2GB
master
Farsheed Ashouri 6 years ago committed by GitHub
commit d740a7772d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -192,7 +192,7 @@ static void inline close_on_exec(int fd)
#ifdef USE_SSL #ifdef USE_SSL
extern int ssl_read(struct REQUEST *req, char *buf, int len); extern int ssl_read(struct REQUEST *req, char *buf, int len);
extern int ssl_write(struct REQUEST *req, char *buf, int len); extern int ssl_write(struct REQUEST *req, char *buf, int len);
extern int ssl_blk_write(struct REQUEST *req, int offset, int len); extern int ssl_blk_write(struct REQUEST *req, off_t offset, size_t len);
extern void init_ssl(void); extern void init_ssl(void);
extern void open_ssl_session(struct REQUEST *req); extern void open_ssl_session(struct REQUEST *req);
#endif #endif

@ -64,14 +64,13 @@ int ssl_write(struct REQUEST *req, char *buf, int len)
return rc; return rc;
} }
int ssl_blk_write(struct REQUEST *req, int offset, int len) int ssl_blk_write(struct REQUEST *req, off_t offset, size_t len)
{ {
int rc; int rc;
char buf[4096]; char buf[4096];
if (lseek(req->bfd, offset, SEEK_SET) == -1) { if (lseek(req->bfd, offset, SEEK_SET) == -1) {
if (debug) if (debug) perror("lseek");
perror("lseek");
return -1; return -1;
} }

Loading…
Cancel
Save