Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-server
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-server
Commits
a487eed1
Unverified
Commit
a487eed1
authored
6 years ago
by
Dmitriy A. Gerasimov
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #14 from kelvinblockchain/feature-1505
edit for support mempool
parents
d6c3bcc0
8815cb5e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
http_server/http_client/dap_http_client_simple.c
+30
-4
30 additions, 4 deletions
http_server/http_client/dap_http_client_simple.c
http_server/http_client/dap_http_client_simple.h
+6
-0
6 additions, 0 deletions
http_server/http_client/dap_http_client_simple.h
with
36 additions
and
4 deletions
http_server/http_client/dap_http_client_simple.c
+
30
−
4
View file @
a487eed1
...
@@ -95,8 +95,8 @@ void dap_http_client_internal_delete(dap_http_client_internal_t * a_client_inter
...
@@ -95,8 +95,8 @@ void dap_http_client_internal_delete(dap_http_client_internal_t * a_client_inter
* @param a_error_callback
* @param a_error_callback
* @param a_obj
* @param a_obj
*/
*/
void
dap_http_client_simple_request
(
const
char
*
a_url
,
const
char
*
a_method
,
const
char
*
a_request_content_type
,
void
*
a_request
,
size_t
a_request_size
,
char
*
a_cookie
,
dap_http_client_simple_callback_data_t
a_response_callback
,
void
dap_http_client_simple_request
_custom
(
const
char
*
a_url
,
const
char
*
a_method
,
const
char
*
a_request_content_type
,
void
*
a_request
,
size_t
a_request_size
,
char
*
a_cookie
,
dap_http_client_simple_callback_data_t
a_response_callback
,
dap_http_client_simple_callback_error_t
a_error_callback
,
void
*
a_obj
,
void
*
a_custom
)
dap_http_client_simple_callback_error_t
a_error_callback
,
void
*
a_obj
,
char
**
a_custom
,
size_t
a_custom
_count
)
{
{
log_it
(
L_DEBUG
,
"Simple HTTP request with static predefined buffer (%lu bytes) on url '%s'"
,
log_it
(
L_DEBUG
,
"Simple HTTP request with static predefined buffer (%lu bytes) on url '%s'"
,
DAP_HTTP_CLIENT_RESPONSE_SIZE_MAX
,
a_url
);
DAP_HTTP_CLIENT_RESPONSE_SIZE_MAX
,
a_url
);
...
@@ -124,8 +124,11 @@ void dap_http_client_simple_request(const char * a_url, const char * a_method, c
...
@@ -124,8 +124,11 @@ void dap_http_client_simple_request(const char * a_url, const char * a_method, c
if
(
a_request_content_type
)
if
(
a_request_content_type
)
l_client_internal
->
request_headers
=
curl_slist_append
(
l_client_internal
->
request_headers
,
a_request_content_type
);
l_client_internal
->
request_headers
=
curl_slist_append
(
l_client_internal
->
request_headers
,
a_request_content_type
);
if
(
a_custom
)
if
(
a_custom
)
{
l_client_internal
->
request_headers
=
curl_slist_append
(
l_client_internal
->
request_headers
,(
char
*
)
a_custom
);
for
(
int
i
=
0
;
i
<
a_custom_count
;
i
++
)
{
l_client_internal
->
request_headers
=
curl_slist_append
(
l_client_internal
->
request_headers
,(
char
*
)
a_custom
[
i
]);
}
}
if
(
a_cookie
)
if
(
a_cookie
)
l_client_internal
->
request_headers
=
curl_slist_append
(
l_client_internal
->
request_headers
,(
char
*
)
a_cookie
);
l_client_internal
->
request_headers
=
curl_slist_append
(
l_client_internal
->
request_headers
,(
char
*
)
a_cookie
);
...
@@ -156,6 +159,29 @@ void dap_http_client_simple_request(const char * a_url, const char * a_method, c
...
@@ -156,6 +159,29 @@ void dap_http_client_simple_request(const char * a_url, const char * a_method, c
send_select_break
();
send_select_break
();
}
}
/**
* @brief dap_http_client_simple_request
* @param a_url
* @param a_method
* @param a_request_content_type
* @param a_request
* @param a_request_size
* @param a_response_callback
* @param a_error_callback
* @param a_obj
*/
void
dap_http_client_simple_request
(
const
char
*
a_url
,
const
char
*
a_method
,
const
char
*
a_request_content_type
,
void
*
a_request
,
size_t
a_request_size
,
char
*
a_cookie
,
dap_http_client_simple_callback_data_t
a_response_callback
,
dap_http_client_simple_callback_error_t
a_error_callback
,
void
*
a_obj
,
void
*
a_custom
)
{
char
*
a_custom_new
[
1
];
size_t
a_custom_count
=
0
;
a_custom_new
[
0
]
=
(
char
*
)
a_custom
;
if
(
a_custom
)
a_custom_count
=
1
;
dap_http_client_simple_request_custom
(
a_url
,
a_method
,
a_request_content_type
,
a_request
,
a_request_size
,
a_cookie
,
a_response_callback
,
a_error_callback
,
a_obj
,
a_custom_new
,
a_custom_count
);
}
/**
/**
* @brief dap_http_client_curl_response_callback
* @brief dap_http_client_curl_response_callback
* @param a_ptr
* @param a_ptr
...
...
This diff is collapsed.
Click to expand it.
http_server/http_client/dap_http_client_simple.h
+
6
−
0
View file @
a487eed1
...
@@ -12,6 +12,12 @@ typedef struct dap_http_client_simple {
...
@@ -12,6 +12,12 @@ typedef struct dap_http_client_simple {
int
dap_http_client_simple_init
();
int
dap_http_client_simple_init
();
void
dap_http_client_simple_deinit
();
void
dap_http_client_simple_deinit
();
void
dap_http_client_simple_request_custom
(
const
char
*
a_url
,
const
char
*
a_method
,
const
char
*
a_request_content_type
,
void
*
a_request
,
size_t
a_request_size
,
char
*
a_cookie
,
dap_http_client_simple_callback_data_t
a_response_callback
,
dap_http_client_simple_callback_error_t
a_error_callback
,
void
*
a_obj
,
char
**
a_custom
,
size_t
a_custom_count
);
void
dap_http_client_simple_request
(
const
char
*
a_url
,
const
char
*
a_method
,
void
dap_http_client_simple_request
(
const
char
*
a_url
,
const
char
*
a_method
,
const
char
*
a_request_content_type
,
void
*
a_request
,
size_t
a_request_size
,
char
*
a_cookie
,
const
char
*
a_request_content_type
,
void
*
a_request
,
size_t
a_request_size
,
char
*
a_cookie
,
dap_http_client_simple_callback_data_t
a_response_callback
,
dap_http_client_simple_callback_data_t
a_response_callback
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment