response_headers_handler.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /** **************************************************************************
  2. * response_headers_handler.h
  3. *
  4. * Copyright 2008 Bryan Ischo <[email protected]>
  5. *
  6. * This file is part of libs3.
  7. *
  8. * libs3 is free software: you can redistribute it and/or modify it under the
  9. * terms of the GNU Lesser General Public License as published by the Free
  10. * Software Foundation, version 3 or above of the License. You can also
  11. * redistribute and/or modify it under the terms of the GNU General Public
  12. * License, version 2 or above of the License.
  13. *
  14. * In addition, as a special exception, the copyright holders give
  15. * permission to link the code of this library and its programs with the
  16. * OpenSSL library, and distribute linked combinations including the two.
  17. *
  18. * libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
  19. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  20. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  21. * details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public License
  24. * version 3 along with libs3, in a file named COPYING. If not, see
  25. * <https://www.gnu.org/licenses/>.
  26. *
  27. * You should also have received a copy of the GNU General Public License
  28. * version 2 along with libs3, in a file named COPYING-GPLv2. If not, see
  29. * <https://www.gnu.org/licenses/>.
  30. *
  31. ************************************************************************** **/
  32. #ifndef RESPONSE_HEADERS_HANDLER_H
  33. #define RESPONSE_HEADERS_HANDLER_H
  34. #include "libs3.h"
  35. #include "string_buffer.h"
  36. #include "util.h"
  37. #ifdef WINSCP
  38. #include "ne_request.h"
  39. #endif
  40. typedef struct ResponseHeadersHandler
  41. {
  42. // The structure to pass to the headers callback. This is filled in by
  43. // the ResponseHeadersHandler from the headers added to it.
  44. S3ResponseProperties responseProperties;
  45. // Set to 1 after the done call has been made
  46. int done;
  47. // copied into here. We allow 128 bytes for each header, plus \0 term.
  48. string_multibuffer(responsePropertyStrings, 5 * 129);
  49. // responseproperties.metaHeaders strings get copied into here
  50. string_multibuffer(responseMetaDataStrings,
  51. COMPACTED_METADATA_BUFFER_SIZE);
  52. // Response meta data
  53. S3NameValue responseMetaData[S3_MAX_METADATA_COUNT];
  54. } ResponseHeadersHandler;
  55. void response_headers_handler_initialize(ResponseHeadersHandler *handler);
  56. void response_headers_handler_add(ResponseHeadersHandler *handler,
  57. const char * header_name, const char * header_value); // WINSCP (neon API)
  58. void response_headers_handler_done(ResponseHeadersHandler *handler,
  59. ne_request *NeonRequest); // WINSCP (neon API)
  60. #ifdef WINSCP
  61. typedef int NeonCode;
  62. #endif
  63. #endif /* RESPONSE_HEADERS_HANDLER_H */