Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
HttpResMgr.h File Reference
#include "HttpUpload.h"
Include dependency graph for HttpResMgr.h:

Go to the source code of this file.

Classes

struct  HttpResMgr
 The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files. More...
 

Macros

#define HttpResMgr_setAuthenticator(o, authenticator, realm)    HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm)
 Attach authentication using HttpDir_setAuthenticator. More...
 

Typedefs

typedef HttpResMgr HttpResMgr
 The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files. More...
 

Functions

void HttpResMgr_constructor (HttpResMgr *o, IoIntf *io, int maxUploads, const char *dirName, AllocatorIntf *alloc, S8 priority)
 Initialize the file manager; see HttpResMgr::HttpResMgr. More...
 
void HttpResMgr_destructor (HttpResMgr *o)
 Abort active uploads without freeing this object or borrowed dependencies. More...
 

Macro Definition Documentation

◆ HttpResMgr_setAuthenticator

#define HttpResMgr_setAuthenticator (   o,
  authenticator,
  realm 
)     HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm)

Attach authentication using HttpDir_setAuthenticator.

Parameters
[in,out]oInitialized manager.
[in]authenticatorBorrowed AuthenticatorIntf pointer, valid while attached, or NULL.
[in]realmBorrowed AuthorizerIntf pointer, valid while attached, or NULL. Despite the macro parameter name, this is not a realm string.
See also
HttpDir::setAuthenticator

Typedef Documentation

◆ HttpResMgr

The HttpResMgr class makes it possible for HTTP clients to use an IoIntf for uploading and downloading files.

The HttpResMgr is similar in functionality to an FTP server, but uses HTTP for the transport of data.

The HttpResMgr is implemented in C code, but we also provide a Web File Manager implemented in Lua code. See the WFS documentation for more information on the Lua version.

The HttpResMgr is designed to be used from both browser clients and non-browser clients. The HttpResMgr detects the difference between a browser and non-browser client by looking at the commands sent to the HttpResMgr resource and the upload type.

The HttpResMgr can also work with "read only" IoIntf implementations such as the ZipIo, but any "write" command type is denied.

Unlike the HttpResRdr class, the HttpResMgr does not do any translations on downloaded files. The HttpResMgr should be used for file transfer and not for serving general HTML files, images, etc, to a client. A request for a directory returns a list of all resources in the directory. This is different from the HttpResRdr class, which attempts to locate the index.html file for directory requests.

For security reasons, a HttpResMgr should not be used without an authenticator.

The HttpResMgr is an example application for how to make a class that inherits from HttpDir. The HttpResMgr class can be considered a resource collection. The HttpResMgr source code and example can be found in the example/HttpResMgr directory.

Function Documentation

◆ HttpResMgr_constructor()

void HttpResMgr_constructor ( HttpResMgr o,
IoIntf io,
int  maxUploads,
const char *  dirName,
AllocatorIntf alloc,
S8  priority 
)

Initialize the file manager; see HttpResMgr::HttpResMgr.

Parameters
[out]oCaller-owned manager storage.
[in]ioBorrowed I/O interface, valid throughout use.
[in]maxUploadsConcurrent request limit; nonpositive values select one.
[in]dirNameBorrowed directory name, valid throughout use, or NULL.
[in]allocBorrowed allocator, or NULL for the default.
[in]prioritySigned directory priority.

◆ HttpResMgr_destructor()

void HttpResMgr_destructor ( HttpResMgr o)

Abort active uploads without freeing this object or borrowed dependencies.

Parameters
[in,out]oInitialized manager whose incoming requests have stopped. Follow HttpDir lifecycle rules to detach and destroy the directory itself.