Skip to content

Commit

Permalink
multi: Move http2 push function declarations to header end
Browse files Browse the repository at this point in the history
This change necessary for binary compatibility.

Prior to this change test 1135 failed due to the order of functions.
  • Loading branch information
jay committed Jun 30, 2015
1 parent 616cecf commit 66a5f76
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
49 changes: 25 additions & 24 deletions include/curl/multi.h
Expand Up @@ -283,30 +283,6 @@ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
void *userp); /* private callback
pointer */

/*
* Name: curl_push_callback
*
* Desc: This callback gets called when a new stream is being pushed by the
* server. It approves or denies the new stream.
*
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
*/
#define CURL_PUSH_OK 0
#define CURL_PUSH_DENY 1

struct curl_pushheaders; /* forward declaration only */

CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
size_t num);
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
const char *name);

typedef int (*curl_push_callback)(CURL *parent,
CURL *easy,
size_t num_headers,
struct curl_pushheaders *headers,
void *userp);

CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
int *running_handles);

Expand Down Expand Up @@ -427,6 +403,31 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
curl_socket_t sockfd, void *sockp);


/*
* Name: curl_push_callback
*
* Desc: This callback gets called when a new stream is being pushed by the
* server. It approves or denies the new stream.
*
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
*/
#define CURL_PUSH_OK 0
#define CURL_PUSH_DENY 1

struct curl_pushheaders; /* forward declaration only */

CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
size_t num);
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
const char *name);

typedef int (*curl_push_callback)(CURL *parent,
CURL *easy,
size_t num_headers,
struct curl_pushheaders *headers,
void *userp);

#ifdef __cplusplus
} /* end of extern "C" */
#endif
Expand Down
2 changes: 2 additions & 0 deletions tests/data/test1135
Expand Up @@ -87,6 +87,8 @@ CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
</stdout>
</verify>

Expand Down

0 comments on commit 66a5f76

Please sign in to comment.