MCPcopy Create free account
hub / github.com/apache/httpd / dav_set_bufsize

Function dav_set_bufsize

modules/dav/main/util.c:122–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122DAV_DECLARE(void) dav_set_bufsize(apr_pool_t * p, dav_buffer *pbuf,
123 apr_size_t size)
124{
125 /* NOTE: this does not retain prior contents */
126
127 /* NOTE: this function is used to init the first pointer, too, since
128 the PAD will be larger than alloc_len (0) for zeroed structures */
129
130 /* grow if we don't have enough for the requested size plus padding */
131 if (size + DAV_BUFFER_PAD > pbuf->alloc_len) {
132 /* set the new length; min of MINSIZE */
133 pbuf->alloc_len = size + DAV_BUFFER_PAD;
134 if (pbuf->alloc_len < DAV_BUFFER_MINSIZE)
135 pbuf->alloc_len = DAV_BUFFER_MINSIZE;
136
137 pbuf->buf = apr_palloc(p, pbuf->alloc_len);
138 }
139 pbuf->cur_len = size;
140}
141
142
143/* initialize a buffer and copy the specified (null-term'd) string into it */

Callers 6

dav_buffer_initFunction · 0.85
dav_build_keyFunction · 0.85
dav_propdb_openFunction · 0.85
dav_fs_copymove_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected