This file is indexed.

/usr/include/dclib-0.3/dclib/chttp.h is in libdc-dev 0.3.24~svn3121-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/***************************************************************************
                           chttp.h  -  description
                             -------------------
    begin                : Mon Jul 29 2002
    copyright            : (C) 2002-2003 by Mathias Küster
    email                : mathen@users.berlios.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CHTTP_H
#define CHTTP_H

/**
  *@author Mathias Küster
  *
  * HTTP protocol class for downloading filelists, valknut uses
  * QT's QHttp instead.
  */

#include <dclib/dcos.h>
#include <dclib/core/cbytearray.h>
#include <dclib/core/cconnection.h>
#include <dclib/core/ccallback.h>

class CDCMessage;

enum eUrlMethod {
	eumGET,
	eumPOST
};

class CHttp : public CConnection {
public:
	/** */
	CHttp();
	/** */
	virtual ~CHttp();

	/** */
	int GetUrl( CString url, CString postdata = CString() );
	/** */
	bool GetData( CByteArray * ba );

	/** callback function */
	virtual int DC_CallBack( CDCMessage * ) { return -1; };
	/** */
	virtual void ConnectionState( eConnectionState );
	/** */
	virtual void DataAvailable( const char *, int );
	/** */
	virtual void DataSend();
	/** */
	virtual void DataTimeout();
	/** */
	virtual void Notify();

	/** */
	void SetCallBackFunction( _CCallback1<CDCMessage*> * callback );
	/** */
	CString GetUrl() { return m_sUrl; }
	/** */
	CString GetLocation() { return m_sLocation; }
	/** */
	int GetHttpError() { return m_nErrorCode; }
	/** */
	static CString Encode( CString s );
	/** */
	static CString Decode( CString s );
	/** Parses "user:pass@host:port" user, pass, port optional, port defaults to 8080 */
	static bool ParseProxy( char * proxy, CString & user, CString & pass, CString & host, unsigned int & port );

private:
	/** Called by CManager to run this instead of starting it's own thread */
	int Callback();
	/** */
	int CallBack_SendObject( CDCMessage * DCMessage );

	/** */
	void AppendData( const char * buffer, int len );
	/** */
	CList<CDCMessage> * m_pMessageList;
	/** */
	eConnectionState m_eMode;
	/** */
	CString m_sUrl;
	/** */
	CString m_sHost;
	/** */
	CString m_sPort;
	/** */
	CString m_sProxy;
	/** */
	CString m_sProxyPort;
	/** */
	CString m_sProxyUser;
	/** */
	CString m_sProxyPass;
	/** */
	eUrlMethod m_eUrlMethod;
	/** */
	int m_nErrorCode;
	/** */
	bool m_bData;
	/** */
	CString m_sLocation;
	/** */
	CString m_sHeader;
	/** */
	CString m_sPostData;
	/** */
	long m_nContentLength;
	/** */
	CByteArray m_baData;
	/** */
	_CCallback1<CDCMessage*> * m_pHttpCallback;
	/** */
	_CCallback0 * m_pCallback;
};

inline void CHttp::SetCallBackFunction( _CCallback1<CDCMessage*> * callback )
{ delete m_pHttpCallback; m_pHttpCallback = callback; }

#endif