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

#define GOPHER_3270   'T'

Definition at line 49 of file gopher.cc.

Referenced by gopherCachable(), and gopherToHTML().

#define GOPHER_BIN   '9'

Definition at line 47 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_CSO   '2'
#define GOPHER_DIRECTORY   '1'

Definition at line 39 of file gopher.cc.

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

#define GOPHER_DOSBIN   '5'

Definition at line 43 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_ERROR   '3'

Definition at line 41 of file gopher.cc.

#define GOPHER_FILE   '0'

Definition at line 38 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_GIF   'g'

Definition at line 50 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_HTML   'h'

Definition at line 53 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_IMAGE   'I'

Definition at line 51 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_INDEX   '7'
#define GOPHER_INFO   'i'

Definition at line 54 of file gopher.cc.

Referenced by gopherToHTML().

#define GOPHER_MACBINHEX   '4'

Definition at line 42 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PLUS_IMAGE   ':'

Definition at line 60 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PLUS_MOVIE   ';'

Definition at line 61 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PLUS_SOUND   '<'

Definition at line 62 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PORT   70

Definition at line 64 of file gopher.cc.

#define GOPHER_REDUNT   '+'

Definition at line 48 of file gopher.cc.

#define GOPHER_SOUND   's'

Definition at line 58 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_TELNET   '8'

Definition at line 46 of file gopher.cc.

Referenced by gopherCachable(), and gopherToHTML().

#define GOPHER_UUENCODED   '6'

Definition at line 44 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_WWW   'w'

Definition at line 57 of file gopher.cc.

Referenced by gopherMimeCreate().

#define MAX_CSO_RESULT   1024

Definition at line 71 of file gopher.cc.

#define TAB   '\t'

Definition at line 66 of file gopher.cc.

Referenced by gopherToHTML().

#define TEMP_BUF_SIZE   4096

Definition at line 69 of file gopher.cc.

Referenced by gopherToHTML().

Function Documentation

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

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

Referenced by gopherCachable(), and gopherStart().

static void gopherEndHTML ( GopherStateData gopherState)
static
static void gopherHTMLFooter ( StoreEntry e)
static
static void gopherHTMLHeader ( StoreEntry e,
const char *  title,
const char *  substring 
)
static

Definition at line 324 of file gopher.cc.

References storeAppendPrintf().

Referenced by gopherEndHTML(), and gopherToHTML().

static void gopherSendRequest ( int  ,
void *  data 
)
static
static void gopherStateFree ( const CommCloseCbParams params)
static

Definition at line 148 of file gopher.cc.

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

Variable Documentation

char def_gopher_bin[] = "www/unknown"
static

Definition at line 143 of file gopher.cc.

Referenced by gopherMimeCreate().

char def_gopher_text[] = "text/plain"
static

Definition at line 145 of file gopher.cc.

Referenced by gopherMimeCreate().

IOCB gopherReadReply
static

Definition at line 139 of file gopher.cc.

Referenced by gopherReadReply(), and gopherSendComplete().

IOCB gopherSendComplete
static

Definition at line 140 of file gopher.cc.

Referenced by gopherSendRequest().

PF gopherSendRequest
static

Definition at line 141 of file gopher.cc.

Referenced by gopherStart().

CLCB gopherStateFree
static

Definition at line 131 of file gopher.cc.

Referenced by gopherStart().

CTCB gopherTimeout
static

Definition at line 138 of file gopher.cc.

Referenced by gopherStart().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors