server: intialize aux_header buffer to null if the data is missing.
[tridge/openchange.git] / branches / plugfest / mapiproxy / libmapiserver / libmapiserver_oxcfxics.c
1 /*
2    OpenChange Server implementation
3
4    EMSMDBP: EMSMDB Provider implementation
5
6    Copyright (C) Inverse inc. 2010
7    Copyright (C) Brad Hards <bradh@openchange.org> 2011
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22
23 /**
24    \file libmapiserver_oxcfxics.c
25
26    \brief OXCFXICS ROP Response size calculations
27  */
28
29 #include "libmapiserver.h"
30
31 /**
32    \details Calculate FastTransferSourceCopyTo (0x4d) Rop size
33
34    \param response pointer to the FastTransferSourceCopyTo EcDoRpc_MAPI_REPL
35    structure
36
37    \return Size of FastTransferSourceCopyTo response
38  */
39 _PUBLIC_ uint16_t libmapiserver_RopFastTransferSourceCopyTo_size(struct EcDoRpc_MAPI_REPL *response)
40 {
41         return SIZE_DFLT_MAPI_RESPONSE;
42 }
43
44
45 /**
46    \details Calculate FastTransferSourceGetBuffer (0x4e) Rop size
47
48    \param response pointer to the FastTransferSourceGetBuffer EcDoRpc_MAPI_REPL
49    structure
50
51    \return Size of FastTransferSourceGetBuffer response
52  */
53 _PUBLIC_ uint16_t libmapiserver_RopFastTransferSourceGetBuffer_size(struct EcDoRpc_MAPI_REPL *response)
54 {
55         uint16_t        size = SIZE_DFLT_MAPI_RESPONSE;
56
57         size += SIZE_DFLT_ROPFASTTRANSFERSOURCEGETBUFFER; 
58
59         if (response->error_code == ecServerBusy) {
60                 size += sizeof (uint32_t); /* size of BackoffTime */
61         } else {
62                 size += response->u.mapi_FastTransferSourceGetBuffer.TransferBuffer.length;
63         }
64
65         return size;
66 }