-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add on_status_complete callback (#173)
on_status callback is not called for a response with a status code but without a reason string such as following: ``` HTTP/1.1 400 Server: nginx Date: Fri, 05 Jan 2024 05:25:21 GMT Content-Type: application/json Content-Length: 30 Connection: keep-alive ・・・ ``` It was reported here - #171 Signed-off-by: Gaurav Aggarwal <[email protected]>
- Loading branch information
Showing
10 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/cbmc/proofs/httpParserOnStatusCompleteCallback/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: MIT-0 | ||
|
||
HARNESS_ENTRY=httpParserOnStatusCompleteCallback_harness | ||
PROOF_UID=httpParserOnStatusCompleteCallback | ||
HARNESS_FILE=$(HARNESS_ENTRY) | ||
|
||
DEFINES += | ||
INCLUDES += | ||
|
||
REMOVE_FUNCTION_BODY += | ||
UNWINDSET += | ||
|
||
PROOF_SOURCES += $(PROOFDIR)/$(HARNESS_FILE).c | ||
PROOF_SOURCES += $(SRCDIR)/test/cbmc/sources/http_cbmc_state.c | ||
|
||
PROJECT_SOURCES += $(SRCDIR)/source/core_http_client.c | ||
|
||
EXTERNAL_SAT_SOLVER := kissat | ||
|
||
include ../Makefile.common |
10 changes: 10 additions & 0 deletions
10
test/cbmc/proofs/httpParserOnStatusCompleteCallback/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
httpParserOnStatusCompleteCallback proof | ||
============== | ||
|
||
This directory contains a memory safety proof for httpParserOnStatusCompleteCallback. | ||
|
||
To run the proof. | ||
* Add cbmc, goto-cc, goto-instrument, goto-analyzer, and cbmc-viewer | ||
to your path. | ||
* Run "make". | ||
* Open html/index.html in a web browser. |
1 change: 1 addition & 0 deletions
1
test/cbmc/proofs/httpParserOnStatusCompleteCallback/cbmc-proof.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This file marks this directory as containing a CBMC proof. |
7 changes: 7 additions & 0 deletions
7
test/cbmc/proofs/httpParserOnStatusCompleteCallback/cbmc-viewer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ "expected-missing-functions": | ||
[ | ||
|
||
], | ||
"proof-name": "httpParserOnStatusCompleteCallback", | ||
"proof-root": "cbmc/proofs" | ||
} |
43 changes: 43 additions & 0 deletions
43
...mc/proofs/httpParserOnStatusCompleteCallback/httpParserOnStatusCompleteCallback_harness.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* coreHTTP v3.0.0 | ||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
* this software and associated documentation files (the "Software"), to deal in | ||
* the Software without restriction, including without limitation the rights to | ||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
* the Software, and to permit persons to whom the Software is furnished to do so, | ||
* subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
/** | ||
* @file httpParserOnStatusCompleteCallback_harness.c | ||
* @brief Implements the proof harness for httpParserOnStatusCompleteCallback function. | ||
*/ | ||
|
||
#include "http_cbmc_state.h" | ||
#include "llhttp.h" | ||
#include "core_http_client.h" | ||
|
||
int __CPROVER_file_local_core_http_client_c_httpParserOnStatusCompleteCallback( llhttp_t * pHttpParser ); | ||
|
||
void httpParserOnStatusCompleteCallback_harness() | ||
{ | ||
llhttp_t * pHttpParser; | ||
|
||
pHttpParser = allocateHttpSendParser( NULL ); | ||
|
||
__CPROVER_file_local_core_http_client_c_httpParserOnStatusCompleteCallback( pHttpParser ); | ||
} |