summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
Diffstat (limited to 'amiga')
-rw-r--r--amiga/download.c9
-rwxr-xr-xamiga/fetch_file.c20
2 files changed, 20 insertions, 9 deletions
diff --git a/amiga/download.c b/amiga/download.c
index 2172fb8cc..064923eff 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -252,14 +252,15 @@ void ami_free_download_list(struct List *dllist)
}while(node=nnode);
}
-void gui_window_save_as_link(struct gui_window *g, struct content *c)
+void
+gui_window_save_link(struct gui_window *g, const char *url, const char *title)
{
BPTR fh = 0;
char fname[1024];
STRPTR openurlstring,linkname;
struct DiskObject *dobj = NULL;
- linkname = ASPrintf("Link_to_%s",FilePart(c->url));
+ linkname = ASPrintf("Link_to_%s",FilePart(url));
if(AslRequestTags(savereq,
ASLFR_TitleText,messages_get("NetSurf"),
@@ -272,11 +273,11 @@ void gui_window_save_as_link(struct gui_window *g, struct content *c)
ami_update_pointer(g->shared->win,GUI_POINTER_WAIT);
if(fh = FOpen(fname,MODE_NEWFILE,0))
{
- openurlstring = ASPrintf("openurl \"%s\"\n",c->url);
+ openurlstring = ASPrintf("openurl \"%s\"\n",url);
FWrite(fh,openurlstring,1,strlen(openurlstring));
FClose(fh);
FreeVec(openurlstring);
- SetComment(fname,c->url);
+ SetComment(fname,url);
dobj = GetIconTags(NULL,ICONGETA_GetDefaultName,"url",
ICONGETA_GetDefaultType,WBPROJECT,
diff --git a/amiga/fetch_file.c b/amiga/fetch_file.c
index 953478423..bc03962ab 100755
--- a/amiga/fetch_file.c
+++ b/amiga/fetch_file.c
@@ -56,7 +56,7 @@ static bool ami_fetch_file_initialise(const char *scheme);
static void ami_fetch_file_finalise(const char *scheme);
static void * ami_fetch_file_setup(struct fetch *parent_fetch, const char *url,
bool only_2xx, const char *post_urlenc,
- struct form_successful_control *post_multipart,
+ struct fetch_multipart_data *post_multipart,
const char **headers);
static bool ami_fetch_file_start(void *vfetch);
static void ami_fetch_file_abort(void *vf);
@@ -135,7 +135,7 @@ void ami_fetch_file_finalise(const char *scheme)
void * ami_fetch_file_setup(struct fetch *parent_fetch, const char *url,
bool only_2xx, const char *post_urlenc,
- struct form_successful_control *post_multipart,
+ struct fetch_multipart_data *post_multipart,
const char **headers)
{
struct ami_file_fetch_info *fetch;
@@ -280,6 +280,7 @@ void ami_fetch_file_poll(const char *scheme_ignored)
if(fetch->fh)
{
+ char header[64];
struct ExamineData *fib;
if(fib = ExamineObjectTags(EX_FileHandleInput,fetch->fh,TAG_DONE))
{
@@ -291,9 +292,18 @@ void ami_fetch_file_poll(const char *scheme_ignored)
fetch->mimetype = fetch_mimetype(fetch->path);
LOG(("mimetype %s len %ld",fetch->mimetype,fetch->len));
- ami_fetch_file_send_callback(FETCH_TYPE,
- fetch, fetch->mimetype, (ULONG)fetch->len,
- errorcode);
+ snprintf(header, sizeof header,
+ "Content-Type: %s",
+ fetch->mimetype);
+ ami_fetch_file_send_callback(FETCH_HEADER,
+ fetch, header, strlen(header), errorcode);
+
+ snprintf(header, sizeof header,
+ "Content-Length: %ld",
+ fetch->len);
+ ami_fetch_file_send_callback(FETCH_HEADER,
+ fetch, header, strlen(header), errorcode);
+
}
else
{