Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
ftp.c File Reference
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <errno.h>
#include <sys/time.h>
#include <ctype.h>
#include "../dpip/dpip.h"
#include "dpiutil.h"
#include "d_size.h"
Include dependency graph for ftp.c:

Go to the source code of this file.

Macros

#define _MSG(...)
 
#define MSG(...)   printf("[ftp dpi]: " __VA_ARGS__)
 
#define MIN_SZ   256
 
#define READ_SZ   16*1024
 

Functions

static int a_Misc_get_content_type_from_data2 (void *Data, size_t Size, const char **PT)
 
static void make_wget_argv (char *url)
 
static int try_ftp_transfer (char *url)
 
int main (int argc, char **argv)
 

Variables

static Dshsh = NULL
 
static char ** dl_argv = NULL
 
static const ContentType_t MimeTypes []
 

Macro Definition Documentation

◆ _MSG

#define _MSG (   ...)

Definition at line 52 of file ftp.c.

◆ MIN_SZ

#define MIN_SZ   256

◆ MSG

#define MSG (   ...)    printf("[ftp dpi]: " __VA_ARGS__)

Definition at line 54 of file ftp.c.

◆ READ_SZ

#define READ_SZ   16*1024

Function Documentation

◆ a_Misc_get_content_type_from_data2()

static int a_Misc_get_content_type_from_data2 ( void *  Data,
size_t  Size,
const char **  PT 
)
static

Definition at line 90 of file ftp.c.

References dIsspace, dStrnAsciiCasecmp(), MimeTypes, and MIN.

Referenced by try_ftp_transfer().

◆ main()

◆ make_wget_argv()

static void make_wget_argv ( char *  url)
static

Definition at line 152 of file ftp.c.

References dFree(), dl_argv, dNew, Escape_uri_str(), and Filter_smtp_hack().

Referenced by try_ftp_transfer().

◆ try_ftp_transfer()

Variable Documentation

◆ dl_argv

char** dl_argv = NULL
static

Definition at line 60 of file ftp.c.

Referenced by make_wget_argv(), and try_ftp_transfer().

◆ MimeTypes

const ContentType_t MimeTypes[]
static
Initial value:
= {
{ "application/octet-stream", 24 },
{ "text/html", 9 },
{ "text/plain", 10 },
{ "image/gif", 9 },
{ "image/png", 9 },
{ "image/jpeg", 10 },
{ NULL, 0 }
}

Definition at line 70 of file ftp.c.

Referenced by a_Misc_get_content_type_from_data2().

◆ sh

Dsh* sh = NULL
static

Definition at line 59 of file ftp.c.

Referenced by main(), and try_ftp_transfer().