Changeset 24220 for titan/titan/sock.h


Ignore:
Timestamp:
10/12/13 09:56:48 (10 years ago)
Author:
nit
Message:

[titan] add parameter to get only http header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/sock.h

    r23091 r24220  
    587587//flag 0: output without header
    588588//flag 1: output with header
     589//flag 2: output only header
    589590char* gethttpreal(char* host, char* page, int port, char* filename, char* auth, struct download* dnode, int redirect, char* header, long* clen, int timeout, int flag)
    590591{
     
    698699                }
    699700                pbuf++;
     701        }
     702
     703        if(flag == 3)
     704        {
     705                if(headerlen > 0)
     706                {
     707                        count = headerlen;
     708                        headerlen = 0;
     709                        if(filename != NULL)
     710                                fwrite(tmpbuf, count, 1, fd);
     711                        else
     712                        {
     713                                buf = realloc(buf, count);
     714                                memcpy(buf, tmpbuf, count);
     715                        }
     716                }
     717       
     718                goto end;
    700719        }
    701720
Note: See TracChangeset for help on using the changeset viewer.