http.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef __HTTP_H
  2. #define __HTTP_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2008, Daniel Stenberg, <[email protected]>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at http://curl.haxx.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. ***************************************************************************/
  25. #ifndef CURL_DISABLE_HTTP
  26. extern const struct Curl_handler Curl_handler_http;
  27. #ifdef USE_SSL
  28. extern const struct Curl_handler Curl_handler_https;
  29. #endif
  30. bool Curl_compareheader(const char *headerline, /* line to check */
  31. const char *header, /* header keyword _with_ colon */
  32. const char *content); /* content string to find */
  33. char *Curl_copy_header_value(const char *h);
  34. /* ftp can use this as well */
  35. CURLcode Curl_proxyCONNECT(struct connectdata *conn,
  36. int tunnelsocket,
  37. const char *hostname, unsigned short remote_port);
  38. /* protocol-specific functions set up to be called by the main engine */
  39. CURLcode Curl_http(struct connectdata *conn, bool *done);
  40. CURLcode Curl_http_done(struct connectdata *, CURLcode, bool premature);
  41. CURLcode Curl_http_connect(struct connectdata *conn, bool *done);
  42. /* The following functions are defined in http_chunks.c */
  43. void Curl_httpchunk_init(struct connectdata *conn);
  44. CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap,
  45. ssize_t length, ssize_t *wrote);
  46. /* These functions are in http.c */
  47. void Curl_http_auth_stage(struct SessionHandle *data, int stage);
  48. CURLcode Curl_http_input_auth(struct connectdata *conn,
  49. int httpcode, const char *header);
  50. CURLcode Curl_http_auth_act(struct connectdata *conn);
  51. CURLcode Curl_http_perhapsrewind(struct connectdata *conn);
  52. int Curl_http_should_fail(struct connectdata *conn);
  53. /* If only the PICKNONE bit is set, there has been a round-trip and we
  54. selected to use no auth at all. Ie, we actively select no auth, as opposed
  55. to not having one selected. The other CURLAUTH_* defines are present in the
  56. public curl/curl.h header. */
  57. #define CURLAUTH_PICKNONE (1<<30) /* don't use auth */
  58. /* MAX_INITIAL_POST_SIZE indicates the number of bytes that will make the POST
  59. data get included in the initial data chunk sent to the server. If the
  60. data is larger than this, it will automatically get split up in multiple
  61. system calls.
  62. This value used to be fairly big (100K), but we must take into account that
  63. if the server rejects the POST due for authentication reasons, this data
  64. will always be uncondtionally sent and thus it may not be larger than can
  65. always be afforded to send twice.
  66. It must not be greater than 64K to work on VMS.
  67. */
  68. #ifndef MAX_INITIAL_POST_SIZE
  69. #define MAX_INITIAL_POST_SIZE (64*1024)
  70. #endif
  71. #ifndef TINY_INITIAL_POST_SIZE
  72. #define TINY_INITIAL_POST_SIZE 1024
  73. #endif
  74. #endif
  75. #endif