From ae1912cb0d494b48d514d937826c9fe83ec96c4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 29 Dec 1999 14:20:26 +0000 Subject: Initial revision --- lib/http.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/http.h (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h new file mode 100644 index 000000000..be35842cf --- /dev/null +++ b/lib/http.h @@ -0,0 +1,45 @@ +#ifndef __HTTP_H +#define __HTTP_H + +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Curl. + * + * The Initial Developer of the Original Code is Daniel Stenberg. + * + * Portions created by the Initial Developer are Copyright (C) 1998. + * All Rights Reserved. + * + * ------------------------------------------------------------ + * Main author: + * - Daniel Stenberg + * + * http://curl.haxx.nu + * + * $Source$ + * $Revision$ + * $Date$ + * $Author$ + * $State$ + * $Locker$ + * + * ------------------------------------------------------------ + ****************************************************************************/ +UrgError http(struct UrlData *data, char *path, char *host, long *bytecountp); + +#endif -- cgit v1.2.1 From 96dde76b99897352aa3d0877a0b621a9e605733e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 22 May 2000 14:12:12 +0000 Subject: moved here from the newlib branch --- lib/http.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index be35842cf..6a4d8c835 100644 --- a/lib/http.h +++ b/lib/http.h @@ -40,6 +40,9 @@ * * ------------------------------------------------------------ ****************************************************************************/ -UrgError http(struct UrlData *data, char *path, char *host, long *bytecountp); + +CURLcode http(struct connectdata *conn); +CURLcode http_done(struct connectdata *conn); +CURLcode http_connect(struct connectdata *conn); #endif -- cgit v1.2.1 From 1ef3600a0731fef8f59563a1e49981f1b64b9746 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 20 Jun 2000 15:31:26 +0000 Subject: haxx.nu => haxx.se --- lib/http.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 6a4d8c835..372b670c5 100644 --- a/lib/http.h +++ b/lib/http.h @@ -27,9 +27,9 @@ * * ------------------------------------------------------------ * Main author: - * - Daniel Stenberg + * - Daniel Stenberg * - * http://curl.haxx.nu + * http://curl.haxx.se * * $Source$ * $Revision$ -- cgit v1.2.1 From 1156252f925cd67dcb8c13a1f4328cc79bbf97f7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jul 2000 21:16:51 +0000 Subject: Added http_close() --- lib/http.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 372b670c5..0fb98e108 100644 --- a/lib/http.h +++ b/lib/http.h @@ -41,8 +41,11 @@ * ------------------------------------------------------------ ****************************************************************************/ +/* protocol-specific functions set up to be called by the main engine */ + CURLcode http(struct connectdata *conn); CURLcode http_done(struct connectdata *conn); CURLcode http_connect(struct connectdata *conn); +CURLcode http_close(struct connectdata *conn); #endif -- cgit v1.2.1 From 86ff2c46b73a2bbcd25edaf6a3c1d62c8a85f29d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 Sep 2000 14:05:01 +0000 Subject: introduced 'tunnel through http proxy' for ftp --- lib/http.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 0fb98e108..4653f6e14 100644 --- a/lib/http.h +++ b/lib/http.h @@ -41,8 +41,10 @@ * ------------------------------------------------------------ ****************************************************************************/ -/* protocol-specific functions set up to be called by the main engine */ +/* ftp can use this as well */ +CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket); +/* protocol-specific functions set up to be called by the main engine */ CURLcode http(struct connectdata *conn); CURLcode http_done(struct connectdata *conn); CURLcode http_connect(struct connectdata *conn); -- cgit v1.2.1 From 0da7057591609d98f3e0820a13730d97abb2083a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 15 Sep 2000 06:10:52 +0000 Subject: more "anything through http proxy tunnel" fixes --- lib/http.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 4653f6e14..a36366fb2 100644 --- a/lib/http.h +++ b/lib/http.h @@ -42,7 +42,8 @@ ****************************************************************************/ /* ftp can use this as well */ -CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket); +CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket, + char *hostname, int remote_port); /* protocol-specific functions set up to be called by the main engine */ CURLcode http(struct connectdata *conn); -- cgit v1.2.1 From 24dee483e9e925c2ab79dd582f70c9a55ab9ba4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 3 Jan 2001 09:29:33 +0000 Subject: dual-license fix --- lib/http.h | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index a36366fb2..65d9458bf 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,38 +8,21 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * Copyright (C) 2000, Daniel Stenberg, , et al. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. + * In order to be useful for every potential user, curl and libcurl are + * dual-licensed under the MPL and the MIT/X-derivate licenses. * - * The Original Code is Curl. + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the MPL or the MIT/X-derivate + * licenses. You may pick one of these licenses. * - * The Initial Developer of the Original Code is Daniel Stenberg. + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. * - * Portions created by the Initial Developer are Copyright (C) 1998. - * All Rights Reserved. - * - * ------------------------------------------------------------ - * Main author: - * - Daniel Stenberg - * - * http://curl.haxx.se - * - * $Source$ - * $Revision$ - * $Date$ - * $Author$ - * $State$ - * $Locker$ - * - * ------------------------------------------------------------ - ****************************************************************************/ + * $Id$ + *****************************************************************************/ /* ftp can use this as well */ CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket, -- cgit v1.2.1 From 4031104404c6ceed5e57134125dcdb6cac51c564 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Jan 2001 10:11:41 +0000 Subject: Internal symbols that aren't static are now prefixed with 'Curl_' --- lib/http.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 65d9458bf..48adc5231 100644 --- a/lib/http.h +++ b/lib/http.h @@ -25,13 +25,13 @@ *****************************************************************************/ /* ftp can use this as well */ -CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket, - char *hostname, int remote_port); +CURLcode Curl_ConnectHTTPProxyTunnel(struct UrlData *data, int tunnelsocket, + char *hostname, int remote_port); /* protocol-specific functions set up to be called by the main engine */ -CURLcode http(struct connectdata *conn); -CURLcode http_done(struct connectdata *conn); -CURLcode http_connect(struct connectdata *conn); -CURLcode http_close(struct connectdata *conn); +CURLcode Curl_http(struct connectdata *conn); +CURLcode Curl_http_done(struct connectdata *conn); +CURLcode Curl_http_connect(struct connectdata *conn); +CURLcode Curl_http_close(struct connectdata *conn); #endif -- cgit v1.2.1 From 149d6363b3d7c2a08f1c492e73556ea6a98f0521 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 25 Jan 2001 12:24:34 +0000 Subject: modified the Curl_ConnectHTTPProxyTunnel proto --- lib/http.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 48adc5231..bfd73b5f6 100644 --- a/lib/http.h +++ b/lib/http.h @@ -25,7 +25,8 @@ *****************************************************************************/ /* ftp can use this as well */ -CURLcode Curl_ConnectHTTPProxyTunnel(struct UrlData *data, int tunnelsocket, +CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, + int tunnelsocket, char *hostname, int remote_port); /* protocol-specific functions set up to be called by the main engine */ -- cgit v1.2.1 From a23db7b7c7a183cbab8eadc59d73aaa159d301de Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Mar 2001 23:51:41 +0000 Subject: "Transfer-Encoding: chunked" support added --- lib/http.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index bfd73b5f6..52ea73b7b 100644 --- a/lib/http.h +++ b/lib/http.h @@ -35,4 +35,9 @@ CURLcode Curl_http_done(struct connectdata *conn); CURLcode Curl_http_connect(struct connectdata *conn); CURLcode Curl_http_close(struct connectdata *conn); +/* The following functions are defined in http_chunks.c */ +void Curl_httpchunk_init(struct connectdata *conn); +CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, + ssize_t length, ssize_t *wrote); + #endif -- cgit v1.2.1 From a17a78c4773babb5f53d012ac83c9de80385d53a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Sep 2001 15:30:59 +0000 Subject: removed Curl_http_close() --- lib/http.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 52ea73b7b..abd96ba2a 100644 --- a/lib/http.h +++ b/lib/http.h @@ -33,7 +33,6 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, CURLcode Curl_http(struct connectdata *conn); CURLcode Curl_http_done(struct connectdata *conn); CURLcode Curl_http_connect(struct connectdata *conn); -CURLcode Curl_http_close(struct connectdata *conn); /* The following functions are defined in http_chunks.c */ void Curl_httpchunk_init(struct connectdata *conn); -- cgit v1.2.1 From 974f314f5785156af6983675aeb28313cc8ba2ea Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 19 Mar 2002 07:54:55 +0000 Subject: copyright string (year) update --- lib/http.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index abd96ba2a..ef5bedebb 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2000, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * * In order to be useful for every potential user, curl and libcurl are * dual-licensed under the MPL and the MIT/X-derivate licenses. -- cgit v1.2.1 From 08ef208fb78fb2eabc5cec08c23e74e251eac898 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Jun 2002 11:13:01 +0000 Subject: added disable-[protocol] support, largely provided by Miklos Nemeth --- lib/http.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index ef5bedebb..2650106cc 100644 --- a/lib/http.h +++ b/lib/http.h @@ -23,7 +23,7 @@ * * $Id$ *****************************************************************************/ - +#ifndef CURL_DISABLE_HTTP /* ftp can use this as well */ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, int tunnelsocket, @@ -38,5 +38,5 @@ CURLcode Curl_http_connect(struct connectdata *conn); void Curl_httpchunk_init(struct connectdata *conn); CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, ssize_t length, ssize_t *wrote); - +#endif #endif -- cgit v1.2.1 From ba4e69bebc8f7f32f3bc7faa1e13e7580754075b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2002 11:52:59 +0000 Subject: updated source code boilerplate/header --- lib/http.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 2650106cc..d78322ce5 100644 --- a/lib/http.h +++ b/lib/http.h @@ -1,7 +1,7 @@ #ifndef __HTTP_H #define __HTTP_H -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | @@ -10,19 +10,19 @@ * * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. - * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ #ifndef CURL_DISABLE_HTTP /* ftp can use this as well */ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, -- cgit v1.2.1 From 113850a7483068848cbc42ab129d18452af41d24 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 28 Nov 2002 15:48:23 +0000 Subject: added compareheader proto --- lib/http.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index d78322ce5..2f40ea1ff 100644 --- a/lib/http.h +++ b/lib/http.h @@ -24,6 +24,10 @@ * $Id$ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP +bool Curl_compareheader(char *headerline, /* line to check */ + const char *header, /* header keyword _with_ colon */ + const char *content); /* content string to find */ + /* ftp can use this as well */ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, int tunnelsocket, -- cgit v1.2.1 From f26a338a54e04d0a6907f5d2479d8b0fa9daf297 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Jan 2003 21:08:12 +0000 Subject: copyright year update in the source header --- lib/http.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 2f40ea1ff..da8e5db71 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 7a19923afa17dbfa9b45d8620bac003398cf1ebd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 11 Aug 2003 11:47:45 +0000 Subject: Serge Semashko added CURLOPT_PROXYAUTH support, and now NTLM for proxies work. --- lib/http.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index da8e5db71..3cbbf841d 100644 --- a/lib/http.h +++ b/lib/http.h @@ -42,5 +42,6 @@ CURLcode Curl_http_connect(struct connectdata *conn); void Curl_httpchunk_init(struct connectdata *conn); CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, ssize_t length, ssize_t *wrote); +void Curl_http_auth_stage(struct SessionHandle *data, int stage); #endif #endif -- cgit v1.2.1 From 52ceab5e41a01b4d1227876d51a3680a3ce5a841 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 3 Sep 2003 21:51:28 +0000 Subject: Re-arranged code to make the proxy-CONNECT loop able to do some of the authentication negotiations needed for NTLM, Digest etc. --- lib/http.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 3cbbf841d..a3cd7e0ba 100644 --- a/lib/http.h +++ b/lib/http.h @@ -43,5 +43,8 @@ void Curl_httpchunk_init(struct connectdata *conn); CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, ssize_t length, ssize_t *wrote); void Curl_http_auth_stage(struct SessionHandle *data, int stage); +CURLcode Curl_http_auth(struct connectdata *conn, + int httpcode, char *header); +void Curl_http_auth_act(struct connectdata *conn); #endif #endif -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- lib/http.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index a3cd7e0ba..ad7179ff9 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 8e92600ddd6ed324fc1f8410e859cca3182018f7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 30 Mar 2004 06:40:01 +0000 Subject: David Byron made CURLOPT_FAILONERROR work with authentications such as NTLM or Digest. --- lib/http.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index ad7179ff9..5dff8cb71 100644 --- a/lib/http.h +++ b/lib/http.h @@ -42,9 +42,13 @@ CURLcode Curl_http_connect(struct connectdata *conn); void Curl_httpchunk_init(struct connectdata *conn); CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, ssize_t length, ssize_t *wrote); + +/* These functions are in http.c */ void Curl_http_auth_stage(struct SessionHandle *data, int stage); CURLcode Curl_http_auth(struct connectdata *conn, int httpcode, char *header); void Curl_http_auth_act(struct connectdata *conn); + +int Curl_http_should_fail(struct connectdata *conn); #endif #endif -- cgit v1.2.1 From fc6eff13b5414caf6edf22d73a3239e074a04216 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 May 2004 07:52:53 +0000 Subject: General HTTP authentication cleanup and fixes --- lib/http.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 5dff8cb71..944314a55 100644 --- a/lib/http.h +++ b/lib/http.h @@ -45,9 +45,9 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, /* These functions are in http.c */ void Curl_http_auth_stage(struct SessionHandle *data, int stage); -CURLcode Curl_http_auth(struct connectdata *conn, - int httpcode, char *header); -void Curl_http_auth_act(struct connectdata *conn); +CURLcode Curl_http_input_auth(struct connectdata *conn, + int httpcode, char *header); +CURLcode Curl_http_auth_act(struct connectdata *conn); int Curl_http_should_fail(struct connectdata *conn); #endif -- cgit v1.2.1 From d60c22572b49cde9b839a59510580df079d2d5e2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 12 May 2004 12:06:39 +0000 Subject: Curl_done() and the protocol-specific conn->curl_done() functions now all take a CURLcode as a second argument, that is non-zero when Curl_done() is called after an error was returned from Curl_do() (or similar). --- lib/http.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 944314a55..2d3b39dca 100644 --- a/lib/http.h +++ b/lib/http.h @@ -35,7 +35,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn); -CURLcode Curl_http_done(struct connectdata *conn); +CURLcode Curl_http_done(struct connectdata *, CURLcode); CURLcode Curl_http_connect(struct connectdata *conn); /* The following functions are defined in http_chunks.c */ -- cgit v1.2.1 From 80a1e972fcca1565f6f91f6c4baff52db3b45c79 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Jun 2004 08:45:22 +0000 Subject: Fix the auth code to enable us to i.e set DIGEST and then find out that the server doesn't require any auth at all and then we just continue nicely. We now have an extra bit in the connection struct named 'authprobe' that is TRUE when doing pure "HTTP authentication probing". --- lib/http.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 2d3b39dca..80c180798 100644 --- a/lib/http.h +++ b/lib/http.h @@ -2,10 +2,10 @@ #define __HTTP_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. @@ -13,7 +13,7 @@ * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. @@ -50,5 +50,12 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, CURLcode Curl_http_auth_act(struct connectdata *conn); int Curl_http_should_fail(struct connectdata *conn); + +/* If only the PICKNONE bit is set, there has been a round-trip and we + selected to use no auth at all. Ie, we actively select no auth, as opposed + to not having one selected. The other CURLAUTH_* defines are present in the + public curl/curl.h header. */ +#define CURLAUTH_PICKNONE (1<<30) /* don't use auth */ + #endif #endif -- cgit v1.2.1 From 6b49fd74838d674011e18fcddcf497ba073052a2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Nov 2004 14:43:35 +0000 Subject: Tim Sneddon's VMS fix for huge HTTP POSTs --- lib/http.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 80c180798..d321333fe 100644 --- a/lib/http.h +++ b/lib/http.h @@ -57,5 +57,14 @@ int Curl_http_should_fail(struct connectdata *conn); public curl/curl.h header. */ #define CURLAUTH_PICKNONE (1<<30) /* don't use auth */ +/* MAX_INITIAL_POST_SIZE indicates the number of kilobytes that will be sent + in the initial part of a multi-part POST message. This is primarily for + OpenVMS where the maximum number of bytes allowed per I/O is 64K. For + other systems that do not define this, the default is (as it was + previously) 100K. */ +#ifndef MAX_INITIAL_POST_SIZE +#define MAX_INITIAL_POST_SIZE (100*1024) +#endif + #endif #endif -- cgit v1.2.1 From 3e1caa61859a6057a65eb7c1585d47e05026c4f2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Nov 2004 16:11:35 +0000 Subject: HTTP "auth done right". See lib/README.httpauth --- lib/http.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index d321333fe..57f1d115e 100644 --- a/lib/http.h +++ b/lib/http.h @@ -57,13 +57,20 @@ int Curl_http_should_fail(struct connectdata *conn); public curl/curl.h header. */ #define CURLAUTH_PICKNONE (1<<30) /* don't use auth */ -/* MAX_INITIAL_POST_SIZE indicates the number of kilobytes that will be sent - in the initial part of a multi-part POST message. This is primarily for - OpenVMS where the maximum number of bytes allowed per I/O is 64K. For - other systems that do not define this, the default is (as it was - previously) 100K. */ +/* MAX_INITIAL_POST_SIZE indicates the number of bytes that will make the POST + data get included in the initial data chunk sent to the server. If the + data is larger than this, it will automatically get split up in multiple + system calls. + + This value used to be fairly big (100K), but we must take into account that + if the server rejects the POST due for authentication reasons, this data + will always be uncondtionally sent and thus it may not be larger than can + always be afforded to send twice. + + It must not be greater than 64K to work on VMS. +*/ #ifndef MAX_INITIAL_POST_SIZE -#define MAX_INITIAL_POST_SIZE (100*1024) +#define MAX_INITIAL_POST_SIZE 1024 #endif #endif -- cgit v1.2.1 From 6a2e21ec8cbaf7c719902e06953d9dbec629ad4f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 9 Feb 2005 13:06:40 +0000 Subject: FTP code turned into state machine. Not completely yet, but a good start. The tag 'before_ftp_statemachine' was set just before this commit in case of future need. --- lib/http.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 57f1d115e..23afc9115 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -34,9 +34,9 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, char *hostname, int remote_port); /* protocol-specific functions set up to be called by the main engine */ -CURLcode Curl_http(struct connectdata *conn); +CURLcode Curl_http(struct connectdata *conn, bool *done); CURLcode Curl_http_done(struct connectdata *, CURLcode); -CURLcode Curl_http_connect(struct connectdata *conn); +CURLcode Curl_http_connect(struct connectdata *conn, bool *done); /* The following functions are defined in http_chunks.c */ void Curl_httpchunk_init(struct connectdata *conn); -- cgit v1.2.1 From 20005a83d2ce3db5a7e6ea95ffdd8a047fd5e427 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 3 Jul 2005 22:25:15 +0000 Subject: Andrew Bushnell provided enough info for me to tell that we badly needed to fix the CONNECT authentication code with multi-pass auth methods (such as NTLM) as it didn't previously properly ignore response-bodies - in fact it stopped reading after all response headers had been received. This could lead to libcurl sending the next request and reading the body from the first request as response to the second request. (I also renamed the function, which wasn't strictly necessary but...) The best fix would to once and for all make the CONNECT code use the ordinary request sending/receiving code, treating it as any ordinary request instead of the special-purpose function we have now. It should make it better for multi-interface too. And possibly lead to less code... Added test case 265 for this. It doesn't work as a _really_ good test case since the test proxy is too stupid, but the test case helps when running the debugger to verify. --- lib/http.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 23afc9115..599d067c0 100644 --- a/lib/http.h +++ b/lib/http.h @@ -29,9 +29,9 @@ bool Curl_compareheader(char *headerline, /* line to check */ const char *content); /* content string to find */ /* ftp can use this as well */ -CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, - int tunnelsocket, - char *hostname, int remote_port); +CURLcode Curl_proxyCONNECT(struct connectdata *conn, + int tunnelsocket, + char *hostname, int remote_port); /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn, bool *done); -- cgit v1.2.1 From 83367f67de9584b91570bcb53a153b8aa496d455 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Mar 2006 21:54:44 +0000 Subject: Xavier Bouchoux made the SSL connection non-blocking for the multi interface (when using OpenSSL). --- lib/http.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 599d067c0..bc459f5d3 100644 --- a/lib/http.h +++ b/lib/http.h @@ -37,6 +37,11 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn, CURLcode Curl_http(struct connectdata *conn, bool *done); CURLcode Curl_http_done(struct connectdata *, CURLcode); CURLcode Curl_http_connect(struct connectdata *conn, bool *done); +CURLcode Curl_https_connecting(struct connectdata *conn, bool *done); +CURLcode Curl_https_proto_fdset(struct connectdata *conn, + fd_set *read_fd_set, + fd_set *write_fd_set, + int *max_fdp); /* The following functions are defined in http_chunks.c */ void Curl_httpchunk_init(struct connectdata *conn); -- cgit v1.2.1 From 686d90745be4417127050ad4b36d0a5403def200 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Apr 2006 15:00:53 +0000 Subject: First curl_multi_socket() commit. Should primarily be considered as an internal code rearrange to fit the future better. --- lib/http.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index bc459f5d3..e84e28b07 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -38,10 +38,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done); CURLcode Curl_http_done(struct connectdata *, CURLcode); CURLcode Curl_http_connect(struct connectdata *conn, bool *done); CURLcode Curl_https_connecting(struct connectdata *conn, bool *done); -CURLcode Curl_https_proto_fdset(struct connectdata *conn, - fd_set *read_fd_set, - fd_set *write_fd_set, - int *max_fdp); +int Curl_https_getsock(struct connectdata *conn, + curl_socket_t *socks, + int numsocks); /* The following functions are defined in http_chunks.c */ void Curl_httpchunk_init(struct connectdata *conn); -- cgit v1.2.1 From 490cccba3cfd5ba54ecb64a10fb63c2f0e94a67d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 18 Aug 2006 22:54:57 +0000 Subject: Andrew Biggs pointed out a "Expect: 100-continue" flaw where libcurl didn't send the whole request at once, even though the Expect: header was disabled by the application. An effect of this change is also that small (< 1024 bytes) POSTs are now always sent without Expect: header since we deem it more costly to bother about that than the risk that we send the data in vain. --- lib/http.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index e84e28b07..1c8ee7e39 100644 --- a/lib/http.h +++ b/lib/http.h @@ -74,7 +74,11 @@ int Curl_http_should_fail(struct connectdata *conn); It must not be greater than 64K to work on VMS. */ #ifndef MAX_INITIAL_POST_SIZE -#define MAX_INITIAL_POST_SIZE 1024 +#define MAX_INITIAL_POST_SIZE (64*1024) +#endif + +#ifndef TINY_INITIAL_POST_SIZE +#define TINY_INITIAL_POST_SIZE 1024 #endif #endif -- cgit v1.2.1 From 385e612fa5b7663fc2bc815677b8c27bec2f0fe4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 16 Jan 2007 22:22:10 +0000 Subject: - Armel Asselin improved libcurl to behave a lot better when an easy handle doing an FTP transfer is removed from a multi handle before completion. The fix also fixed the "alive counter" to be correct on "premature removal" for all protocols. --- lib/http.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 1c8ee7e39..7b4b6339a 100644 --- a/lib/http.h +++ b/lib/http.h @@ -35,7 +35,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn, /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn, bool *done); -CURLcode Curl_http_done(struct connectdata *, CURLcode); +CURLcode Curl_http_done(struct connectdata *, CURLcode, bool premature); CURLcode Curl_http_connect(struct connectdata *conn, bool *done); CURLcode Curl_https_connecting(struct connectdata *conn, bool *done); int Curl_https_getsock(struct connectdata *conn, -- cgit v1.2.1 From b6f889085ddaecd2f13ce287615a9e1527a21d59 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 27 Jan 2007 03:43:05 +0000 Subject: update copyright year notice --- lib/http.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 7b4b6339a..0f4b58f72 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 523767660c05cf359091694fcaccb763ebb7b2d7 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sun, 26 Aug 2007 05:53:26 +0000 Subject: Fixed some minor mismatched types found by splint. --- lib/http.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 0f4b58f72..cd75f0802 100644 --- a/lib/http.h +++ b/lib/http.h @@ -24,14 +24,14 @@ * $Id$ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP -bool Curl_compareheader(char *headerline, /* line to check */ +bool Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content); /* content string to find */ /* ftp can use this as well */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int tunnelsocket, - char *hostname, int remote_port); + char *hostname, unsigned short remote_port); /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn, bool *done); -- cgit v1.2.1 From 8cf0814a143d99de813fbd1653b785252b4c58a6 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 27 Aug 2007 06:31:28 +0000 Subject: Fixed some minor type mismatches and missing consts mainly found by splint. --- lib/http.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index cd75f0802..0b8f8b63e 100644 --- a/lib/http.h +++ b/lib/http.h @@ -31,7 +31,7 @@ bool Curl_compareheader(const char *headerline, /* line to check */ /* ftp can use this as well */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int tunnelsocket, - char *hostname, unsigned short remote_port); + const char *hostname, unsigned short remote_port); /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn, bool *done); @@ -50,7 +50,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap, /* These functions are in http.c */ void Curl_http_auth_stage(struct SessionHandle *data, int stage); CURLcode Curl_http_input_auth(struct connectdata *conn, - int httpcode, char *header); + int httpcode, const char *header); CURLcode Curl_http_auth_act(struct connectdata *conn); int Curl_http_should_fail(struct connectdata *conn); -- cgit v1.2.1 From 07b6e7363d910ad4828376d568a2f19fd8d64661 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Fri, 12 Oct 2007 13:36:37 +0000 Subject: Added per-protocol callback static tables, replacing callback ptr storage in the connectdata structure by a single handler table ptr. --- lib/http.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 0b8f8b63e..f41ebb6e8 100644 --- a/lib/http.h +++ b/lib/http.h @@ -24,6 +24,13 @@ * $Id$ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP + +extern const struct Curl_handler Curl_handler_http; + +#ifdef USE_SSL +extern const struct Curl_handler Curl_handler_https; +#endif + bool Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content); /* content string to find */ @@ -37,10 +44,6 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn, CURLcode Curl_http(struct connectdata *conn, bool *done); CURLcode Curl_http_done(struct connectdata *, CURLcode, bool premature); CURLcode Curl_http_connect(struct connectdata *conn, bool *done); -CURLcode Curl_https_connecting(struct connectdata *conn, bool *done); -int Curl_https_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks); /* The following functions are defined in http_chunks.c */ void Curl_httpchunk_init(struct connectdata *conn); -- cgit v1.2.1 From cc0285da7f99fd4cb87db7059552db929b6f24f2 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 30 Jul 2008 20:11:51 +0000 Subject: Factored out Curl_copy_header_value --- lib/http.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index f41ebb6e8..5a04f8c43 100644 --- a/lib/http.h +++ b/lib/http.h @@ -35,6 +35,8 @@ bool Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content); /* content string to find */ +char *Curl_copy_header_value(const char *h); + /* ftp can use this as well */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int tunnelsocket, -- cgit v1.2.1 From 3a499099af52ddc69a3647767521c99c9e9c42e4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 4 Aug 2008 22:00:22 +0000 Subject: - Test cases 1051, 1052 and 1055 were added by Daniel Fandrich on July 30 and proved how PUT and POST with a redirect could lead to a "hang" due to the data stream not being rewound properly when it had to in order to get sent properly (again) to the subsequent URL. This is now fixed and these test cases are no longer disabled. --- lib/http.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 5a04f8c43..1c53120dd 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -57,6 +57,7 @@ void Curl_http_auth_stage(struct SessionHandle *data, int stage); CURLcode Curl_http_input_auth(struct connectdata *conn, int httpcode, const char *header); CURLcode Curl_http_auth_act(struct connectdata *conn); +CURLcode Curl_http_perhapsrewind(struct connectdata *conn); int Curl_http_should_fail(struct connectdata *conn); -- cgit v1.2.1 From 83a6b348037048c389fbe859d7e3ea3e290a7644 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 12 Dec 2009 22:17:51 +0000 Subject: split out more protocol-specific structs from urldata.h into their own protocol-specific header files --- lib/http.h | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 1c53120dd..8908130f9 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -87,5 +87,40 @@ int Curl_http_should_fail(struct connectdata *conn); #define TINY_INITIAL_POST_SIZE 1024 #endif -#endif +#endif /* CURL_DISABLE_HTTP */ + +/**************************************************************************** + * HTTP unique setup + ***************************************************************************/ +struct HTTP { + struct FormData *sendit; + curl_off_t postsize; /* off_t to handle large file sizes */ + const char *postdata; + + const char *p_pragma; /* Pragma: string */ + const char *p_accept; /* Accept: string */ + curl_off_t readbytecount; + curl_off_t writebytecount; + + /* For FORM posting */ + struct Form form; + + struct back { + curl_read_callback fread_func; /* backup storage for fread pointer */ + void *fread_in; /* backup storage for fread_in pointer */ + const char *postdata; + curl_off_t postsize; + } backup; + + enum { + HTTPSEND_NADA, /* init */ + HTTPSEND_REQUEST, /* sending a request */ + HTTPSEND_BODY, /* sending body */ + HTTPSEND_LAST /* never use this */ + } sending; + + void *send_buffer; /* used if the request couldn't be sent in one chunk, + points to an allocated send_buffer struct */ +}; + #endif -- cgit v1.2.1 From 1e9a946e6d2714a5e3f143f500fca45a2011e5f1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 29 Dec 2009 21:45:02 +0000 Subject: move HTTP-specific functions to http.c where they belong --- lib/http.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 8908130f9..263b8989c 100644 --- a/lib/http.h +++ b/lib/http.h @@ -25,6 +25,8 @@ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP +struct SingleRequest; + extern const struct Curl_handler Curl_handler_http; #ifdef USE_SSL @@ -123,4 +125,14 @@ struct HTTP { points to an allocated send_buffer struct */ }; +CURLcode Curl_http_header_append(struct SessionHandle *data, + struct SingleRequest *k, + size_t length); + +CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, + struct connectdata *conn, + struct SingleRequest *k, + ssize_t *nread, + bool *stop_reading); + #endif -- cgit v1.2.1 From d37a9c4f8737c926dbe0a7256530c687092cfcb9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 7 Jan 2010 14:02:05 +0000 Subject: removed Curl_http_header_append() prototype as it isn't used anymore, the function was moved to http.c and was made static and renamed --- lib/http.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 263b8989c..f6781cc99 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -125,10 +125,6 @@ struct HTTP { points to an allocated send_buffer struct */ }; -CURLcode Curl_http_header_append(struct SessionHandle *data, - struct SingleRequest *k, - size_t length); - CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, struct connectdata *conn, struct SingleRequest *k, -- cgit v1.2.1 From 8524c04ca98d9c0b5f90d685135e0466e0d8b386 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 7 Jan 2010 22:48:28 +0000 Subject: removed a parameter from the Curl_http_readwrite_headers() prototype to remove the need for the struct forward declaration from http.h which caused problems with gcc 2.96 and quite frankly the parameter wasn't necessary anyway --- lib/http.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index f6781cc99..155027d99 100644 --- a/lib/http.h +++ b/lib/http.h @@ -25,8 +25,6 @@ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP -struct SingleRequest; - extern const struct Curl_handler Curl_handler_http; #ifdef USE_SSL @@ -127,7 +125,6 @@ struct HTTP { CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, struct connectdata *conn, - struct SingleRequest *k, ssize_t *nread, bool *stop_reading); -- cgit v1.2.1 From bc4582b68a673d3b0f5a2e7d971605de2c8b3730 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 21 Jan 2010 13:58:30 +0000 Subject: Chris Conroy brought support for RTSP transfers, and with it comes 8(!) new libcurl options for controlling what to get and how to receive posssibly interleaved RTP data. Initial commit. --- lib/http.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 155027d99..b2cbdae35 100644 --- a/lib/http.h +++ b/lib/http.h @@ -35,8 +35,40 @@ bool Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content); /* content string to find */ +char *Curl_checkheaders(struct SessionHandle *data, const char *thisheader); + char *Curl_copy_header_value(const char *h); + +/* ------------------------------------------------------------------------- */ +/* + * The add_buffer series of functions are used to build one large memory chunk + * from repeated function invokes. Used so that the entire HTTP request can + * be sent in one go. + */ +struct Curl_send_buffer { + char *buffer; + size_t size_max; + size_t size_used; +}; +typedef struct Curl_send_buffer Curl_send_buffer; + +Curl_send_buffer *Curl_add_buffer_init(void); +CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...); +CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size); +CURLcode Curl_add_buffer_send(Curl_send_buffer *in, + struct connectdata *conn, + long *bytes_written, + size_t included_body_bytes, + int socketindex); + + +CURLcode Curl_add_timecondition(struct SessionHandle *data, + Curl_send_buffer *buf); +CURLcode Curl_add_custom_headers(struct connectdata *conn, + Curl_send_buffer *req_buffer); + + /* ftp can use this as well */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int tunnelsocket, -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/http.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index b2cbdae35..b7c1abf66 100644 --- a/lib/http.h +++ b/lib/http.h @@ -21,7 +21,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP -- cgit v1.2.1 From 6d2ccfed48558f171c2840c3aa479261050d084a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 24 Jul 2010 22:52:35 +0200 Subject: add_buffer_send: fix compiler warning Win64's 32 bit long but 64 bit size_t caused a warning that we avoid with a typecast. A small whitespace indent fix was also applied. Reported by: Adam Light --- lib/http.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index b7c1abf66..3007c319f 100644 --- a/lib/http.h +++ b/lib/http.h @@ -56,11 +56,10 @@ Curl_send_buffer *Curl_add_buffer_init(void); CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...); CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size); CURLcode Curl_add_buffer_send(Curl_send_buffer *in, - struct connectdata *conn, - long *bytes_written, - size_t included_body_bytes, - int socketindex); - + struct connectdata *conn, + long *bytes_written, + size_t included_body_bytes, + int socketindex); CURLcode Curl_add_timecondition(struct SessionHandle *data, Curl_send_buffer *buf); -- cgit v1.2.1 From 02dbfa21921aded6bba292b99dd224fe450e7254 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 4 Apr 2011 16:24:37 +0200 Subject: http-proxy: move proxy code to http_proxy.c The new http_proxy.* files now host HTTP proxy specific code (500+ lines moved out from http.c), and as a consequence there is a macro introduced for the Curl_proxyCONNECT() function so that code can use it without actually supporting proxy (or HTTP) in builds. --- lib/http.h | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 3007c319f..fab2bfd25 100644 --- a/lib/http.h +++ b/lib/http.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -66,12 +66,6 @@ CURLcode Curl_add_timecondition(struct SessionHandle *data, CURLcode Curl_add_custom_headers(struct connectdata *conn, Curl_send_buffer *req_buffer); - -/* ftp can use this as well */ -CURLcode Curl_proxyCONNECT(struct connectdata *conn, - int tunnelsocket, - const char *hostname, unsigned short remote_port); - /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn, bool *done); CURLcode Curl_http_done(struct connectdata *, CURLcode, bool premature); @@ -158,4 +152,25 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data, ssize_t *nread, bool *stop_reading); +/** + * Curl_http_output_auth() setups the authentication headers for the + * host/proxy and the correct authentication + * method. conn->data->state.authdone is set to TRUE when authentication is + * done. + * + * @param conn all information about the current connection + * @param request pointer to the request keyword + * @param path pointer to the requested path + * @param proxytunnel boolean if this is the request setting up a "proxy + * tunnel" + * + * @returns CURLcode + */ +CURLcode +Curl_http_output_auth(struct connectdata *conn, + const char *request, + const char *path, + bool proxytunnel); /* TRUE if this is the request setting + up the proxy tunnel */ + #endif -- cgit v1.2.1 From 5d4e5593d5178a716b21c74648077171c7192905 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 3 Jun 2011 19:51:08 +0200 Subject: privatise: make private functions static --- lib/http.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index fab2bfd25..cfe8b8455 100644 --- a/lib/http.h +++ b/lib/http.h @@ -36,9 +36,6 @@ bool Curl_compareheader(const char *headerline, /* line to check */ char *Curl_checkheaders(struct SessionHandle *data, const char *thisheader); -char *Curl_copy_header_value(const char *h); - - /* ------------------------------------------------------------------------- */ /* * The add_buffer series of functions are used to build one large memory chunk @@ -83,8 +80,6 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, CURLcode Curl_http_auth_act(struct connectdata *conn); CURLcode Curl_http_perhapsrewind(struct connectdata *conn); -int Curl_http_should_fail(struct connectdata *conn); - /* If only the PICKNONE bit is set, there has been a round-trip and we selected to use no auth at all. Ie, we actively select no auth, as opposed to not having one selected. The other CURLAUTH_* defines are present in the -- cgit v1.2.1