File Reference
#include "squid.h"
#include "base/AsyncCbdataCalls.h"
#include "comm.h"
#include "comm/Read.h"
#include "comm/Write.h"
#include "errorpage.h"
#include "fd.h"
#include "FwdState.h"
#include "globals.h"
#include "gopher.h"
#include "html_quote.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "MemBuf.h"
#include "mime.h"
#include "parser/Tokenizer.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "StatCounters.h"
#include "Store.h"
#include "tools.h"
#include "DelayPools.h"
#include "MemObject.h"
Include dependency graph for

Go to the source code of this file.


class  GopherStateData


#define GOPHER_FILE   '0'
#define GOPHER_DIRECTORY   '1'
#define GOPHER_CSO   '2'
#define GOPHER_ERROR   '3'
#define GOPHER_MACBINHEX   '4'
#define GOPHER_DOSBIN   '5'
#define GOPHER_UUENCODED   '6'
#define GOPHER_INDEX   '7'
#define GOPHER_TELNET   '8'
#define GOPHER_BIN   '9'
#define GOPHER_REDUNT   '+'
#define GOPHER_3270   'T'
#define GOPHER_GIF   'g'
#define GOPHER_IMAGE   'I'
#define GOPHER_PLUS_IMAGE   ':'
#define GOPHER_PLUS_MOVIE   ';'
#define GOPHER_PLUS_SOUND   '<'
#define GOPHER_HTML   'h'
#define GOPHER_INFO   'i'
#define GOPHER_WWW   'w'
#define GOPHER_SOUND   's'
#define GOPHER_PORT   70
#define TAB   '\t'
#define TEMP_BUF_SIZE   4096
#define MAX_CSO_RESULT   1024


static void gopherMimeCreate (GopherStateData *)
static void gopher_request_parse (const HttpRequest *req, char *type_id, char *request)
static void gopherEndHTML (GopherStateData *)
static void gopherToHTML (GopherStateData *, char *inbuf, int len)
static void gopherStateFree (const CommCloseCbParams &params)
int gopherCachable (const HttpRequest *req)
static void gopherHTMLHeader (StoreEntry *e, const char *title, const char *substring)
static void gopherHTMLFooter (StoreEntry *e)
static void gopherTimeout (const CommTimeoutCbParams &io)
static void gopherReadReply (const Comm::ConnectionPointer &conn, char *buf, size_t len, Comm::Flag flag, int xerrno, void *data)
static void gopherSendComplete (const Comm::ConnectionPointer &conn, char *, size_t size, Comm::Flag errflag, int xerrno, void *data)
static void gopherSendRequest (int, void *data)
void gopherStart (FwdState *fwd)


static CLCB gopherStateFree
static CTCB gopherTimeout
static IOCB gopherReadReply
static IOCB gopherSendComplete
static PF gopherSendRequest
static char def_gopher_bin [] = "www/unknown"
static char def_gopher_text [] = "text/plain"

Macro Definition Documentation

◆ GOPHER_3270

#define GOPHER_3270   'T'

Definition at line 50 of file


#define GOPHER_BIN   '9'

Definition at line 48 of file


#define GOPHER_CSO   '2'

Definition at line 41 of file


#define GOPHER_DIRECTORY   '1'

Definition at line 40 of file


#define GOPHER_DOSBIN   '5'

Definition at line 44 of file


#define GOPHER_ERROR   '3'

Definition at line 42 of file


#define GOPHER_FILE   '0'

Definition at line 39 of file


#define GOPHER_GIF   'g'

Definition at line 51 of file


#define GOPHER_HTML   'h'

Definition at line 61 of file


#define GOPHER_IMAGE   'I'

Definition at line 52 of file


#define GOPHER_INDEX   '7'

Definition at line 46 of file


#define GOPHER_INFO   'i'

Definition at line 62 of file


#define GOPHER_MACBINHEX   '4'

Definition at line 43 of file


#define GOPHER_PLUS_IMAGE   ':'

Definition at line 56 of file


#define GOPHER_PLUS_MOVIE   ';'

Definition at line 57 of file


#define GOPHER_PLUS_SOUND   '<'

Definition at line 58 of file


#define GOPHER_PORT   70

Definition at line 66 of file


#define GOPHER_REDUNT   '+'

Definition at line 49 of file


#define GOPHER_SOUND   's'

Definition at line 64 of file


#define GOPHER_TELNET   '8'

Definition at line 47 of file


#define GOPHER_UUENCODED   '6'

Definition at line 45 of file


#define GOPHER_WWW   'w'

Definition at line 63 of file


#define MAX_CSO_RESULT   1024

Definition at line 73 of file


#define TAB   '\t'

Definition at line 68 of file


#define TEMP_BUF_SIZE   4096

Definition at line 71 of file

Function Documentation

◆ gopher_request_parse()

static void gopher_request_parse ( const HttpRequest req,
char *  type_id,
char *  request 

Parse a gopher request into components. By Anawat.

Definition at line 311 of file

References GOPHER_DIRECTORY, MAX_URL, AnyP::Uri::path(), request(), rfc1738_unescape(), SBufToCstring(), and HttpRequest::url.

Referenced by gopherCachable(), and gopherStart().

◆ gopherEndHTML()

static void gopherEndHTML ( GopherStateData gopherState)

◆ gopherHTMLFooter()

static void gopherHTMLFooter ( StoreEntry e)

◆ gopherHTMLHeader()

static void gopherHTMLHeader ( StoreEntry e,
const char *  title,
const char *  substring 

Definition at line 375 of file

References storeAppendPrintf().

Referenced by gopherEndHTML(), and gopherToHTML().

◆ gopherMimeCreate()

◆ gopherReadReply()

static void gopherReadReply ( const Comm::ConnectionPointer conn,
char *  buf,
size_t  len,
Comm::Flag  flag,
int  xerrno,
void *  data 

◆ gopherSendComplete()

◆ gopherSendRequest()

static void gopherSendRequest ( int  ,
void *  data 

◆ gopherStateFree()

static void gopherStateFree ( const CommCloseCbParams params)

Definition at line 162 of file

References CommCommonCbParams::data.

◆ gopherTimeout()

◆ gopherToHTML()

Variable Documentation

◆ def_gopher_bin

char def_gopher_bin[] = "www/unknown"

Definition at line 157 of file

Referenced by gopherMimeCreate().

◆ def_gopher_text

char def_gopher_text[] = "text/plain"

Definition at line 159 of file

Referenced by gopherMimeCreate().

◆ gopherReadReply

IOCB gopherReadReply

Definition at line 153 of file

Referenced by GopherStateData::DelayAwareRead(), and gopherReadReply().

◆ gopherSendComplete

IOCB gopherSendComplete

Definition at line 154 of file

Referenced by gopherSendRequest().

◆ gopherSendRequest

PF gopherSendRequest

Definition at line 155 of file

Referenced by gopherStart().

◆ gopherStateFree

CLCB gopherStateFree

Definition at line 145 of file

Referenced by gopherStart().

◆ gopherTimeout

CTCB gopherTimeout

Definition at line 152 of file

Referenced by gopherStart().






Web Site Translations