summaryrefslogtreecommitdiffstats
path: root/src/plugins/http
AgeCommit message (Collapse)AuthorFilesLines
2024-08-28http: http_send_data cleanupMatus Fabian1-36/+38
removed unused parameter offset Type: improvement Change-Id: I30cde713731555fb2eb305c303369c1ead4d3783 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-08-28http: http_state_wait_app_reply improvementMatus Fabian1-6/+16
set http status according to whether app also sent the body Type: improvement Change-Id: Ia41603cc21b410ca6929ec3d3e7c4c6808305769 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-08-23http: status line parsing fixMatus Fabian1-9/+25
Request line must only start with method name and server should ignore at least one empty line (CRLF) received prior to the request-line. Type: fix Change-Id: Ifebd992dc4c13df1a3fabfcdef9e7ee644150a21 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-08-19http: make Media Types RFC9110 compliantAdrian Villin1-77/+77
- https://www.rfc-editor.org/rfc/rfc9110.html#name-media-type https://www.iana.org/assignments/media-types/media-types.xhtml Type: improvement Change-Id: I2624dc39a985ff3999aed6e1c833220b7049828d Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-08-16http: http_read_message improvementMatus Fabian2-45/+78
Use svm_fifo_peek in http_read_message and advance rx fifo head by amount of bytes send to app, since not always you won't or can't send all bytes. Type: improvement Change-Id: I84348c9df5c77ba386c9738a754295bb9ea0f7ef Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-08-09http: authority-form target parsing/serializingMatus Fabian3-0/+87
Type: improvement Change-Id: Ifb90818a3526d3d4030a66b1ef7eebedfe97978f Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-08-06http: client POST methodMatus Fabian4-50/+152
Type: improvement Change-Id: Iaa70abcee02866f9a6426a6e8e4709eeba0e8114 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-29http: client code improvementMatus Fabian4-119/+469
Client app can sends request target, custom header and body to HTTP layer. In response it receives all bytes as received from transport, aditionally we provide offset and length of headers and body. In addtion client app is now able to receive response with all status codes and Host header field is set in request at protocol layer. Type: improvement Change-Id: I8c8e2c8f99cdf500126b7c2c722aebc254aa0d9f Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-23http: state machine fixMatus Fabian1-3/+15
When client sends second request without waiting for response of the first request http_ts_rx_callback should drop request (pipelining is not supported) instead of invoking return to state machine which can lead to erroneous state, e.g. reading random data from server app fifo. Added simple http static server url handler for testing to simulate long running request processing, for now hardcoded delay 5 seconds. Type: fix Change-Id: Ied9f7e2e4ee64c982f045c0f7f99a2dc5d7a2108 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-23http: return more than data from server appMatus Fabian5-97/+351
Server app could return headers in front of body/data buffer. Offers apis for building and serialization of headers section. HTTP layer now only add Date, Server and Content-Lengths headers, rest is up to app. Well known header names are predefined. Type: improvement Change-Id: If778bdfc9acf6b0d11a48f0a745a3a56c96c2436 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-08session: improve enable and disable handlingFlorin Coras3-4/+9
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c79d16f6a19767d990e8a4683c296219b559ccd
2024-06-28session: memory leaks on various transports when session disable and enableSteven Luong1-0/+2
When toggling session disable and enable, memory leaks found on various transports. Don't create the timer wheels on enable when they are already creaded. Don't create the spin locks when they are already created. Add session enable disable test in session unit test. Type: fix Change-Id: I08988a96bbf2d67a67c743b50b63f5b1e27402a3 Signed-off-by: Steven Luong <sluong@cisco.com>
2024-06-19http: fix app name formatting in templateMatus Fabian1-2/+2
app name is vector without null termination Type: fix Change-Id: Iaa50770c84f23a71165d76a63c29b76e90006ac6 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-06-13http: return more than url to server appMatus Fabian3-47/+924
Provide all bytes as received from transport as data in the http message to server. Additionally provide offset and length of target path, target query, headers and body. Offers apis for parsing of headers, percent decoding, target path/query syntax verification. Type: improvement Change-Id: Idbe6f13afa378650cc5212ea7d3f9319183ebbbe Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-28http_static: sanitize path before file readMatus Fabian1-0/+68
Romove dot segments from requested target path before start reading file in file handler to prevent path traversal. Type: fix Change-Id: I3bdd3e9d7fffd33c9c8c608169c1dc73423b7078 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-14http: fix unsupported client app methodMatus Fabian1-0/+7
HTTP client app code currently support only GET method but method set in message from client app was silently ignored. Type: fix Change-Id: I99dc6323d9783ee5a20623e7923cfdbf31474a4f Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-14http: notify client when connection failedMatus Fabian1-4/+8
Type: fix Change-Id: I87054e9667fe990d9a2dc3950bc3ce348460018a Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-14http: fix server sending all status codesMatus Fabian1-0/+5
Type: fix Change-Id: I4bc748e3091c2fbe0142d1b74d21a543a62c4ce0 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-13http: fix user agent in requestMatus Fabian1-2/+7
App name is used in HTTP request User-Agent header. Type: fix Change-Id: Ib761e8a8e793e04e8d77141cc8c0f8514ed0e547 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-09http: fix client parse error handlingMatus Fabian1-10/+8
Do not return HTTP errors to server on parse errors in client. Type: fix Change-Id: Id3e99d69626855848faa87af73002d559d948516 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-07http: fix client send another requestMatus Fabian1-0/+7
HTTP client should be able to send another request after large data receiving. Type: fix Change-Id: I8352ea760a4b3de4b79159531c7e4c1fa4e03203 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-07http: notify client on request errorMatus Fabian1-2/+7
Notify client app that we errored out while trying to generate request. Type: fix Change-Id: I3e20fe22d8a927ae8e9bf8391297e10c974dc941 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-03http: fix http server in responseMatus Fabian2-1/+11
App name is used in HTTP response Server header. Type: fix Change-Id: Ie3b2d985dd7d554a0352f7e602891f878bebd031 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-01http: fix client receiving large dataFilip Tehlar1-69/+63
HTTP client was relying on synchronous rx notifications to the client app when moving lage data from underlying transport proto. Recent change in session layer made such notifications asynchronous making http client not working. This patch fixes the issue. Type: fix Change-Id: I4b24c6185a594a0fe8d5d87c149c53d3b40d7110 Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-01-12http: fix memory leakFilip Tehlar1-0/+1
Type: fix Change-Id: I36905132a42d23e719bf0e82eeafa48f60f4887a Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-02http: unify client/server state machinesFilip Tehlar2-327/+350
Type: improvement Change-Id: I57a816fbed8b681dec201edc8d5950a34a555a2b Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-12-04http: fix coverity warningFilip Tehlar1-1/+3
Type: fix Change-Id: I659a67293763a6035cfa64a4057ebf716fe93ab4 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-09-04session: fix allocation of proxy fifosFlorin Coras1-0/+1
Fifos need to be synchronously allocated once a transport like tcp accepts a session. Since events are now delivered asynchronously, proxy apps must explicitly register a cb function that manages fifo allocation prior to being notified of connect event. Type: fix Fixes: 0242d30 Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7df973b7014e53e0766ea2bdc61e9871160bc18b
2023-08-11session: fix coverity warningsFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I910c8ce1713c6d346cc5ea4eb58a89c1c30a10a1
2023-08-09session: async rx event notificationsFlorin Coras1-4/+5
Move from synchronous flushing of io and ctrl events from transports to applications to an async model via a new session_input input node that runs in interrupt mode. Events are coalesced per application worker. On the one hand, this helps by minimizing message queue locking churn. And on the other, it opens the possibility for further optimizations of event message generation, obviates need for rx rescheduling rpcs and is a first step towards a fully async data/io rx path. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id6bebcb65fc9feef8aa02ddf1af6d9ba6f6745ce
2022-12-08http_static: derive mime type from file extensionsDave Barach2-7/+81
Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0f087477e257f5119d7d6182d19f8796773a1f19
2022-12-06http_static: fix http(s) redirectsDave Barach2-12/+34
Add an http redirect template to generate correct-looking "301 Moved Permanently" replies. Supply a default value of 1<<31 for the use_ptr_thresh config parameter. Expose hss_session_get() so friend plugins which register GET / POST handlers with the http_static server can add data to the session fifos. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ie1452eaf61c6f67311fbab092bc1fe03050bf94f
2022-11-11http: use safe pool reallocFlorin Coras1-1/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I572017433a1ba0f8576522f02138928e303e10ab
2022-11-10http: support client connectFilip Tehlar2-53/+448
Type: feature Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I0738c0aefb41ab6c0ff717cfccd1df75ddb481fa
2022-04-07tls http: run config fns after init onesFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia4d8aaafeb3629f421601edffefe9c61c3e69dba
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion1-1/+1
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-23http hsa: use octet-stream content type for tpsFlorin Coras1-1/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I925618e426b325f4fafb9ed39a2d7c2d7c7b38f3
2022-02-23http: improvement reset and close handlingFlorin Coras1-9/+14
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I37ff8099c6c8044881379b4cd47ca8843746c315
2022-02-23http hsa: support multiple listeners for http tpsFlorin Coras2-7/+40
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie89326ed4e599231fc20de67c5dadbb428568bec
2022-02-17tls http srtp: fix session index for listenersFlorin Coras1-3/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If5e6d0e8c686ea93674d6201c38b3a4d1c4786a5
2022-02-11http: fix support for files larger than u32Florin Coras4-15/+16
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iad7304c3a8fef14ec85c4240714feb86637411ca
2022-02-11http: add startup configuration stanzaFlorin Coras2-9/+50
Support segment and fifo sizes for now. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie7242936de7a87df8a703eb371f665be5be4390d
2022-02-10session: use transport endpoint cfg for listenFlorin Coras1-1/+1
Makes it similar to connects. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I38c328670054e1a9ba4dc4ea8fe7519a5a09e8be
2022-02-05http: estimate tx packets for schedulerFlorin Coras1-1/+13
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibca4bf59e6319ffdc1beaa084ca80f216e062af0
2022-02-05session: track bytes dequeued in snd paramsFlorin Coras1-7/+1
Also reset send params flags before calling transports to avoid explicit resets in all transports. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1da7b3fab009728e7fee4199425ced933fa8a122
2022-02-03http: honor max seg len in ptr bufferFlorin Coras1-4/+6
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I58ecd933f36c6622f4c6b373d2d94a48f9fc9eae
2022-01-26http_static: refactor to use http transportFlorin Coras2-2/+24
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I66396a1879eb3c87ef64783eab82a22896413cd0
2022-01-26http: generalize buffer implementationFlorin Coras5-72/+321
And add support for passing of pointers Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida3e5ae4ff7842366ae92a5f33c5e761355951a6
2022-01-25http hsa: avoid extra space in requestFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I70f22350811ef3cd029d69af75659f95cc9a74c8
2022-01-25http: fix rescheduling when transport fifo fullFlorin Coras1-3/+9
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5ae1039fd614865154bae94150371e42f3e6fd2a