PACK Qt Binding  $VERSION$
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
wobnam_p.h
Go to the documentation of this file.
1 // Copyright (C) 2013 by Konrad Rosenbaum <konrad@silmor.de>
2 // protected under the GNU LGPL version 3 or at your option any newer.
3 // See COPYING.LGPL file that comes with this distribution.
4 //
5 
6 #ifndef WOB_NAM_P_H
7 #define WOB_NAM_P_H
8 
9 
10 #include <QNetworkReply>
11 #include <QNetworkRequest>
12 #include <QSslSocket>
13 #include <QLocalSocket>
14 
16 class WobScgiNetworkReplyImpl:public QNetworkReply
17 {
18  Q_OBJECT
19 public:
21  WobScgiNetworkReplyImpl(QNetworkRequest,QByteArray op,QIODevice*, QObject* parent);
23  void abort()override;
25  void close()override;
27  qint64 bytesAvailable() const override;
28  bool isSequential() const override{return true;}
30  qint64 size()const override;
31 
32 public slots:
34  virtual void ignoreSslErrors()override;
35 
36 protected:
38  qint64 readData(char *data, qint64 maxSize) override;
39 
40 private slots:
42  void sockerror(QAbstractSocket::SocketError);
44  void lsockerror(QLocalSocket::LocalSocketError);
46  void startwrite();
48  void sockabort();
50  void sockread();
51 
52 private:
53  QByteArray outcontent,incontent,inhead;
54  qint64 offset;
55  QIODevice*sock;
56  QByteArray op;
57 
58  enum ReadMode {HeadRead,ContentRead}readMode;
59 
61  void finishUp();
62 };
63 
64 
65 #endif
virtual void ignoreSslErrors() override
relays SSL errors
Definition: wobnam.cpp:135
qint64 readData(char *data, qint64 maxSize) override
implementation of reading body data
Definition: wobnam.cpp:111
bool isSequential() const override
Definition: wobnam_p.h:28
void close() override
closes the reply stream, call this only if you are no longer interested in the answer ...
Definition: wobnam.cpp:133
qint64 bytesAvailable() const override
returns the amount of body data available to be read
Definition: wobnam.cpp:122
qint64 size() const override
returns the complete size of the body
Definition: wobnam.cpp:127
void abort() override
abort the reception (just closes the stream, does not actually abort anything yet) ...
Definition: wobnam.cpp:132
Definition: wobnam_p.h:16
WobScgiNetworkReplyImpl(QNetworkRequest, QByteArray op, QIODevice *, QObject *parent)
creates a new reply handler/receiver
Definition: wobnam.cpp:54