gopher.cc File Reference
#include "squid.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 "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 "SquidTime.h"
#include "StatCounters.h"
#include "Store.h"
#include "tools.h"
#include "DelayPools.h"
#include "MemObject.h"
Include dependency graph for gopher.cc:

Go to the source code of this file.

Classes

class  GopherStateData
 

Macros

#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_HTML   'h'
 
#define GOPHER_INFO   'i'
 
#define GOPHER_WWW   'w'
 W3 address. More...
 
#define GOPHER_SOUND   's'
 
#define GOPHER_PLUS_IMAGE   ':'
 
#define GOPHER_PLUS_MOVIE   ';'
 
#define GOPHER_PLUS_SOUND   '<'
 
#define GOPHER_PORT   70
 
#define TAB   '\t'
 
#define TEMP_BUF_SIZE   4096
 
#define MAX_CSO_RESULT   1024
 

Functions

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)
 

Variables

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 49 of file gopher.cc.

Referenced by gopherCachable(), and gopherToHTML().

◆ GOPHER_BIN

#define GOPHER_BIN   '9'

Definition at line 47 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_CSO

#define GOPHER_CSO   '2'

◆ GOPHER_DIRECTORY

#define GOPHER_DIRECTORY   '1'

Definition at line 39 of file gopher.cc.

Referenced by gopher_request_parse(), gopherMimeCreate(), gopherSendComplete(), and gopherToHTML().

◆ GOPHER_DOSBIN

#define GOPHER_DOSBIN   '5'

Definition at line 43 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_ERROR

#define GOPHER_ERROR   '3'

Definition at line 41 of file gopher.cc.

◆ GOPHER_FILE

#define GOPHER_FILE   '0'

Definition at line 38 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_GIF

#define GOPHER_GIF   'g'

Definition at line 50 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_HTML

#define GOPHER_HTML   'h'

Definition at line 53 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_IMAGE

#define GOPHER_IMAGE   'I'

Definition at line 51 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_INDEX

#define GOPHER_INDEX   '7'

◆ GOPHER_INFO

#define GOPHER_INFO   'i'

Definition at line 54 of file gopher.cc.

Referenced by gopherToHTML().

◆ GOPHER_MACBINHEX

#define GOPHER_MACBINHEX   '4'

Definition at line 42 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_PLUS_IMAGE

#define GOPHER_PLUS_IMAGE   ':'

Definition at line 60 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_PLUS_MOVIE

#define GOPHER_PLUS_MOVIE   ';'

Definition at line 61 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_PLUS_SOUND

#define GOPHER_PLUS_SOUND   '<'

Definition at line 62 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_PORT

#define GOPHER_PORT   70

Definition at line 64 of file gopher.cc.

◆ GOPHER_REDUNT

#define GOPHER_REDUNT   '+'

Definition at line 48 of file gopher.cc.

◆ GOPHER_SOUND

#define GOPHER_SOUND   's'

Definition at line 58 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_TELNET

#define GOPHER_TELNET   '8'

Definition at line 46 of file gopher.cc.

Referenced by gopherCachable(), and gopherToHTML().

◆ GOPHER_UUENCODED

#define GOPHER_UUENCODED   '6'

Definition at line 44 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

◆ GOPHER_WWW

#define GOPHER_WWW   'w'

Definition at line 57 of file gopher.cc.

Referenced by gopherMimeCreate().

◆ MAX_CSO_RESULT

#define MAX_CSO_RESULT   1024

Definition at line 71 of file gopher.cc.

◆ TAB

#define TAB   '\t'

Definition at line 66 of file gopher.cc.

Referenced by gopherToHTML().

◆ TEMP_BUF_SIZE

#define TEMP_BUF_SIZE   4096

Definition at line 69 of file gopher.cc.

Referenced by gopherToHTML().

Function Documentation

◆ gopher_request_parse()

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

Parse a gopher request into components. By Anawat.

Definition at line 259 of file gopher.cc.

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

Referenced by gopherCachable(), and gopherStart().

◆ gopherEndHTML()

static void gopherEndHTML ( GopherStateData gopherState)
static

◆ gopherHTMLFooter()

static void gopherHTMLFooter ( StoreEntry e)
static

◆ gopherHTMLHeader()

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

Definition at line 323 of file gopher.cc.

References storeAppendPrintf().

Referenced by gopherEndHTML(), and gopherToHTML().

◆ gopherMimeCreate()

◆ gopherReadReply()

◆ gopherSendComplete()

◆ gopherSendRequest()

static void gopherSendRequest ( int  ,
void *  data 
)
static

◆ gopherStateFree()

static void gopherStateFree ( const CommCloseCbParams params)
static

Definition at line 148 of file gopher.cc.

References CommCommonCbParams::data, GopherStateData::deleteThis(), and NULL.

◆ gopherTimeout()

◆ gopherToHTML()

Variable Documentation

◆ def_gopher_bin

char def_gopher_bin[] = "www/unknown"
static

Definition at line 143 of file gopher.cc.

Referenced by gopherMimeCreate().

◆ def_gopher_text

char def_gopher_text[] = "text/plain"
static

Definition at line 145 of file gopher.cc.

Referenced by gopherMimeCreate().

◆ gopherReadReply

IOCB gopherReadReply
static

Definition at line 139 of file gopher.cc.

Referenced by gopherReadReply(), and gopherSendComplete().

◆ gopherSendComplete

IOCB gopherSendComplete
static

Definition at line 140 of file gopher.cc.

Referenced by gopherSendRequest().

◆ gopherSendRequest

PF gopherSendRequest
static

Definition at line 141 of file gopher.cc.

Referenced by gopherStart().

◆ gopherStateFree

CLCB gopherStateFree
static

Definition at line 131 of file gopher.cc.

Referenced by gopherStart().

◆ gopherTimeout

CTCB gopherTimeout
static

Definition at line 138 of file gopher.cc.

Referenced by gopherStart().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors