Add nghttp2_session_check_server_session() API

This is very simple API, and it returns nonzero if session is
initialized as server.
This commit is contained in:
Tatsuhiro Tsujikawa 2015-11-21 15:07:55 +09:00
parent 63aa3466e9
commit 63a50b1ccf
2 changed files with 12 additions and 0 deletions

View File

@ -3616,6 +3616,14 @@ nghttp2_session_get_last_proc_stream_id(nghttp2_session *session);
NGHTTP2_EXTERN int NGHTTP2_EXTERN int
nghttp2_session_check_request_allowed(nghttp2_session *session); nghttp2_session_check_request_allowed(nghttp2_session *session);
/**
* @function
*
* Returns nonzero if |session| is initialized as server side session.
*/
NGHTTP2_EXTERN int
nghttp2_session_check_server_session(nghttp2_session *session);
/** /**
* @function * @function
* *

View File

@ -6767,3 +6767,7 @@ nghttp2_stream *nghttp2_session_find_stream(nghttp2_session *session,
nghttp2_stream *nghttp2_session_get_root_stream(nghttp2_session *session) { nghttp2_stream *nghttp2_session_get_root_stream(nghttp2_session *session) {
return &session->root; return &session->root;
} }
int nghttp2_session_check_server_session(nghttp2_session *session) {
return session->server;
}