summaryrefslogtreecommitdiff
path: root/src/htscore.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-08-15 12:40:06 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-08-15 12:40:06 +0000
commitffefedefa9543f9bbdbf7d93a8a66fe4a6b96a2f (patch)
treebd98d9743a29ee7a70bf9b17981a1e311212d435 /src/htscore.c
parent84cdc70b4a00a7a2938ff8f3c782cfd78ab069b8 (diff)
Added %a option, allowing to define the "Accept:" header line.
Added %X option, to define additional request header lines. Cleaned up a bit the messy strcat everywhere in the request section (yuk).
Diffstat (limited to 'src/htscore.c')
-rw-r--r--src/htscore.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/htscore.c b/src/htscore.c
index 8c86914..3315409 100644
--- a/src/htscore.c
+++ b/src/htscore.c
@@ -830,16 +830,18 @@ int httpmirror(char *url1, httrackp * opt) {
// recopier proxy
if ((r.req.proxy.active = opt->proxy.active)) {
if (StringBuff(opt->proxy.bindhost) != NULL)
- strcpybuff(r.req.proxy.bindhost, StringBuff(opt->proxy.bindhost));
+ r.req.proxy.bindhost = StringBuff(opt->proxy.bindhost);
if (StringBuff(opt->proxy.name) != NULL)
- strcpybuff(r.req.proxy.name, StringBuff(opt->proxy.name));
+ r.req.proxy.name = StringBuff(opt->proxy.name);
r.req.proxy.port = opt->proxy.port;
}
// et user-agent
- strcpy(r.req.user_agent, StringBuff(opt->user_agent));
- strcpy(r.req.referer, StringBuff(opt->referer));
- strcpy(r.req.from, StringBuff(opt->from));
- strcpy(r.req.lang_iso, StringBuff(opt->lang_iso));
+ r.req.user_agent = StringBuff(opt->user_agent);
+ r.req.referer = StringBuff(opt->referer);
+ r.req.from = StringBuff(opt->from);
+ r.req.lang_iso = StringBuff(opt->lang_iso);
+ r.req.accept = StringBuff(opt->accept);
+ r.req.headers = StringBuff(opt->headers);
r.req.user_agent_send = opt->user_agent_send;
if (!error) {