~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/connection_handler_ms.h

  • Committer: Mark Atwood
  • Date: 2011-12-20 02:32:53 UTC
  • mfrom: (2469.1.1 drizzle-build)
  • Revision ID: me@mark.atwood.name-20111220023253-bvu0kr14kwsdvz7g
mergeĀ lp:~brianaker/drizzle/deprecate-pbms

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
2
 
 *
3
 
 * PrimeBase Media Stream for MySQL
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
 
 *
19
 
 * Original author: Paul McCullagh
20
 
 * Continued development: Barry Leslie
21
 
 *
22
 
 * 2007-05-25
23
 
 *
24
 
 * H&G2JCtL
25
 
 *
26
 
 * Connection Handler.
27
 
 *
28
 
 */
29
 
 
30
 
#pragma once
31
 
#ifndef __CONNECTIONHANDLER_MS_H__
32
 
#define __CONNECTIONHANDLER_MS_H__
33
 
 
34
 
#include "cslib/CSDefs.h"
35
 
#include "cslib/CSThread.h"
36
 
#include "cslib/CSHTTPStream.h"
37
 
 
38
 
#include "engine_ms.h"
39
 
 
40
 
class MSConnectionHandler : public CSDaemon {
41
 
public:
42
 
        bool    amWaitingToListen;
43
 
        bool    shuttingDown;
44
 
        time_t  lastUse;
45
 
 
46
 
        MSConnectionHandler(CSThreadList *list);
47
 
        virtual ~MSConnectionHandler(){} // Do nothing here because 'self' will no longer be valid, use completeWork().
48
 
 
49
 
        void close();
50
 
 
51
 
        virtual bool initializeWork();
52
 
 
53
 
        virtual bool doWork();
54
 
 
55
 
        virtual void *completeWork();
56
 
 
57
 
        virtual bool handleException();
58
 
 
59
 
        static int getHTTPStatus(int err);
60
 
 
61
 
        void writeException(const char *qualifier);
62
 
        void writeException();
63
 
 
64
 
        bool openStream();
65
 
        void closeStream();
66
 
 
67
 
        void serviceConnection();
68
 
        void parseRequestURI();
69
 
        void freeRequestURI();
70
 
 
71
 
        void writeFile(CSString *file_path);
72
 
        void handleGet(bool info_only);
73
 
        void handlePut();
74
 
 
75
 
        bool replyPending;
76
 
 
77
 
        static MSConnectionHandler *newHandler(CSThreadList *list);
78
 
 
79
 
private:
80
 
        CSHTTPInputStream *iInputStream;
81
 
        CSHTTPOutputStream *iOutputStream;
82
 
 
83
 
        CSString                        *iTableURI;
84
 
        
85
 
public:
86
 
        static u_long   gMaxKeepAlive;
87
 
};
88
 
 
89
 
#endif