2012-12-28 19:03:09 +08:00
|
|
|
#ifndef HEADER_CURL_EASYIF_H
|
|
|
|
#define HEADER_CURL_EASYIF_H
|
2005-01-10 18:07:07 +08:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2023-01-02 20:51:48 +08:00
|
|
|
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2005-01-10 18:07:07 +08:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2005-01-10 18:07:07 +08:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
*
|
2005-01-10 18:07:07 +08:00
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2013-01-04 09:50:28 +08:00
|
|
|
* Prototypes for library-wide functions provided by easy.c
|
2005-01-10 18:07:07 +08:00
|
|
|
*/
|
2022-09-09 21:11:14 +08:00
|
|
|
CURLcode Curl_senddata(struct Curl_easy *data, const void *buffer,
|
lib: Curl_read/Curl_write clarifications
- replace `Curl_read()`, `Curl_write()` and `Curl_nwrite()` to
clarify when and at what level they operate
- send/recv of transfer related data is now done via
`Curl_xfer_send()/Curl_xfer_recv()` which no longer has
socket/socketindex as parameter. It decides on the transfer
setup of `conn->sockfd` and `conn->writesockfd` on which
connection filter chain to operate.
- send/recv on a specific connection filter chain is done via
`Curl_conn_send()/Curl_conn_recv()` which get the socket index
as parameter.
- rename `Curl_setup_transfer()` to `Curl_xfer_setup()` for
naming consistency
- clarify that the special CURLE_AGAIN hangling to return
`CURLE_OK` with length 0 only applies to `Curl_xfer_send()`
and CURLE_AGAIN is returned by all other send() variants.
- fix a bug in websocket `curl_ws_recv()` that mixed up data
when it arrived in more than a single chunk
The method for sending not just raw bytes, but bytes that are either
"headers" or "body". The send abstraction stack, to to bottom, now is:
* `Curl_req_send()`: has parameter to indicate amount of header bytes,
buffers all data.
* `Curl_xfer_send()`: knows on which socket index to send, returns
amount of bytes sent.
* `Curl_conn_send()`: called with socket index, returns amount of bytes
sent.
In addition there is `Curl_req_flush()` for writing out all buffered
bytes.
`Curl_req_send()` is active for requests without body,
`Curl_buffer_send()` still being used for others. This is because the
special quirks need to be addressed in future parts:
* `expect-100` handling
* `Curl_fillreadbuffer()` needs to add directly to the new
`data->req.sendbuf`
* special body handlings, like `chunked` encodings and line end
conversions will be moved into something like a Client Reader.
In functions of the pattern `CURLcode xxx_send(..., ssize_t *written)`,
replace the `ssize_t` with a `size_t`. It makes no sense to allow for negative
values as the returned `CURLcode` already specifies error conditions. This
allows easier handling of lengths without casting.
Closes #12964
2024-02-15 23:22:53 +08:00
|
|
|
size_t buflen, size_t *n);
|
2022-09-09 21:11:14 +08:00
|
|
|
|
2024-09-27 19:19:55 +08:00
|
|
|
#ifndef CURL_DISABLE_WEBSOCKETS
|
2023-04-18 21:02:34 +08:00
|
|
|
CURLcode Curl_connect_only_attach(struct Curl_easy *data);
|
|
|
|
#endif
|
|
|
|
|
2024-05-20 20:21:05 +08:00
|
|
|
#ifdef DEBUGBUILD
|
2016-06-22 01:31:24 +08:00
|
|
|
CURL_EXTERN CURLcode curl_easy_perform_ev(struct Curl_easy *easy);
|
2013-08-11 04:55:59 +08:00
|
|
|
#endif
|
2006-09-08 05:49:20 +08:00
|
|
|
|
2012-12-28 19:03:09 +08:00
|
|
|
#endif /* HEADER_CURL_EASYIF_H */
|