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

rename XX macro in http_parser.h (IDFGH-1523) #3787

Closed
freedaun opened this issue Jul 16, 2019 · 4 comments
Closed

rename XX macro in http_parser.h (IDFGH-1523) #3787

freedaun opened this issue Jul 16, 2019 · 4 comments

Comments

@freedaun
Copy link

Environment

IDF: v4.0-dev-1275-gfdab15dc7, Windows 10

Problem Description

I got a conflict with http_parser.h, which uses the same macro name:

#define XX() 

Code to reproduce this issue

#define XX(x) something

Proposed solution

Never use non-descript unqualified macro-names in libs, as these identifier belong to the user and end up breaking their code. So either qualify the define and rename it HTTP_PARSER_XX(), or use the standard X-macro name convention ENTRY().

@github-actions github-actions bot changed the title rename XX macro in http_parser.h rename XX macro in http_parser.h (IDFGH-1523) Jul 16, 2019
@igrr
Copy link
Member

igrr commented Jul 16, 2019

@freedaun I would suggest submitting this upstream (https://github.com/nodejs/http-parser). We can then update our copy of http_parser, and also move it into a submodule for easier maintenance in the future.

@freedaun
Copy link
Author

Well, I got the reference from your github, the http_server. But now I see there is an official supported "esp_http_server.h", so I'd better use that. But I'll follow your suggestion anyway.

I really need to implement websockets. I found https://github.com/Molorius/esp32-websocket and am working backwards from that, substituting the http_server part. Maybe the Arduino stuff would be better but there's a knowledge gap with the arduino world.

It would seem the ESP32 is REALLY in need of a native websocket implementation (example), as it is relatively simple and the preferred way to connect to web and mobile apps.

Using native Wifi access has been a complete disaster because of different Android versions (and even manufacturers/models!).

Thanks.

@freedaun
Copy link
Author

@freedaun I would suggest submitting this upstream (https://github.com/nodejs/http-parser). We can then update our copy of http_parser, and also move it into a submodule for easier maintenance in the future.

See: nodejs/http-parser#487

@mahavirj
Copy link
Member

@freedaun It seems like http-parser issue you created upstream is not yet fixed. But we have websocket support in esp_http_server now, config_option and example. I will go ahead and close this issue but please free to reopen if this does not satisfy your requirement or you are looking for something else.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants