summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-05-29 15:57:57 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-05-29 15:57:57 +0000
commit3a7e594166e0358aace7d521b0e55d3f434681b8 (patch)
treeb6e03266296d2ef9f61dfbfaa426a6d6c5f4cf96
parentb88395a16c3c26d668ede0bdf396dcec227195c7 (diff)
Fixed API change.
-rw-r--r--src/htsbauth.c10
-rw-r--r--src/htscatchurl.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/htsbauth.c b/src/htsbauth.c
index fb40a8b..12af086 100644
--- a/src/htsbauth.c
+++ b/src/htsbauth.c
@@ -38,6 +38,7 @@ Please visit our Website: http://www.httrack.com
/* specific definitions */
#include "htsglobal.h"
#include "htslib.h"
+#include "htscore.h"
/* END specific definitions */
@@ -231,15 +232,14 @@ int cookie_load(t_cookie * cookie, const char *fpath, const char *name) {
char dummy[512];
//
- char domain[256]; // domaine cookie (.netscape.com)
- char path[256]; // chemin (/)
+ lien_adrfil af; // chemin (/)
int cookie_merged = 0;
//
// Read all cookies
while(!feof(fp)) {
cook_name[0] = cook_value[0] = domainpathpath[0]
- = dummy[0] = domain[0] = path[0] = '\0';
+ = dummy[0] = af.adr[0] = af.fil[0] = '\0';
linput(fp, cook_name, 250);
if (!feof(fp)) {
linput(fp, cook_value, 250);
@@ -254,8 +254,8 @@ int cookie_load(t_cookie * cookie, const char *fpath, const char *name) {
if (strnotempty(cook_name)
&& strnotempty(cook_value)
&& strnotempty(domainpathpath)) {
- if (ident_url_absolute(domainpathpath, domain, path) >= 0) {
- cookie_add(cookie, cook_name, cook_value, domain, path);
+ if (ident_url_absolute(domainpathpath, &af) >= 0) {
+ cookie_add(cookie, cook_name, cook_value, af.adr, af.fil);
cookie_merged = 1;
}
}
diff --git a/src/htscatchurl.c b/src/htscatchurl.c
index e5da40b..e14eee6 100644
--- a/src/htscatchurl.c
+++ b/src/htscatchurl.c
@@ -40,6 +40,7 @@ Please visit our Website: http://www.httrack.com
#include "htsbase.h"
#include "htsnet.h"
#include "htslib.h"
+#include "htscore.h"
#include <fcntl.h>
#ifdef _WIN32
#else
@@ -174,21 +175,20 @@ HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data) {
socinput(soc, line, 1000);
if (strnotempty(line)) {
if (sscanf(line, "%s %s %s", method, url, protocol) == 3) {
- char BIGSTK url_adr[HTS_URLMAXSIZE * 2];
- char BIGSTK url_fil[HTS_URLMAXSIZE * 2];
+ lien_adrfil af;
// méthode en majuscule
size_t i;
int r = 0;
- url_adr[0] = url_fil[0] = '\0';
+ af.adr[0] = af.fil[0] = '\0';
//
for(i = 0; method[i] != '\0'; i++) {
if ((method[i] >= 'a') && (method[i] <= 'z'))
method[i] -= ('a' - 'A');
}
// adresse du lien
- if (ident_url_absolute(url, url_adr, url_fil) >= 0) {
+ if (ident_url_absolute(url, &af) >= 0) {
// Traitement des en-têtes
char BIGSTK loc[HTS_URLMAXSIZE * 2];
htsblk blkretour;
@@ -197,7 +197,7 @@ HTSEXT_API int catch_url(T_SOC soc, char *url, char *method, char *data) {
//memset(&blkretour, 0, sizeof(htsblk)); // effacer
blkretour.location = loc; // si non nul, contiendra l'adresse véritable en cas de moved xx
// Lire en têtes restants
- sprintf(data, "%s %s %s\r\n", method, url_fil, protocol);
+ sprintf(data, "%s %s %s\r\n", method, af.fil, protocol);
while(strnotempty(line)) {
socinput(soc, line, 1000);
treathead(NULL, NULL, NULL, &blkretour, line); // traiter