SerfPropPatchReqProcImpl.cxx (e9ff7e89) SerfPropPatchReqProcImpl.cxx (10e20387)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 121 unchanged lines hidden (view full) ---

130 // add PropPatch xml header in front
131 aBodyText = rtl::OUString::createFromAscii( PROPPATCH_HEADER ) + aBodyText;
132
133 // add PropPatch xml trailer at end
134 aBodyText += rtl::OUString::createFromAscii( PROPPATCH_TRAILER );
135
136 body_bkt = SERF_BUCKET_SIMPLE_STRING( rtl::OUStringToOString( aBodyText, RTL_TEXTENCODING_UTF8 ),
137 pSerfBucketAlloc );
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 121 unchanged lines hidden (view full) ---

130 // add PropPatch xml header in front
131 aBodyText = rtl::OUString::createFromAscii( PROPPATCH_HEADER ) + aBodyText;
132
133 // add PropPatch xml trailer at end
134 aBodyText += rtl::OUString::createFromAscii( PROPPATCH_TRAILER );
135
136 body_bkt = SERF_BUCKET_SIMPLE_STRING( rtl::OUStringToOString( aBodyText, RTL_TEXTENCODING_UTF8 ),
137 pSerfBucketAlloc );
138 if ( useChunkedEncoding() )
139 {
140 body_bkt = serf_bucket_chunk_create( body_bkt, pSerfBucketAlloc );
141 }
142 }
143 }
144
145 // create serf request
146 serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
147 "PROPPATCH",
148 getPathStr(),
149 body_bkt,
150 pSerfBucketAlloc ) ;
138 }
139 }
140
141 // create serf request
142 serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
143 "PROPPATCH",
144 getPathStr(),
145 body_bkt,
146 pSerfBucketAlloc ) ;
147 handleChunkedEncoding(req_bkt, aBodyText.getLength());
151
152 // set request header fields
153 serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
148
149 // set request header fields
150 serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
154 // general header fields provided by caller
155 setRequestHeaders( hdrs_bkt );
156
157 // request specific header fields
158 if ( body_bkt != 0 && aBodyText.getLength() > 0 )
151 if (hdrs_bkt != NULL)
159 {
152 {
160 if ( useChunkedEncoding() )
153 // general header fields provided by caller
154 setRequestHeaders( hdrs_bkt );
155
156 // request specific header fields
157 if ( body_bkt != 0 && aBodyText.getLength() > 0 )
161 {
158 {
162 serf_bucket_headers_set( hdrs_bkt, "Transfer-Encoding", "chunked");
159 serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
163 }
160 }
164 serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
165 serf_bucket_headers_set( hdrs_bkt, "Content-Length",
166 rtl::OUStringToOString( rtl::OUString::valueOf( aBodyText.getLength() ), RTL_TEXTENCODING_UTF8 ) );
167 }
161 }
162 else
163 {
164 OSL_ASSERT("Headers Bucket missing");
165 }
168
169 return req_bkt;
170}
171
172void SerfPropPatchReqProcImpl::processChunkOfResponseData( const char* /*data*/,
173 apr_size_t /*len*/ )
174{
175 // nothing to do;
176}
177
178void SerfPropPatchReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
179{
180 // nothing to do;
181}
182
183} // namespace http_dav_ucp
166
167 return req_bkt;
168}
169
170void SerfPropPatchReqProcImpl::processChunkOfResponseData( const char* /*data*/,
171 apr_size_t /*len*/ )
172{
173 // nothing to do;
174}
175
176void SerfPropPatchReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
177{
178 // nothing to do;
179}
180
181} // namespace http_dav_ucp