~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/http/hhttp_server_p.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP (HUPnP) library.
 
7
 *
 
8
 *  Herqq UPnP is free software: you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU Lesser General Public License as published by
 
10
 *  the Free Software Foundation, either version 3 of the License, or
 
11
 *  (at your option) any later version.
 
12
 *
 
13
 *  Herqq UPnP is distributed in the hope that it will be useful,
 
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
16
 *  GNU Lesser General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU Lesser General Public License
 
19
 *  along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#ifndef HHTTP_SERVER_P_H_
 
23
#define HHTTP_SERVER_P_H_
 
24
 
 
25
//
 
26
// !! Warning !!
 
27
//
 
28
// This file is not part of public API and it should
 
29
// never be included in client code. The contents of this file may
 
30
// change or the file may be removed without of notice.
 
31
//
 
32
 
 
33
#include <HUpnpCore/HUpnp>
 
34
#include <HUpnpCore/private/hhttp_asynchandler_p.h>
 
35
#include <HUpnpCore/private/hhttp_messaginginfo_p.h>
 
36
 
 
37
#include <QtNetwork/QTcpServer>
 
38
 
 
39
class QUrl;
 
40
class QString;
 
41
class QTcpSocket;
 
42
 
 
43
namespace Herqq
 
44
{
 
45
 
 
46
namespace Upnp
 
47
{
 
48
 
 
49
class HNotifyRequest;
 
50
class HSubscribeRequest;
 
51
class HUnsubscribeRequest;
 
52
class HInvokeActionRequest;
 
53
 
 
54
//
 
55
// Private class for handling HTTP server duties needed in UPnP messaging
 
56
//
 
57
class H_UPNP_CORE_EXPORT HHttpServer :
 
58
    public QObject
 
59
{
 
60
Q_OBJECT
 
61
H_DISABLE_COPY(HHttpServer)
 
62
friend class Server;
 
63
 
 
64
private:
 
65
 
 
66
    class Server :
 
67
        public QTcpServer
 
68
    {
 
69
    H_DISABLE_COPY(Server)
 
70
 
 
71
    private:
 
72
        HHttpServer* m_owner;
 
73
 
 
74
    protected:
 
75
        virtual void incomingConnection(qint32 socketDescriptor);
 
76
 
 
77
    public:
 
78
        Server(HHttpServer* owner);
 
79
    };
 
80
 
 
81
private Q_SLOTS:
 
82
 
 
83
    void msgIoComplete(HHttpAsyncOperation* op);
 
84
 
 
85
private:
 
86
 
 
87
    QList<Server*> m_servers;
 
88
 
 
89
protected:
 
90
 
 
91
    const QByteArray m_loggingIdentifier;
 
92
    HHttpAsyncHandler* m_httpHandler;
 
93
    HChunkedInfo m_chunkedInfo;
 
94
    qint32 m_maxBytesToLoad;
 
95
 
 
96
private:
 
97
 
 
98
    void processRequest(HHttpAsyncOperation*);
 
99
    void processResponse(HHttpAsyncOperation*);
 
100
 
 
101
    void processRequest(qint32 socketDescriptor);
 
102
 
 
103
    void processNotifyMessage(
 
104
        HMessagingInfo*, const HHttpRequestHeader&, const QByteArray& body);
 
105
 
 
106
    void processGet (
 
107
        HMessagingInfo*, const HHttpRequestHeader&);
 
108
 
 
109
    void processHead(
 
110
        HMessagingInfo*, const HHttpRequestHeader&);
 
111
 
 
112
    void processPost(
 
113
        HMessagingInfo*, const HHttpRequestHeader&, const QByteArray& body);
 
114
 
 
115
    void processSubscription(
 
116
        HMessagingInfo*, const HHttpRequestHeader&);
 
117
 
 
118
    void processUnsubscription(
 
119
        HMessagingInfo*, const HHttpRequestHeader&);
 
120
 
 
121
    bool setupIface(const HEndpoint&);
 
122
 
 
123
protected:
 
124
 
 
125
    virtual void incomingSubscriptionRequest(
 
126
        HMessagingInfo*, const HSubscribeRequest&);
 
127
 
 
128
    virtual void incomingUnsubscriptionRequest(
 
129
        HMessagingInfo*, const HUnsubscribeRequest&);
 
130
 
 
131
    virtual void incomingControlRequest(
 
132
        HMessagingInfo*, const HInvokeActionRequest&);
 
133
 
 
134
    virtual void incomingNotifyMessage(
 
135
        HMessagingInfo*, const HNotifyRequest&);
 
136
 
 
137
    virtual void incomingUnknownHeadRequest(
 
138
        HMessagingInfo*, const HHttpRequestHeader&);
 
139
 
 
140
    virtual void incomingUnknownGetRequest(
 
141
        HMessagingInfo*, const HHttpRequestHeader&);
 
142
 
 
143
    virtual void incomingUnknownPostRequest(
 
144
        HMessagingInfo*, const HHttpRequestHeader&, const QByteArray& body);
 
145
 
 
146
    virtual void incomingResponse(HHttpAsyncOperation*);
 
147
 
 
148
    virtual bool sendComplete(HHttpAsyncOperation*);
 
149
 
 
150
public:
 
151
 
 
152
    HHttpServer(const QByteArray& loggingIdentifier, QObject* parent = 0);
 
153
    virtual ~HHttpServer();
 
154
 
 
155
    QList<QUrl> rootUrls() const;
 
156
    QUrl rootUrl(const QHostAddress&) const;
 
157
    QList<HEndpoint> endpoints() const;
 
158
    inline qint32 endpointCount() const { return m_servers.size(); }
 
159
 
 
160
    bool init();
 
161
    bool init(const HEndpoint&);
 
162
    bool init(const QList<HEndpoint>&);
 
163
    bool isInitialized() const;
 
164
    void close();
 
165
 
 
166
    qint32 maxBytesToLoad() const;
 
167
};
 
168
 
 
169
}
 
170
}
 
171
 
 
172
#endif /* HHTTP_SERVER_P_H_ */