aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-06-05 08:26:13 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-06-05 08:26:13 +0000
commit138fe1b9349abfd43366e0fd15e0ec24febac99e (patch)
tree40b99034b33385da74a1d69b635c708571a619fa /src/main.c
parentd46932369a188937726fd0f472d86e33bc572c7d (diff)
using the new formparse, the new getenv, using the new headers struct and
clean up the headers better
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/src/main.c b/src/main.c
index 24df3062a..9a8de7498 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,7 +49,6 @@
#include <curl/types.h> /* new for v7 */
#include <curl/easy.h> /* new for v7 */
#include <curl/mprintf.h>
-#include "../lib/getdate.h"
#include "urlglob.h"
#define CURLseparator "--_curl_--"
@@ -305,8 +304,7 @@ struct Configurable {
TimeCond timecond;
time_t condtime;
- struct HttpHeader *headers;
- struct HttpHeader *last_header;
+ struct curl_slist *headers;
struct HttpPost *httppost;
struct HttpPost *last_post;
@@ -369,7 +367,6 @@ static int getparameter(char *flag, /* f or -long-flag */
char letter;
char *parse=NULL;
int res;
- struct HttpHeader *head;
int j;
time_t now;
int hit=-1;
@@ -634,7 +631,7 @@ static int getparameter(char *flag, /* f or -long-flag */
case 'F':
/* "form data" simulation, this is a little advanced so lets do our best
to sort this out slowly and carefully */
- if(curl_FormParse(nextarg,
+ if(curl_formparse(nextarg,
&config->httppost,
&config->last_post))
return CURLE_FAILED_INIT;
@@ -644,21 +641,8 @@ static int getparameter(char *flag, /* f or -long-flag */
help();
return CURLE_FAILED_INIT;
case 'H':
- head = (struct HttpHeader *)malloc(sizeof(struct HttpHeader));
- if(head) {
- head->next = NULL;
- head->header = NULL; /* first zero this */
- GetStr(&head->header, nextarg); /* now get the header line */
-
- /* point on our new one */
- if(config->last_header)
- config->last_header->next = head;
- else {
- config->headers = head;
- }
-
- config->last_header = head;
- }
+ /* A custom header to append to a list */
+ config->headers = curl_slist_append(config->headers, nextarg);
break;
case 'i':
config->conf ^= CONF_HEADER; /* include the HTTP header as well */
@@ -839,7 +823,7 @@ static int parseconfig(char *filename,
#define CURLRC DOT_CHAR "curlrc"
- home = curl_GetEnv("HOME"); /* portable environment reader */
+ home = curl_getenv("HOME"); /* portable environment reader */
if(!home)
return CURLE_OK;
@@ -1359,6 +1343,8 @@ int main(int argc, char *argv[])
#endif
curl_slist_free_all(config.quote); /* the checks for config.quote == NULL */
+ curl_slist_free_all(config.postquote); /* */
+ curl_slist_free_all(config.headers); /* */
return(res);
}