Server-Side Gopher Internals
[Server-Side Gopher API]

Collaboration diagram for Server-Side Gopher Internals:

Classes

struct  gopher_ds

Defines

#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'
#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

Typedefs

typedef struct gopher_ds GopherStateData

Functions

static void gopherStateFree (int fdnotused, void *data)
static void gopherMimeCreate (GopherStateData *)
static void gopher_request_parse (const HttpRequest *req, char *type_id, char *request)
static void gopherHTMLHeader (StoreEntry *e, const char *title, const char *substring)
static void gopherHTMLFooter (StoreEntry *e)
static void gopherEndHTML (GopherStateData *gopherState)
static void gopherToHTML (GopherStateData *, char *inbuf, int len)
static void gopherTimeout (int fd, void *data)
static void gopherReadReply (int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data)
static void gopherSendComplete (int fd, char *buf, size_t size, comm_err_t errflag, int xerrno, void *data)
static void gopherSendRequest (int fd, void *data)
 CBDATA_TYPE (GopherStateData)

Variables

static char def_gopher_bin [] = "www/unknown"
static char def_gopher_text [] = "text/plain"

Detailed Description

Gopher is somewhat complex and gross because it must convert from the Gopher protocol to HTTP.


Define Documentation

#define GOPHER_3270   'T'

Definition at line 82 of file gopher.cc.

Referenced by gopherToHTML().

#define GOPHER_BIN   '9'

Definition at line 78 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_CSO   '2'

Definition at line 64 of file gopher.cc.

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

#define GOPHER_DIRECTORY   '1'

Definition at line 62 of file gopher.cc.

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

#define GOPHER_DOSBIN   '5'

Definition at line 70 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_ERROR   '3'

Definition at line 66 of file gopher.cc.

#define GOPHER_FILE   '0'

Definition at line 60 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_GIF   'g'

Definition at line 84 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_HTML   'h'

Definition at line 89 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_IMAGE   'I'

Definition at line 86 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_INDEX   '7'

Definition at line 74 of file gopher.cc.

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

#define GOPHER_INFO   'i'

Definition at line 91 of file gopher.cc.

Referenced by gopherToHTML().

#define GOPHER_MACBINHEX   '4'

Definition at line 68 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PLUS_IMAGE   ':'

Definition at line 101 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PLUS_MOVIE   ';'

Definition at line 103 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PLUS_SOUND   '<'

Definition at line 105 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_PORT   70

Definition at line 108 of file gopher.cc.

#define GOPHER_REDUNT   '+'

Definition at line 80 of file gopher.cc.

#define GOPHER_SOUND   's'

Definition at line 98 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_TELNET   '8'

Definition at line 76 of file gopher.cc.

Referenced by gopherToHTML().

#define GOPHER_UUENCODED   '6'

Definition at line 72 of file gopher.cc.

Referenced by gopherMimeCreate(), and gopherToHTML().

#define GOPHER_WWW   'w'

W3 address

Definition at line 96 of file gopher.cc.

Referenced by gopherMimeCreate().

#define MAX_CSO_RESULT   1024

Definition at line 116 of file gopher.cc.

#define TAB   '\t'

Definition at line 111 of file gopher.cc.

Referenced by gopherToHTML().

#define TEMP_BUF_SIZE   4096
Todo:
CODE: should this be a protocol-specific thing?

Definition at line 114 of file gopher.cc.

Referenced by gopherToHTML().


Typedef Documentation

typedef struct gopher_ds GopherStateData

Function Documentation

CBDATA_TYPE ( GopherStateData   ) 
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 266 of file gopher.cc.

References GOPHER_DIRECTORY, MAX_URL, rfc1738_unescape(), String::termedBuf(), HttpRequest::urlpath, and xstrncpy().

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

References storeAppendPrintf().

Referenced by gopherEndHTML(), and gopherToHTML().

static void gopherSendRequest ( int  fd,
void *  data 
) [static]
static void gopherStateFree ( int  fdnotused,
void *  data 
) [static]
static void gopherTimeout ( int  fd,
void *  data 
) [static]

Variable Documentation

char def_gopher_bin[] = "www/unknown" [static]

Definition at line 155 of file gopher.cc.

Referenced by gopherMimeCreate().

char def_gopher_text[] = "text/plain" [static]

Definition at line 158 of file gopher.cc.

Referenced by gopherMimeCreate().

Search

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors