Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nghttpd: Use nghttp2_ssize #2185

Merged
merged 1 commit into from May 7, 2024
Merged

Conversation

alyssais
Copy link
Contributor

@alyssais alyssais commented May 7, 2024

Otherwise, produces compiler errors on platforms where ssize_t is not the same type as nghttp2_ssize i.e. ptrdiff_t, e.g. s390-linux.

HttpServer.cc:1085:15: error: ambiguating new declaration of 'nghttp2_ssize nghttp2::file_read_callback(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*)'
 1085 | nghttp2_ssize file_read_callback(nghttp2_session *session, intnghttp2> In file included from HttpServer.cc:25:
HttpServer.h:248:9: note: old declaration 'ssize_t nghttp2::file_read_callback(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*)'
  248 | ssize_t file_read_callback(nghttp2_session *session, int32_t stream_id,
      |         ^~~~~~~~~~~~~~~~~~
HttpServer.cc: In function 'void nghttp2::{anonymous}::prepare_status_response(nghttp2::Stream*, nghttp2::Http2Handler*, int)':
HttpServer.cc:1139:28: error: invalid conversion from 'ssize_t (*)(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*)' {aka 'long int (*)(nghttp2_session*, int, unsigned char*, long unsigned int, unsigned int*, nghttp2_data_source*, void*)'} to 'nghttp2_data_source_read_callback2' {aka 'int (*)(nghttp2_session*, int, unsigned char*, long unsigned intnghttp2>       |                            ^~~~~~~~~~~~~~~~~~
      |                            |
      |                            ssize_t (*)(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*) {aka long int (*)(nghttp2_session*, int, unsigned char*, long unsigned int, unsigned int*, nghttp2_data_source*, void*)}

Otherwise, produces compiler errors on platforms where ssize_t is not
the same type as nghttp2_ssize i.e. ptrdiff_t, e.g. s390-linux.

	HttpServer.cc:1085:15: error: ambiguating new declaration of 'nghttp2_ssize nghttp2::file_read_callback(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*)'
	 1085 | nghttp2_ssize file_read_callback(nghttp2_session *session, intnghttp2> In file included from HttpServer.cc:25:
	HttpServer.h:248:9: note: old declaration 'ssize_t nghttp2::file_read_callback(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*)'
	  248 | ssize_t file_read_callback(nghttp2_session *session, int32_t stream_id,
	      |         ^~~~~~~~~~~~~~~~~~
	HttpServer.cc: In function 'void nghttp2::{anonymous}::prepare_status_response(nghttp2::Stream*, nghttp2::Http2Handler*, int)':
	HttpServer.cc:1139:28: error: invalid conversion from 'ssize_t (*)(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*)' {aka 'long int (*)(nghttp2_session*, int, unsigned char*, long unsigned int, unsigned int*, nghttp2_data_source*, void*)'} to 'nghttp2_data_source_read_callback2' {aka 'int (*)(nghttp2_session*, int, unsigned char*, long unsigned intnghttp2>       |                            ^~~~~~~~~~~~~~~~~~
	      |                            |
	      |                            ssize_t (*)(nghttp2_session*, int32_t, uint8_t*, size_t, uint32_t*, nghttp2_data_source*, void*) {aka long int (*)(nghttp2_session*, int, unsigned char*, long unsigned int, unsigned int*, nghttp2_data_source*, void*)}
@tatsuhiro-t tatsuhiro-t added this to the v1.62.0 milestone May 7, 2024
@tatsuhiro-t tatsuhiro-t merged commit db71b2a into nghttp2:master May 7, 2024
26 checks passed
@tatsuhiro-t
Copy link
Member

Thank you for PR. Merged now.

@alyssais alyssais deleted the nghttp2_ssize branch May 7, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants