Changeset 24244
- Timestamp:
- 10/12/13 18:29:18 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/sock.h
r24241 r24244 590 590 char* gethttpreal(char* host, char* page, int port, char* filename, char* auth, struct download* dnode, int redirect, char* header, long* clen, int timeout, int flag) 591 591 { 592 int sock = -1, ret = 0, count = 0, hret = 0, freeheader = 0 ;592 int sock = -1, ret = 0, count = 0, hret = 0, freeheader = 0, gzip = 0; 593 593 int headerlen = 0; 594 594 unsigned int len = 0, maxret = 0; … … 726 726 len = strtoul(contentlen, NULL, 10); 727 727 } 728 if(filename == NULL && flag == 0 && ostrstr(tmpbuf, "Content-Type: application/x-gzip") != NULL) 729 gzip = 1; 728 730 729 731 if(flag == 0) headerlen = 0; … … 773 775 if(fd != NULL) fclose(fd); 774 776 sockclose(&sock); 777 778 if(gzip == 1) 779 { 780 int unzipret = 0, outlen = 0; 781 char* outbuf = NULL; 782 783 unzipret = ounzip(buf, count, &outbuf, &outlen, MINMALLOC * 100, 0); 784 if(unzipret == 0 && outbuf != NULL) 785 { 786 free(buf); buf = outbuf; 787 count = outlen; 788 } 789 else 790 { 791 err("unzip http data"); 792 } 793 } 775 794 776 795 if(filename == NULL)
Note: See TracChangeset
for help on using the changeset viewer.