SerfPutReqProcImpl.cxx (e9ff7e89) SerfPutReqProcImpl.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

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

49{
50 serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
51
52 // create body bucket
53 serf_bucket_t* body_bkt = 0;
54 if ( mpData != 0 && mnDataLen > 0 )
55 {
56 body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpData, mnDataLen, 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

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

49{
50 serf_bucket_alloc_t* pSerfBucketAlloc = serf_request_get_alloc( inSerfRequest );
51
52 // create body bucket
53 serf_bucket_t* body_bkt = 0;
54 if ( mpData != 0 && mnDataLen > 0 )
55 {
56 body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpData, mnDataLen, pSerfBucketAlloc );
57 if ( useChunkedEncoding() )
58 {
59 body_bkt = serf_bucket_chunk_create( body_bkt, pSerfBucketAlloc );
60 }
61 }
62
63 // create serf request
64 serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
65 "PUT",
66 getPathStr(),
67 body_bkt,
68 serf_request_get_alloc( inSerfRequest ) );
57 }
58
59 // create serf request
60 serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
61 "PUT",
62 getPathStr(),
63 body_bkt,
64 serf_request_get_alloc( inSerfRequest ) );
65 handleChunkedEncoding(req_bkt, mnDataLen);
69
66
70 // set request header fields
71 serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
72 // general header fields provided by caller
73 setRequestHeaders( hdrs_bkt );
74
75 // request specific header fields
76 if ( body_bkt != 0 )
77 {
78 if ( useChunkedEncoding() )
79 {
80 serf_bucket_headers_set( hdrs_bkt, "Transfer-Encoding", "chunked");
81 }
82 serf_bucket_headers_set( hdrs_bkt, "Content-Length",
83 rtl::OUStringToOString( rtl::OUString::valueOf( (sal_Int32)mnDataLen ), RTL_TEXTENCODING_UTF8 ) );
84 }
85
86
87 return req_bkt;
88}
89
90void SerfPutReqProcImpl::processChunkOfResponseData( const char* /*data*/,
91 apr_size_t /*len*/ )
92{
93 // nothing to do;
94}
95
96void SerfPutReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
97{
98 // nothing to do;
99}
100
101} // namespace http_dav_ucp
67 return req_bkt;
68}
69
70void SerfPutReqProcImpl::processChunkOfResponseData( const char* /*data*/,
71 apr_size_t /*len*/ )
72{
73 // nothing to do;
74}
75
76void SerfPutReqProcImpl::handleEndOfResponseData( serf_bucket_t * /*inSerfResponseBucket*/ )
77{
78 // nothing to do;
79}
80
81} // namespace http_dav_ucp