mpm_cache_stream.c File Reference

Storage routines for the cache module. More...

#include "mapiproxy/dcesrv_mapiproxy.h"
#include "mapiproxy/libmapiproxy/libmapiproxy.h"
#include "mapiproxy/modules/mpm_cache.h"
#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"
#include <util/debug.h>

Functions

NTSTATUS mpm_cache_stream_close (struct mpm_stream *stream)
 
stat h types h NTSTATUS mpm_cache_stream_open (struct mpm_cache *mpm, struct mpm_stream *stream)
 
NTSTATUS mpm_cache_stream_read (struct mpm_stream *stream, size_t input_size, size_t *length, uint8_t **data)
 
NTSTATUS mpm_cache_stream_reset (struct mpm_stream *stream)
 
NTSTATUS mpm_cache_stream_write (struct mpm_stream *stream, uint16_t length, uint8_t *data)
 

Detailed Description

Storage routines for the cache module.

Function Documentation

NTSTATUS mpm_cache_stream_close ( struct mpm_stream stream)

Close the filesystem stream

Parameters
streampointer to the mpm_stream entry
Returns
NT_STATUS_OK on success, otherwise NT_STATUS_NOT_FOUND

References mpm_stream::fp.

Referenced by cache_exec_sync_cmd(), cache_pull_Release(), and cache_unbind().

stat h types h NTSTATUS mpm_cache_stream_open ( struct mpm_cache mpm,
struct mpm_stream stream 
)

Create a file: message or attachment in the cache

If the stream is attached to an attachment: FolderID/MessageID/AttachmentID.stream If the stream is attached to a message: FolderID/MessageID.stream

Parameters
mpmpointer to the cache module general structure
streampointer to the mpm_stream entry
Returns
Return a FILE pointer otherwise NULL

References mpm_stream::attachment, mpm_attachment::AttachmentID, mpm_cache::dbpath, mpm_stream::filename, mpm_message::FolderId, mpm_stream::fp, mpm_attachment::message, mpm_stream::message, mpm_message::MessageId, MPM_LOCATION, and mpm_stream::offset.

Referenced by cache_exec_sync_cmd(), and mpm_cache_ldb_add_stream().

NTSTATUS mpm_cache_stream_read ( struct mpm_stream stream,
size_t  input_size,
size_t *  length,
uint8_t **  data 
)

Read input_size bytes from a local binary stream

Parameters
streampointer to the mpm_stream entry
input_sizethe number of bytes to read
lengthoutput pointer to the length effectively read from the stream
dataoutput pointer to the binary data read from the stream
Returns
NT_STATUS_OK

References mpm_stream::fp, MPM_LOCATION, and mpm_stream::offset.

Referenced by cache_dispatch().

NTSTATUS mpm_cache_stream_reset ( struct mpm_stream stream)

Rewind a stream to the beginning

Parameters
streampointer to the mpm_stream entry
Returns
NT_STATUS_OK on success

References mpm_stream::fp, and mpm_stream::offset.

Referenced by cache_dispatch().

NTSTATUS mpm_cache_stream_write ( struct mpm_stream stream,
uint16_t  length,
uint8_t *  data 
)

Write length bytes to a local stream

Parameters
streampointer to the mpm_stream entry
lengththe data length to write to the stream
datapointer to the data to write to the stream
Returns
NT_STATUS_OK on success, otherwise NT_STATUS_UNSUCCESSFUL

References mpm_stream::fp, MPM_LOCATION, and mpm_stream::offset.

Referenced by cache_dispatch(), and cache_push_ReadStream().


Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/