2014-07-25 22:08:59 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Haiku Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _B_GOPHER_REQUEST_H_
|
|
|
|
#define _B_GOPHER_REQUEST_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <deque>
|
|
|
|
|
2014-08-04 15:59:53 +02:00
|
|
|
#include <NetworkRequest.h>
|
2020-07-16 16:58:46 -05:00
|
|
|
#include <UrlProtocolRoster.h>
|
2014-07-25 22:08:59 +02:00
|
|
|
|
|
|
|
|
2021-01-22 14:20:19 +00:00
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
namespace Network {
|
2021-09-11 08:09:44 +01:00
|
|
|
|
2021-01-22 14:20:19 +00:00
|
|
|
|
2014-08-04 15:59:53 +02:00
|
|
|
class BGopherRequest : public BNetworkRequest {
|
2014-07-25 22:08:59 +02:00
|
|
|
public:
|
|
|
|
virtual ~BGopherRequest();
|
|
|
|
|
|
|
|
status_t Stop();
|
|
|
|
const BUrlResult& Result() const;
|
|
|
|
void SetDisableListener(bool disable);
|
|
|
|
|
|
|
|
private:
|
2020-07-16 16:58:46 -05:00
|
|
|
friend class BUrlProtocolRoster;
|
|
|
|
|
2020-07-24 23:45:42 -05:00
|
|
|
BGopherRequest(const BUrl& url,
|
|
|
|
BDataIO* output,
|
|
|
|
BUrlProtocolListener* listener = NULL,
|
|
|
|
BUrlContext* context = NULL);
|
2020-07-16 16:58:46 -05:00
|
|
|
|
2014-07-25 22:08:59 +02:00
|
|
|
status_t _ProtocolLoop();
|
|
|
|
void _SendRequest();
|
|
|
|
|
|
|
|
bool _NeedsParsing();
|
|
|
|
bool _NeedsLastDotStrip();
|
2021-09-11 08:09:44 +01:00
|
|
|
|
2020-07-24 23:45:42 -05:00
|
|
|
status_t _ParseInput(bool last);
|
2014-07-25 22:08:59 +02:00
|
|
|
|
|
|
|
BString& _HTMLEscapeString(BString &str);
|
|
|
|
|
|
|
|
private:
|
|
|
|
char fItemType;
|
|
|
|
BString fPath;
|
|
|
|
|
|
|
|
ssize_t fPosition;
|
|
|
|
|
|
|
|
BUrlResult fResult;
|
|
|
|
};
|
|
|
|
|
2021-09-11 08:09:44 +01:00
|
|
|
|
2021-01-22 14:20:19 +00:00
|
|
|
} // namespace Network
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
2014-07-25 22:08:59 +02:00
|
|
|
|
|
|
|
#endif // _B_GOPHER_REQUEST_H_
|