summaryrefslogtreecommitdiff
path: root/lib/rtsp.c
Commit message (Collapse)AuthorAgeFilesLines
* infof: remove newline from format strings, always append itDaniel Stenberg2021-07-071-3/+3
| | | | | | | | | | | | | | | | - the data needs to be "line-based" anyway since it's also passed to the debug callback/application - it makes infof() work like failf() and consistency is good - there's an assert that triggers on newlines in the format string - Also removes a few instances of "..." - Removes the code that would append "..." to the end of the data *iff* it was truncated in infof() Closes #7357
* conn: add 'attach' to protocol handler, make libssh2 use itDaniel Stenberg2021-05-171-0/+1
| | | | | | | | | | | The libssh2 backend has SSH session associated with the connection but the callback context is the easy handle, so when a connection gets attached to a transfer, the protocol handler now allows for a custom function to get used to set things up correctly. Reported-by: Michael O'Farrell Fixes #6898 Closes #7078
* tidy-up: make conditional checks more consistentDaniel Stenberg2021-04-221-2/+2
| | | | | | ... remove '== NULL' and '!= 0' Closes #6912
* urldata: merge "struct DynamicStatic" into "struct UrlState"Daniel Stenberg2021-03-261-2/+2
| | | | | | | | Both were used for the same purposes and there was no logical separation between them. Combined, this also saves 16 bytes in less holes in my test build. Closes #6798
* lib: remove conn->data usesPatrick Monnerat2021-01-241-7/+4
| | | | Closes #6499
* lib: more conn->data cleanupsDaniel Stenberg2021-01-191-1/+1
| | | | Closes #6479
* lib: pass in 'struct Curl_easy *' to most functionsDaniel Stenberg2021-01-171-39/+48
| | | | | | | | | | | | | | | | | | | | | ... in most cases instead of 'struct connectdata *' but in some cases in addition to. - We mostly operate on transfers and not connections. - We need the transfer handle to log, store data and more. Everything in libcurl is driven by a transfer (the CURL * in the public API). - This work clarifies and separates the transfers from the connections better. - We should avoid "conn->data". Since individual connections can be used by many transfers when multiplexing, making sure that conn->data points to the current and correct transfer at all times is difficult and has been notoriously error-prone over the years. The goal is to ultimately remove the conn->data pointer for this reason. Closes #6425
* http: make 'authneg' also work for HyperDaniel Stenberg2021-01-101-2/+3
| | | | | | | When doing a request with a request body expecting a 401/407 back, that initial request is sent with a zero content-length. Test 177 and more. Closes #6424
* rtsp: disable if Hyper is usedDaniel Stenberg2020-12-181-2/+2
|
* urldata: remove 'void *protop' and create the union 'p'Daniel Stenberg2020-11-231-4/+4
| | | | | | | ... to avoid the use of 'void *' for the protocol specific structs done per transfer. Closes #6238
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* rtsp: error out on empty Session ID, unified the codeHarry Sintonen2020-11-041-18/+18
|
* rtsp: fixed Session ID comparison to refuse prefixHarry Sintonen2020-11-041-2/+11
| | | | Closes #6161
* Curl_handler: add 'family' to each protocolDaniel Stenberg2020-09-211-0/+1
| | | | | | | Makes get_protocol_family() faster and it moves the knowledge about the "families" to each protocol handler, where it belongs. Closes #5986
* http: move header storage to Curl_easy from connectdataDaniel Stenberg2020-06-151-23/+23
| | | | | | | | | | | | Since the connection can be used by many independent requests (using HTTP/2 or HTTP/3), things like user-agent and other transfer-specific data MUST NOT be kept connection oriented as it could lead to requests getting the wrong string for their requests. This struct data was lingering like this due to old HTTP1 legacy thinking where it didn't mattered.. Fixes #5566 Closes #5567
* urldata: let the HTTP method be in the set.* structDaniel Stenberg2020-06-021-3/+3
| | | | | | | | | | | | When the method is updated inside libcurl we must still not change the method as set by the user as then repeated transfers with that same handle might not execute the same operation anymore! This fixes the libcurl part of #5462 Test 1633 added to verify. Closes #5499
* dynbuf: introduce internal generic dynamic buffer functionsDaniel Stenberg2020-05-041-43/+40
| | | | | | | | | | | | | A common set of functions instead of many separate implementations for creating buffers that can grow when appending data to them. Existing functionality has been ported over. In my early basic testing, the total number of allocations seem at roughly the same amount as before, possibly a few less. See docs/DYNBUF.md for a description of the API. Closes #5300
* cleanup: remove the 'numsocks' argument used in many placesDaniel Stenberg2019-07-301-7/+2
| | | | | | | | | It was used (intended) to pass in the size of the 'socks' array that is also passed to these functions, but was rarely actually checked/used and the array is defined to a fixed size of MAX_SOCKSPEREASYHANDLE entries that should be used instead. Closes #4169
* http: allow overriding timecond with custom headerPeter Simonyi2019-07-141-1/+1
| | | | | | | | | With CURLOPT_TIMECONDITION set, a header is automatically added (e.g. If-Modified-Since). Allow this to be replaced or suppressed with CURLOPT_HTTPHEADER. Fixes #4103 Closes #4109
* cleanup: remove FIXME and TODO commentsDaniel Stenberg2019-05-161-12/+0
| | | | | | | | | They serve very little purpose and mostly just add noise. Most of them have been around for a very long time. I read them all before removing or rephrasing them. Ref: #3876 Closes #3883
* pipelining: removedDaniel Stenberg2019-04-061-1/+0
| | | | | | | As previously planned and documented in DEPRECATE.md, all pipelining code is removed. Closes #3651
* urldata: simplify bytecountersDaniel Stenberg2019-03-011-12/+4
| | | | | | | | | | | | | - no need to have them protocol specific - no need to set pointers to them with the Curl_setup_transfer() call - make Curl_setup_transfer() operate on a transfer pointer, not connection - switch some counters from long to the more proper curl_off_t type Closes #3627
* cleanup: make local functions staticDaniel Stenberg2019-02-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | urlapi: turn three local-only functions into statics conncache: make conncache_find_first_connection static multi: make detach_connnection static connect: make getaddressinfo static curl_ntlm_core: make hmac_md5 static http2: make two functions static http: make http_setup_conn static connect: make tcpnodelay static tests: make UNITTEST a thing to mark functions with, so they can be static for normal builds and non-static for unit test builds ... and mark Curl_shuffle_addr accordingly. url: make up_free static setopt: make vsetopt static curl_endian: make write32_le static rtsp: make rtsp_connisdead static warnless: remove unused functions memdebug: remove one unused function, made another static
* http: made Curl_add_buffer functions take a pointer-pointerDaniel Stenberg2018-09-161-13/+14
| | | | | | | ... so that they can clear the original pointer on failure, which makes the error-paths and their cleanups easier. Closes #2992
* cppcheck: fix warningsMarian Klymov2018-06-111-4/+2
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* checksrc: force indentation of lines after an elseDaniel Gustafsson2018-04-271-2/+1
| | | | | | | | This extends the INDENTATION case to also handle 'else' statements and require proper indentation on the following line. Also fixes the offending cases found in the codebase. Closes #2532
* HTTP: allow "header;" to replace an internal header with a blank oneDaniel Stenberg2018-03-111-13/+13
| | | | | | Reported-by: Michael Kaufmann Fixes #2357 Closes #2362
* spelling fixesViktor Szakats2018-02-231-1/+1
| | | | | | | | Detected using the `codespell` tool. Also contains one URL protocol upgrade. Closes https://github.com/curl/curl/pull/2334
* TODO fixed: Detect when called from within callbacksBjörn Stenberg2018-02-151-0/+2
| | | | Closes #2302
* rtsp: Segfault in rtsp.c when using WRITEDATAMax Dymond2017-09-151-9/+14
| | | | | | | | | If the INTERLEAVEFUNCTION is defined, then use that plus the INTERLEAVEDATA information when writing RTP. Otherwise, use WRITEFUNCTION and WRITEDATA. Fixes #1880 Closes #1884
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-1/+1
|
* rtsp: do not call fwrite() with NULL pointer FILE *Daniel Stenberg2017-09-081-0/+9
| | | | | | | | | | | If the default write callback is used and no destination has been set, a NULL pointer would be passed to fwrite()'s 4th argument. OSS-fuzz bug https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3327 (not publicly open yet) Detected by OSS-fuzz Closes #1874
* handler: refactor connection checkingMax Dymond2017-06-301-1/+22
| | | | | | Add a new type of callback to Curl_handler which performs checks on the connection. Alter RTSP so that it uses this callback to do its own check on connection health.
* spelling fixesklemens2017-03-261-2/+2
| | | | Closes #1356
* Improve code readbilitySylvestre Ledru2017-03-131-35/+31
| | | | | | ... by removing the else branch after a return, break or continue. Closes #1310
* Curl_getconnectinfo: avoid checking if the connection is closedIsaac Boukris2016-12-181-7/+4
| | | | | | | | | | It doesn't benefit us much as the connection could get closed at any time, and also by checking we lose the ability to determine if the socket was closed by reading zero bytes. Reported-by: Michael Kaufmann Closes https://github.com/curl/curl/pull/1134
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-4/+4
| | | | In order to make the code style more uniform everywhere
* realloc: use Curl_saferealloc to avoid common mistakesDaniel Stenberg2016-11-111-2/+3
| | | | Discussed: https://curl.haxx.se/mail/lib-2016-11/0087.html
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-1/+1
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* select: switch to macros in uppercaseDaniel Stenberg2016-10-181-1/+1
| | | | | | | | | | Curl_select_ready() was the former API that was replaced with Curl_select_check() a while back and the former arg setup was provided with a define (in order to leave existing code unmodified). Now we instead offer SOCKET_READABLE and SOCKET_WRITABLE for the most common shortcuts where only one socket is checked. They're also more visibly macros.
* rtsp: ignore whitespace in session idDaniel Stenberg2016-08-111-4/+4
| | | | | | | Follow-up to e577c43bb to fix test case 569 brekage: stop the parser at whitespace as well. Help-by: Erik Janssen
* rtsp: accept any RTSP session idErik Janssen2016-08-101-11/+7
| | | | | | | | | | | | | | | | | | | | | Makes libcurl work in communication with gstreamer-based RTSP servers. The original code validates the session id to be in accordance with the RFC. I think it is better not to do that: - For curl the actual content is a don't care. - The clarity of the RFC is debatable, is $ allowed or only as \$, that is imho not clear - Gstreamer seems to url-encode the session id but % is not allowed by the RFC - less code With this patch curl will correctly handle real-life lines like: Session: biTN4Kc.8%2B1w-AF.; timeout=60 Bug: https://curl.haxx.se/mail/lib-2016-08/0076.html
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-8/+8
|
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-3/+2
| | | | | | | | | | | | | | | | | | | | curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* Revert "cleanup: general removal of TODO (and similar) comments"Daniel Stenberg2015-11-241-0/+13
| | | | | | | This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a. Feedback-by: Dan Fandrich URL: http://curl.haxx.se/mail/lib-2015-11/0062.html
* cleanup: general removal of TODO (and similar) commentsDaniel Stenberg2015-11-131-13/+0
| | | | | | They tend to never get updated anyway so they're frequently inaccurate and we never go back to revisit them anyway. We document issues to work on properly in KNOWN_BUGS and TODO instead.
* rtsp: support basic/digest authenticationErik Janssen2015-08-201-2/+23
|
* RTSP: removed another piece of dead codeDaniel Stenberg2015-06-181-2/+1
| | | | Coverity CID 1306668
* rtsp_do: fix DEAD CODEDaniel Stenberg2015-06-151-1/+1
| | | | | | "At condition p_request, the value of p_request cannot be NULL." Coverity CID 1306668.