Skip to content

Commit 3b9e4f3

Browse files
committed
http2_client: add some function modifiers
1 parent 11f3df7 commit 3b9e4f3

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

main/inc/tasks/http2_client.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,28 @@ struct http2c_handle {
3232
typedef int (*http2c_frame_data_recv_cb_t)(struct http2c_handle *handle, const char *data, size_t len, int flags);
3333
typedef int (*http2c_putpost_data_cb_t)(struct http2c_handle *handle, char *data, size_t len, uint32_t *data_flags);
3434

35-
int http2_client_connect(struct http2c_handle *hd, const char *uri);
36-
void http2_client_free(struct http2c_handle *hd);
35+
extern int http2_client_connect(struct http2c_handle *hd, const char *uri);
36+
extern void http2_client_free(struct http2c_handle *hd);
3737

38-
int http2_client_do_get(struct http2c_handle *hd, const char *path, http2c_frame_data_recv_cb_t recv_cb);
39-
int http2_client_do_post(struct http2c_handle *hd, const char *path,
38+
extern int http2_client_do_get(struct http2c_handle *hd, const char *path, http2c_frame_data_recv_cb_t recv_cb);
39+
extern int http2_client_do_post(struct http2c_handle *hd, const char *path,
4040
http2c_putpost_data_cb_t send_cb,
4141
http2c_frame_data_recv_cb_t recv_cb);
42-
int http2_client_do_put(struct http2c_handle *hd, const char *path,
42+
extern int http2_client_do_put(struct http2c_handle *hd, const char *path,
4343
http2c_putpost_data_cb_t send_cb,
4444
http2c_frame_data_recv_cb_t recv_cb);
4545

46-
int http2_client_execute(struct http2c_handle *hd);
46+
extern int http2_client_execute(struct http2c_handle *hd);
4747

4848
#define HTTP2C_MAKE_NV(NAME, VALUE) \
4949
{ \
5050
(uint8_t *)NAME, (uint8_t *)VALUE, strlen(NAME), strlen(VALUE), \
5151
NGHTTP2_NV_FLAG_NONE \
5252
}
5353

54-
int http2_client_do_get_with_nv(struct http2c_handle *hd, const nghttp2_nv *nva, size_t nvlen, http2c_frame_data_recv_cb_t recv_cb);
55-
int http2_client_do_putpost_with_nv(struct http2c_handle *hd, const nghttp2_nv *nva, size_t nvlen,
56-
http2c_putpost_data_cb_t send_cb,
57-
http2c_frame_data_recv_cb_t recv_cb);
54+
extern int http2_client_do_get_with_nv(struct http2c_handle *hd, const nghttp2_nv *nva, size_t nvlen, http2c_frame_data_recv_cb_t recv_cb);
55+
extern int http2_client_do_putpost_with_nv(struct http2c_handle *hd, const nghttp2_nv *nva, size_t nvlen,
56+
http2c_putpost_data_cb_t send_cb,
57+
http2c_frame_data_recv_cb_t recv_cb);
5858

5959
#endif /* INC_TASKS_HTTP2_CLIENT_H_ */

main/src/tasks/http2_client.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int http2_client_parse_uri(struct http2c_handle *hd, const char *uri)
108108
return 0;
109109
}
110110

111-
int http2_client_connect_to_host(struct http2c_handle *hd)
111+
static int http2_client_connect_to_host(struct http2c_handle *hd)
112112
{
113113
int ret;
114114
struct addrinfo hints = {
@@ -263,7 +263,7 @@ static ssize_t nghttp2_callback_recv(nghttp2_session *session, uint8_t *buf,
263263
return rv;
264264
}
265265

266-
char *nghttp2_frame_type_str(int type)
266+
static char *nghttp2_frame_type_str(int type)
267267
{
268268
switch (type) {
269269
case NGHTTP2_HEADERS:
@@ -535,4 +535,3 @@ int http2_client_do_put(struct http2c_handle *hd, const char *path,
535535
};
536536
return http2_client_do_putpost_with_nv(hd, nva, sizeof(nva) / sizeof(nva[0]), send_cb, recv_cb);
537537
}
538-

0 commit comments

Comments
 (0)