This file is indexed.

/usr/include/sipxtapi/net/HttpConnectionMap.h is in libsipxtapi-dev 3.3.0~test17-2.1.

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
// 
// Copyright (C) 2006 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
// 
// Copyright (C) 2006 Pingtel Corp.
// Licensed to SIPfoundry under a Contributor Agreement.
// 
// $$
//////////////////////////////////////////////////////////////////////////////

#ifndef _HttpConnectionMap_h_
#define _HttpConnectionMap_h_

// SYSTEM INCLUDES

// APPLICATION INCLUDES
#include <os/OsDefs.h>
#include <net/HttpServer.h>
#include <net/HttpBody.h>
#include <net/NameValuePair.h>
#include <os/OsSocket.h>
#include <os/OsConnectionSocket.h>
#include <os/OsTimeLog.h>
#include <os/OsMsgQ.h>
#include <utl/UtlHashMap.h>
#include <os/OsBSem.h>

// DEFINES

class HttpConnectionMapEntry : public UtlString
{
public:
    /// Constructor
    HttpConnectionMapEntry(const UtlString& name);
    
    /// Destructor
    virtual ~HttpConnectionMapEntry();
    
    OsConnectionSocket* mpSocket; //< pointer to a connection socket
    OsBSem              mLock;    //< protects access to the connection
    bool                mbInUse;  //< true if entry is in use, false if not
    static int          count;    //< used to udentify the entry
};

class HttpConnectionMap : public UtlHashMap
{
/* //////////////////////////// PUBLIC //////////////////////////////////// */
public:
   /// Get pointer to singleton instance of the connection map
   static HttpConnectionMap* getHttpConnectionMap();
   
   /**<
    * @returns
    * - pointer to the instance of the connectiomn map
    */   
   
   /// Release instance of connection map
   void releaseHttpConnectionMap();
   
   /// Clear all entries in map. Close all sockets and delete them.
   void clearHttpConnectionMap();
   
   /// Return a map entry for an existing connection or NULL. Locks the connection if non-NULL
   HttpConnectionMapEntry* getPersistentConnection(const Url& url, OsConnectionSocket*& socket);
   
   /**<
    * @returns
    * - pointer to a connection map entry and a connection socket. If no entry exists for a 
    *   given URI one will be created and th socket pointer will be set to NULL.
    * - NULL if the connection does not exist
    */      

/* ============================ MANIPULATORS ============================== */
/* ============================ ACCESSORS ================================= */
/* ============================ INQUIRY =================================== */
/* //////////////////////////// PROTECTED ///////////////////////////////// */
protected:

/* //////////////////////////// PRIVATE /////////////////////////////////// */
private:
    //! Constructor
    HttpConnectionMap();

    //! Destructor
    virtual ~HttpConnectionMap();
    
    /// Translate Url into key string that will be used for all further access
    void getPersistentUriKey(const Url& url, UtlString& key);       

    static HttpConnectionMap* pInstance; ///< pointer to the instance
    static OsBSem mLock;                 ///< protects access to map
    
    /// no copy constructor
    HttpConnectionMap(const HttpConnectionMap& nocopy);

    /// no assignment operator
    HttpConnectionMap& operator=(const HttpConnectionMap& noassignment);    
};

/* ============================ INLINE METHODS ============================ */

#endif  // _HttpConnectionMap_h_